Skip to Content

Vendor code addition in FBL3N report using Business Transaction Events (BTE)

 

Requirement – Business requirement is to display vendor code in FBL3N report for GR-IR clearing a/c on each line item. 

 

You can add additional field to FBL3N reports with using BTE exit.

To find a BTE, Go to transaction FIBF and follow the below path.

 

Untitled.jpg

 

Untitled.jpg

 

Use the Documentation button to see the documentation for the BTE.
Untitled.jpg

 

Click on sample function module to see the function module for BET.

Untitled.jpg

 

Copy the function module and create new with Z.

Untitled.jpg

 

Implementing the BTE

Go back to transaction FIBF

Create a new product for BET active the same

Untitled.jpg

 

Untitled.jpg

 

Then go to below path to attached the product to Z function module which is created.

 

Untitled.jpg

 

Untitled.jpg

Now edit existing structure RFPOS and add the new fields as shown in screen shot.

Untitled.jpg

 

Then add the same fields in structure RFPOSX.

 

Untitled.jpg

 

 

After that run the program RFPOSXEXTEND from SE38.

After this you can see vendor code and names column in FBL3N.

 

Untitled.jpg

 

 

Then write the code as per your requirement.

 

FUNCTION ZSAMPLE_INTERFACE_00001650.

*”———————————————————————-

*”*”Local Interface:

*”  IMPORTING

*” VALUE(I_POSTAB) LIKE  RFPOS STRUCTURE  RFPOS

*”  EXPORTING

*” VALUE(E_POSTAB) LIKE  RFPOS STRUCTURE  RFPOS

*”———————————————————————-

*————– Initialize Output by using the following line ———-

e_postab = i_postab.

  TABLES : BSEG, LFA1.

  DATA: w_name1 TYPE lfa1-name1,

        w_lifnr TYPE lfa1-lifnr,

        w_ebeln TYPE ekko-ebeln.

  IF e_postab-blart EQ ‘WE’.     “For MIGO documents

    SELECT SINGLE ebeln

           INTO w_ebeln

           FROM bseg

           WHERE belnr = e_postab-belnr

             AND bukrs = e_postab-bukrs

             AND gjahr = e_postab-gjahr

             AND hkont = e_postab-hkont.

    IF sy-subrc = 0.

      SELECT SINGLE lfa1~name1

lfa1~lifnr

            INTO   (w_name1, w_lifnr)

            FROM ekko INNER JOIN lfa1 ON ekko~lifnr = lfa1~lifnr

            WHERE ekko~ebeln = w_ebeln.

      IF sy-subrc = 0.

        e_postab-zname  = w_name1.

        e_postab-zlifnr = w_lifnr.

CLEAR:w_name1,w_lifnr.

      ENDIF.

    ENDIF.

  ELSE.                           “For other than MIGO doc i.e. Vendor Invoice

    SELECT SINGLE lifnr

          FROM    bseg

          INTO  (e_postab-zlifnr,

e_postab-zaugbl)

     WHERE  bukrs = i_postab-bukrs

        AND gjahr = i_postab-gjahr

        AND belnr = i_postab-belnr

        AND bschl IN (’31’,’21’)

        AND koart = ‘K’.

* Fetching Vendor Name

    SELECT SINGLE name1

           FROM lfa1

           INTO e_postab-zname

           WHERE lifnr = e_postab-zlifnr.

  ENDIF.

ENDFUNCTION.

 

 

Result : Vendor code and name is appearing in FBL3N.

 

Untitled.jpg

 

Same way you can add more fields base on your requirement.

 

Regards,

Rohidas Shinde.

To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

  1. ACR RUBEN

    Dear Rohidas,

    Thanks for the excellent documentation.

    We have one issue. We are not able to create Event 00001650. We have 00001649 & 00001651 in our system. How to create or activate this event.

    Thanks in advance

    Regards

    ACR.Ruben

    (0) 
    1. Rohidas Shinde Post author

      Hi,

      Go to transaction FIBF & follow the below path.

      Untitled.jpg

      Then click on new entries.

      Untitled.jpg

      In F4 help you will find the 00001650 event. Select the entry and save the record.

      Other wise check the entry in table TBE01.

      Regards,

      Rohidas Shinde

      (1) 
      1. ACR RUBEN

        Dear Rohidas Shinde,

        Great,

        Thanks a ton for the swift reply.

        Yes it is working.

        Thanks again for sharing the knowledge.

        Regards

        ACR.Ruben

        (0) 
  2. shubhanshu Agrawal

    Hi Rohidas,

    I implemented 1650 BTE for FBL3N to add vendor code, name and user id in output. I appended fields in RFPOS ans RFPOSX structure as well.

    All my process is running fine in foreground and get my required columns with value in output. But when I run the same FBL3N in background then it gives me appended columns without value.

    I debug backgroung job ans value is coming in backend till REUSE_ALV_GRID_DISPLAY. I am not able to find any solution regarding this.

    Please help me.

    Thanks

    Shubhanshu

    (0) 

Leave a Reply