Add custom fields in standard MIRO header screen through BADI_FDCB_SUBBAS01

Custom fields in SAP MIRO
Share on Facebook6Share on LinkedIn12Tweet about this on TwitterShare on Google+2
Please Share!!

In this post, I would show how to add custom fields in the standard SAP MIRO header screen using BADI ‘BADI_FDCB_SUBBAS01’.

Allowance and Vendor Invoice IDoc number are the two custom fields added in MIRO header.
[adToAppearHere]

BADI implementation steps and configuration of custom subscreen:

1) Implementation of this BADI BADI_FDCB_SUBBAS01 is bit tricky. We have to create one custom implementation to add the new custom fields (SAP has provided example implementations for our reference). There are two methods PUT_DATA_TO_SCREEN_OBJECT and GET_DATA_FROM_SCREEN_OBJECT to put and get data to and from MIRO screen.

2) We have to configure Subscreens for the new custom fields.

Go to the Subscreens Tab in the created Implementation.

The Subscreen area column program should be SUBBAS01(check the example implementation for reference). The Program called column program ‘SAPLZO_CUSTOM_FIELD_IN_MIRO’ is custom module pool program which is a copy of standard SAP example program ‘SAPLBADI_EXAMPLE_FDCB_BAS’.

The Screen Number is 900 will hold the new custom fields, which is present in called program ‘SAPLZO_CUSTOM_FIELD_IN_MIRO’.

Append new custom fields:

Say the new fields are ZZ_ALLOWANCE and ZZ_IDOCNUM. Since these two fields are to be added to the MIRO header, we have to be append these fields into table RBKP, structures INVFO, ACMM_VENDOR_COMP (as shown below). These structures and tables would be used in the BADI implementation to add the new fields in the MIRO screen.

Code snippet to enhance the screen:

As mentioned earlier, we have to create a module pool custom program and attach as sub-screen. For the ease of development, we can copy the SAP standard program SAPLBADI_EXAMPLE_FDCB_BAS and make change in that program.

Remove the fields from the example screen and add the custom fields which we want to add in MIRO.

The standard SAP example is adding Lots Number. We have to comment it and add our new custom fields as highlighted below.


Result of the above implementation:

With the above simple steps, you would be able to enhance the standard SAP MIRO screen.

The custom fields would be saved in the standard SAP table RBKP.

 

——————————-Updated 26th Feb 2015——————————-

One of our reader was not able to save the data in RBKP table. He missed to add the code in the two methods. Please check if you also need to add logic in the below methods..

method IF_EX_BADI_FDCB_SUBBAS01~PUT_DATA_TO_SCREEN_OBJECT .

* fill interface attributes from importing paramters
me->if_ex_badi_fdcb_subbas01~invfo  im_invfo.

endmethod.

method IF_EX_BADI_FDCB_SUBBAS01~GET_DATA_FROM_SCREEN_OBJECT .

* fill export parameters from interface attributes
ex_invfo  me->if_ex_badi_fdcb_subbas01~invfo.

endmethod.

You might like to check our other post on Steps to add custom Tab in MIRO screen using a BADI.

 

 

Image source : www.sapa-tour.net (modified)

Share on Facebook6Share on LinkedIn12Tweet about this on TwitterShare on Google+2
Please Share!!