Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Author: Pablo Casamayor
Submitted: 28.06.2008

The aim of this tutorial is to help in providing a solution when we want to display customer fields in logistics invoice verification transactions.


Figure 1 (customer fields in MIR7 transaction)

The requirement was to display additional fields in logistics invoice verification transactions.

The original idea was to use exit LMR1M001 but reading the documentation of EXIT_SAPLMR1M_003 I found out that:

As of Release 4.6A, transaction MR1M is no longer supported. Therefore this customer exit and its functions are obsolete.

Besides this I had to do the development in two different systems (SAP ERP Central Component 5.0 and SAP ECC 6.0).

So I gave up the exit and concentrated my efforts in finding an alternative.

For this I found badi BADI_FDCB_SUBBAS01

The documentation of this badi is:

Subscreen enhancement in function group FDCB, basic data screen 010 for vendors, 510 for customers.

These screens are accessed in the Enjoy transactions for FI document entry or MM invoice receipt. In FI, for example, these are the transactions FB60, FB65, FB70, FB75 or for parking, FV60, FV65, FV70, FV75.

In MM, screen 010 is accessed for example in transaction MIRO.

Screen fields: The fields must be in structure INVFO.

If the values in the FI document are to be saved, the fields must also be in table BKPF or BSEG. If the values in the MM document are to be saved, the fields must be in the structure ACMM_VENDOR_COMP, the view RBKP, and table RBKP.

My case was the one referring to MM.

First I tried to implement BADI_FDCB_SUBBAS01 but there was an implementation already running (FI_FDCB_SUBBAS01_EX).

Then I tried with the following one BADI_FDCB_SUBBAS02 but there was an implementation already running (FI_FDCB_SUBBAS02_EX).

Next I tried with BADI_FDCB_SUBBAS03 but there was an implementation already running (WRF_BADI_FDCB_BAS).

The only badi left then was BADI_FDCB_SUBBAS04.

Just having a look at the example implementation class CL_EXM_IM_BADI_FDCB_SUBBAS01 of badi BADI_FDCB_SUBBAS01 i found out that there were two methods available:

PUT_DATA_TO_SCREEN_OBJECT

GET_DATA_FROM_SCREEN_OBJECT

And within them I needed to add the following:

Error rendering macro 'code': Invalid value specified for parameter 'lang'
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.

I just substituted subbas01 by subbas04.

Then based on tab subscreen of implementation FI_FDCB_SUBBAS01_EX i had to create dynpro 100 as well.

For this dynpro the flow logic was:

Error rendering macro 'code': Invalid value specified for parameter 'lang'
PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
  MODULE receive_data.
*

PROCESS AFTER INPUT.
* get again actual data from main screen
  MODULE receive_actual_data.
*
* implement from here on customer coding
* enumerate ALL fields on the screen because of field transportation
* with or within a module
  FIELD:
   invfo-lotkz.
* send data back to main screen
  MODULE USER_COMMAND_0100.

*----------------------------------------------------------------------*
***INCLUDE LBADI_EXAMPLE_FDCB_BASO01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  receive_data OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE receive_data OUTPUT.
  IF o_badi_fdcb_subbas01 IS INITIAL.
    CALL METHOD cl_exithandler=>get_instance_for_subscreens
      CHANGING
        instance                      = o_badi_fdcb_subbas01
      EXCEPTIONS
        no_reference                  = 1
        no_interface_reference        = 2
        no_exit_interface             = 3
        data_incons_in_exit_managem   = 4
        class_not_implement_interface = 5
        OTHERS                        = 6.
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
* object created  ?
  CHECK NOT o_badi_fdcb_subbas01 IS INITIAL.
* get data from main screen

  CALL METHOD o_badi_fdcb_subbas01->get_data_from_screen_object
    IMPORTING
      ex_invfo = invfo.
ENDMODULE.                 " receive_data  OUTPUT


*----------------------------------------------------------------------*
***INCLUDE LBADI_EXAMPLE_FDCB_BASI01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  receive_actual_data  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module receive_actual_data input.
*  object created  ?
  CHECK NOT o_badi_fdcb_subbas01 IS INITIAL.
* get data from main screen

  CALL METHOD o_badi_fdcb_subbas01->get_data_from_screen_object
    IMPORTING
      ex_invfo  = invfo.
endmodule.                 " receive_actual_data  INPUT


*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.
 CHECK NOT o_badi_fdcb_subbas01 IS INITIAL.
* put data to main screen

  CALL METHOD o_badi_fdcb_subbas01->put_data_to_screen_object
    EXPORTING
      im_invfo  = invfo.
