Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8608

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

$
0
0

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


Regards,

Rohidas Shinde


Viewing all articles
Browse latest Browse all 8608

Trending Articles



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