Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8538

Re: Restricted transaction FBL3N by GL Account

$
0
0

Hi Iwan,

 

Just go to SE18 tcode and then  enter the below badi

FI_ITEMS_CH_DATA.

 

open in display mode, then follow the path,

 

Implementation->Create-> <name of implementation> ->enter the code in method of CHANGE_ITEMS.

 

Now, here you can do your code and restrict the user GL account wise. In this method CT_ITEMS internal table contains the data.

 

Below code is just an example, you have to do coding according to your requirement...

 

IF sy-tcode = 'FBL1N'.

     TYPES : BEGINOF ty_yafb1n ,

               uname(12) TYPEc,

             ENDOF ty_yafb1n.

     DATA : it_yafb1n TYPESTANDARDTABLEOF ty_yafb1n,

            wa_yafb1n TYPE ty_yafb1n.

 

     DATA wa_ct_items LIKELINEOF ct_items.

     DATA flag TYPEiVALUE0.

 

     SELECT uname

       INTO wa_yafb1n-uname

       FROM yafb1n.

 

       APPEND wa_yafb1n TO it_yafb1n.

       CLEAR wa_yafb1n.

     ENDSELECT.

 

     LOOPAT it_yafb1n INTO wa_yafb1n.

       IF sy-uname = wa_yafb1n-uname.

         flag = 1.

       ENDIF.

       CLEAR wa_yafb1n.

     ENDLOOP.

 

     LOOPAT ct_items INTO wa_ct_items.

       CALLFUNCTION'CONVERSION_EXIT_ALPHA_OUTPUT'

         EXPORTING

           input  = wa_ct_items-konto

         IMPORTING

           output = wa_ct_items-konto.

 

     IF wa_ct_items-konto BETWEEN'P1'AND'P99999'AND flag = 0.

       MESSAGE'You Do not have Authorisation to view the required Details'TYPE'E'.

     ENDIF.

 

       CLEAR wa_ct_items.

     ENDLOOP.

 

     CLEAR : it_yafb1n, it_yafb1n[], flag.

     REFRESH : it_yafb1n, it_yafb1n[].

   ENDIF.

 

 

Many Thanks / Himanshu Gupta


Viewing all articles
Browse latest Browse all 8538

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>