endmodule.                 " USER_COMMAND_0100  INPUT


and so I did for my implementation (instead of subbas01 I used subbas04).

In my case only MM invoice receipt was going to be affected.

So I created my customer fields in append structures of:

INVFO, RBKP, RBKP_V, ACMM_VENDOR_COMP.



Figure 2 (append structure to structure INVFO)



Figure 3 (append structure to table RBKP)



Figure 4 (append structure to view RBKP_V)



Figure 5 (append structure to structure ACMM_VENDOR_COMP)

From here on you can display additional fields in logistics invoice verification transactions. Just add the new fields in the screen and code the corresponding logic.

Tips: the following transactions will be affected  

'FB60'

'FB65'

'FB70'

'FB75'

'FV60'

'FV65'

'FV70'

'FV75'

'FV63'

'MIRO'

'MR8M'

'MIRA'

'MIR7'

'MIR4'

You´ll need to add what´s necessary to prevent the new custom fields from appearing in unwanted transactions.

38 Comments

  1. Former Member

    This is a simply amazing WIKI...It has cleared lots of doubts as well..

    Thanks a lot for this WIKI....Keep Posting...

  2. Guest

    Hello Pablo:

    You say...

    You´ll need to add what´s necessary to prevent the new custom fields from appearing in unwanted transactions...

     It's OK but what's necessary?

    I have implemented in the Badi

     METHOD if_ex_badi_fdcb_subbas04~put_data_to_screen_object.

      IF sy-tcode EQ 'FV60' OR sy-tcode EQ 'FV67' OR sy-tcode EQ 'FV63'.
        me->if_ex_badi_fdcb_subbas04~invfo  = im_invfo.
      ENDIF.

    ENDMETHOD.

     and

    METHOD if_ex_badi_fdcb_subbas04~get_data_from_screen_object.

      IF sy-tcode EQ 'FV60' OR sy-tcode EQ 'FV67' OR sy-tcode EQ 'FV63'.
        ex_invfo  = me->if_ex_badi_fdcb_subbas04~invfo.
      ENDIF.

    ENDMETHOD.

    The PBO and PAI not run (in my z subscreen) in MIRO (for example) but the subscreen is loaded.

    Any suggestions?

    LOOP AT SCREEN and MODIFY visibility when ingress in MIRO?

  3. Hi,

     you need to hide the fields for the transactions you don´t want them to be displayed.

     And yes, a LOOP AT SCREEN and MODIFY will do.

     Best regards.

  4. Guest

    Hi Pablo.

    This wiki is great, it helped me to add new fields on MM and FI transactions. I have one issue, I need to add a new field on FV60, so i did what u said and great, the new fields are showed on FV60. But i dont know what tables and structures i need to append, because the tables that u mentioned are just for MM.

    Do u know the tables and structures that i need to modify in FI?

    Regards

  5. Hi Miguel,

    i haven´t used the badi for Fi just for MM.

    According to the documentation of the badi:

    "If the values in the FI document are to be saved, the fields must also be in table BKPF or BSEG"

    So if you just want to save your z fields in FI it seems you´ll need to declare them too in BKPF or BSEG.

    In case someone is interested, this is how Miguel solved the problem:

    (Thread:  Add new fields FV60 using BADI_FDCB_SUBBAS04)

    http://forums.sdn.sap.com/thread.jspa?forumID=50&threadID=1872002

    Just appending the new fields on VBKPF the same as BKPF.

    Best regards.

  6. Guest

    Hello Pablo,

    I have a question. On the section on where you create the dynpro the code has a comment that asks to enumerate all the fields on the screen because of field transportation with or within module.

    *
    * implement from here on customer coding
    * enumerate ALL fields on the screen because of field transportation
    * with or within a module
      FIELD:
       invfo-lotkz.

    Let's say I appended to RBKP a variable called ZZPED would I have to change invfo-lotks to that variable? The comment got me confused.

  7. Hi jamiros,

    in PAI at least you need to do:

    FIELD:
       invfo-zzped.

    but you can do as desired (according to your needs):

    e.g.

    FIELD  invfo-zzped   MODULE check_zzped ON REQUEST.

    Best regards.

  8. Guest

    Hi,

    I am trying the same, but i am not able to append in structure INVFO.

    While appending I get the list of already appended structure and also i am not able to add field in that appended structures.

    Please give me solution.

  9. Guest

    Hi,

    I have customer Append Structure in BSEG table hence i added my field in that. and BSEG is also included in INVFO.Hence my field get into INVFO.

    Is it correct ?

    Regards

  10. Hi,

    the documentation of the badi says:

    If the values in the FI document are to be saved, the fields must also be in table BKPF or BSEG.
    If the values in the MM document are to be saved, the fields must be in the structure ACMM_VENDOR_COMP, the view RBKP_V, and table RBKP

    Regards.

  11. Guest

    Hi,

    use the sample implementation code  in se18 : in first screen enter: BADI_FDCB_SUBBAS01  ->click DISPLAY

    in second screen GOTO/sapmle code /display

    I have implemented this badi and I've added customer fields in ACMM_VENDOR_COMP,view RBKP_V, and table RBKP .

    Regards.

  12. Guest

    Hi,

    I am doing this for FI document.

    Still i am not able to add field in INVFO. So i added in BSEG hence it automatically come to INVFO.

    I can see field on screen for FI and MM transactions.

    But while executing transaction MIRO i am getting error "Period Version is not maintained".

    Request your help.

    Regards

  13. Guest

    Thank you so much for the clear insight.

  14. Guest

    Hi Pablo,

    If I wanna add a new label in MIRO how could I do this? For example "Other Data" Tab instead "Basic Data" Tab, is it possible to do this?

    Thanks in advance,

  15. Hi Sergio,

    as far as i know it is not possible to add a new tab with badi  BADI_FDCB_SUBBAS04.

    This badi only creates a new subscreen at the bottom of "Basic data" tab where you can add your custom fields.

    Best regards.

  16. Guest

    Hi Pablo,

    I tried to insert field UMSKZ. In flow logic, i put FIELD: invfo-umskz. In the Layout, i inserted from dictionary infvo-umskz.

    When i enter MIRO, the field is there, but when i select any value for the special G/L indicator, i receive a error message that says the record is not in table t074u. But it is...the search help attached contains all values. But no matter what value I select, the transaction throws me that message.

    And I have another question. In bseg, the special gl indicator will be automatically inserted in the correponding record of the invoice, if I enter a value in umskz? Or do I have to do some connections. I do not know how.

    Thank you very much,

    Efren

  17. Hi Efren,

    this badi is used to display custom (z) fields at header level.
    This fields will then be saved in table RBKP.
    UMSKZ is a field that is to be found in table BSEG (item level).

    if you have a look at this OSS Note:

    Note 904652 - MIRO: Different from FB60 https://service.sap.com/sap/support/notes/904652

    you will find that:

    MIRO is an independent Materials Management (MM) transaction that does not claim to be the same as the accounting transactions (such as FB60 or FB01).
    MIRO was developed to allow users to process vendor invoices within the context of the MM procurement processes as simply as possible.
    For this reason, the field selection was limited to what was absolutely necessary (among other differences). For example, the following fields
    from the accounting document are not available in transaction MIRO (this list is not complete):
    ....
    Special G/L indicator (BSEG-UMSKZ)

    Solution

    The differences listed above and other similar differences are not program errors.
    Despite the listed restrictions, it is possible to enter invoice documents correctly in MIRO.
    In certain cases (for non-order-related documents), you may need to switch to an FI transaction.

    have you considered doing a substitution instead of using the badi?

    Best regards.

  18. Guest

    Hello,

    Thank you very much for your reply. What do you mean by subtitution?The thing is that the request is to put UMSKZ in MIRO. What do you suggest?

    P.S.: I understand now why umskz does not work but i need to find a solution. I guess i must use another badi, right?

    Thanks again,

    Efren

  19. Hi,

    there are several possibilities, here you have some of them listed with links:

    1.- FI Substitution (transaction GGB1) -> http://wiki.sdn.sap.com/wiki/display/ERPFI/Validations+and+Substitutions

    2.- BTE -> http://wiki.sdn.sap.com/wiki/display/Snippets/Business+Transaction+events%28BTE%29

    3.- badi -> maybe badi AC_DOCUMENT

    You´ll have to decide which one is the right solution for you.

    Please do search in SDN and you´ll find lots of information about substitutions, BTE´s, badis, ..etc.

    Best regards.

  20. Guest

    Hi,

    I solved it using your badi and also ac_document, where i copied invfo-umskz in the lines of xaccit[].

    Thanks,

    Efren

  21. Former Member

    Hi,

    Thanks for good wiki.Here after adding the screen i am getting error like posting key is  not defined.When i deactivate the badi it is working fine with out errors.Can you tell give some idea where it went wrong.

  22. Former Member

    hi Pablo,

    This is a great work, but i am new to SAP ABAP and i would like to know that how can i add an extra input field in the Payment tab.  Can you help me out by letting me know the steps.

    Thanks & Regards,

    Durgesh.

  23. Hi,

    this badi just allows to add new fields in a subscreen under "Basic data" tab and with it it´s not possible to add new fields in the "Payment" tab.

    Best regards.

  24. Former Member

    hi,

    I would like to know a BADI or any other method by which i can add new input field to "Payment" tab.

    Thanks & Regards,

    Durgesh.

  25. Hi,

    i´m sorry to say that there is none that i know of.

    Best regards.

  26. Former Member

    Hi Pablo,

    I would like to ask that when i want to view the field in MIR4 then i want it to be input disable so can you guide me on this issue?

    Regards,

    Durgesh

  27. Hi,

    there are several threads in SCN already answering this.

    Anyway, if memory doesn´t fail me:

     1.- in a z module of PBO after module receive_data you could do something like:
    
    CONSTANTS: c_aktyps(17) TYPE c VALUE '(SAPLFDCB)G_AKTYP'.
    FIELD-SYMBOLS: <fs_aktyps> TYPE ANY.
    ASSIGN (c_aktyps) TO <fs_aktyps>.
    CLEAR g_aktyp.
    g_aktyp =  <fs_aktyps>.
    
    here g_aktyp can have these values:
    H -> create
    V -> modify
    A -> display
    
    according to this you could do as you wish e.g.:
    
    IF g_aktyp <> 'A'.
      LOOP AT SCREEN.
        CASE screen-name.
          WHEN 'INVFO-ZFIELD'.
            screen-input = '1'.
            MODIFY SCREEN.
          ....
    
        ENDCASE.
      ENDLOOP.
    ENDIF.
    
    
    
    2.- in module receive_actual_data of PAI do:
    
      CONSTANTS: c_aktyp(17) TYPE c VALUE '(SAPLFDCB)G_AKTYP'.
      FIELD-SYMBOLS: <fs_aktyp> TYPE ANY.
      ASSIGN (c_aktyp) TO <fs_aktyp>.
    
      IF  <fs_aktyp> NE 'A'  "H(Create)/V(modify)/A(Display)
      AND <fs_aktyp> NE 'V'.
    * get data from main screen
        CALL METHOD o_badi_fdcb_subbas04->get_data_from_screen_object
          IMPORTING
            ex_invfo = invfo.
      ENDIF.
    

    Please don´t take the above code snippets it litterally.

    Please do play around a bit with the above code and you´ll finally be able to achieve what you wanted.

    Best regards.

  28. Former Member

    Thanks a lot Pablo.

  29. Former Member

    Hi Pablo,

    i have enhanced the Basic data tab, but when i am giving the value in the input field it is not getting displayed after i press enter.

    Do i first need to enhance the tables then only would the value of the input field display or do i need to code something extra?

    Regards,

    Durgesh.

  30. Hi,

    Do i first need to enhance the tables...

    yes, the documentation of the badi says:

    If the values in the FI document are to be saved, the fields must also be in table BKPF or BSEG. If the values in the MM document are to be saved, the fields must be in the structure ACMM_VENDOR_COMP, the view RBKP_V, and table RBKP. 

    Best regards.

  31. Former Member

    hi Pablo,

    how can we flow this data to FI?

    Thanks & Regards,

    Durgesh.

  32. Hi,

    this has already been answered here (search the comments here of Miguel Alvear) and read this carefully:

    http://scn.sap.com/thread/1872002

    Best regards.

  33. Former Member

    Hi Pablo,

    So to populate the new fields in the database table would we be require to code something extra or these steps would be sufficient?

    Regards,

    Durgesh.

  34. Former Member

    Hi Pablo,

    I want this enhancement to be done for MIRO, MIRa and MIR4 only, but i am getting the field displayed in BASIC DATA tab for FB60, MRM8 and others too.

    So is there any way by which we may not let the field get displayed on other transactions?

    Kindly reply asap.

    Regards,

    Durgesh

  35. Former Member

    i found it thanks for all the help provided

    Regards,

    Durgesh

  36. Former Member

    Hi Pablo,

    I have created 2 custom fields on Basic Data tab for Customer and Special GL Indicator. I have created z fields for both and appended to BKPF and BSEG.

    Fields appear on MIR7 transaction Basic Data screen. But when i enter the value into the fields and press enter values in those fields vanish on Basic Data screen itself.

    Need your suggestion on the same.

     

    Regards,

    PS