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+0
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+0
Please Share!!

About the Author

SAP Yard
SAP Yard
SAPYard is one stop page for all Technical Folks in SAP. You would find un-conventional explanations, tutorials, and tricks. Please like our Facebook Page and also join our LinkedIn Group.

9 Comments on "Add custom fields in standard MIRO header screen through BADI_FDCB_SUBBAS01"

  1. Hi Experts i had another problem in FB60. i used this technique same as the tutorial in MIRO.
    the custom field are showing in FB60 same as MIRO. the only difference is that i cannot get the value of of custom field in FB60. Unlike in MIRO i have created an enhancement please see below code :
    SELECT SINGLE stcd2
    INTO (lv_tax2)
    FROM lfa1 WHERE
    lifnr = i_rbkpv-lifnr.

    IF NOT lv_tax2 IS INITIAL..
    s_ac_vendor_comp_import-zztax_stc2 = lv_tax2.
    ELSE.
    s_ac_vendor_comp_import-zztax_stc2 = ”.
    ENDIF.

    ENDIF.

    CALL FUNCTION ‘MM_VENDOR_DIALOG_COMP_IMPORT’
    EXPORTING
    i_ac_vendor_comp_import = s_ac_vendor_comp_import
    i_rbws = rbkpv-h_rbws
    i_rbvs = rbkpv-h_rbvs
    TABLES
    t_acscr = ti_acscr.

    TRY.
    GET BADI lcl_badi_fmfg.

    CALL BADI lcl_badi_fmfg->put_data_to_screen_object
    EXPORTING
    im_rbkpv = rbkpv.

    CATCH cx_badi_not_implemented.
    ENDTRY.

    IN FB60 ihave tried to find where i will put an enhancement but sadly its not reflecting in custom field.

    But if put the logic in inside the BADI subscreen Like below

    *———————————————————————-*
    MODULE user_command_0100 INPUT.

    CHECK NOT o_badi_fdcb_subbas01 IS INITIAL.
    * put data to main screen
    INVFO-ZZTAX_STC2 =’1234567′.
    CALL METHOD o_badi_fdcb_subbas01->put_data_to_screen_object
    EXPORTING
    im_invfo = invfo.

    ENDMODULE. ” USER_COMMAND_0100 INPUT

    It will effect in the custom field after the program execution. but the problem on this is that the INVFO inside this subscreen has no value. How do i get the query ?
    i want to use INFO-LIFNR to query it in LFA1 to get the taxcode2(custom-field).

    Looking forward

  2. Hi SAP Yard,

    Above tutorial for the enhancement is working as expected.
    however i want to limit the enhancement for MIRO only as i have checked in FV60 it is already effect.

    How can i limit it for MIRO only.

    Thanks in advance.

  3. Hi i have fallowed the above tutorial but it seems its not take affect in my output. our requirement is to display the Tax number 2 in the header info below the balance field. please help us resolved this problem. Looking forward.

  4. Sanja – You can have multiple implementations. Try to implement BADI_FDCB_SUBBAS01. It should work.

    Regards,
    Team SAPYard.

    • Thank you for your reply. I tried , but keep getting error:
      There are already implementations active

      Message no. ENHANCEMENT311

      Diagnosis

      The BAdI definition this is based upon cannot be used more than once. Other active implementations already exist for the same BAdI definition.

      System Response

      This implementation cannot be activated.

      Procedure

      Deactivate one of the other active implementations with the same BAdI definition.

      • Hi Sanja – We take our words back. That BADI cannot have multiple implementations.

        Go to the implementation of the BADI which SAP has provided (I think it is an example implementation). Go to change mode and hit the Deactivate button. It would ask for transport.

        If it works, you create a Z Implementation and put whatever was in SAP’implementation in the two methods. On top of it, put your new field.

        It should work.

        Please do update us.

        Regards,
        Team SAPYard.

  5. We have a requirement to display the “Tax Number 3” value of the vendor in MIRO screen vendor info – header. Problem is that all of the BADIs (BADI_FDCB_SUBBAS01, BADI_FDCB_SUBBAS02, BADI_FDCB_SUBBAS03 and BADI_FDCB_SUBBAS04)are already been implemented by SAP. Do you have any advice how to proceed?

Leave a comment

Your email address will not be published.


*