Display mode for fields G/L Account and cost center in ME51N

                                                                 Refer -  Find meta field value

                                                                G/L account - SAKTO - 551(meta field value)

                                                                Cost center - KOSTL - 510(meta field value)



Step 1: Go to T-code: SE37.

Step 2: Give FM name MEREQBADI_FS_ITEM. And click on display.

Step 3: Click on enhance button (shift +F4).

Step 5: Goto EditEnhancement operations- click on show implicit enhancements.

Step 6: Right click on Double quotes (140 line)- enhancement operations- create implementation.


Step 7: Choose enhancement type- Code and click on create implementation and save.

Step 8: Write code.

IF sy-uname 'TRNGAB63'.
  DATA: wa_header TYPE mereq_header,
        wa_item   TYPE mereq_item,
        lv_kostl  TYPE mmpur_metafield VALUE '510',
        lv_sakto  TYPE mmpur_metafield VALUE '551'.
  FIELD-SYMBOLS: <fs_kostl> LIKE LINE OF ch_fieldselection,
                 <fs_sakto> LIKE LINE OF ch_fieldselection.
  CLEAR:wa_item.
  CALL METHOD im_header->get_data
    RECEIVING
      re_data wa_header.              " Header Data
  CALL METHOD im_item->get_data
    RECEIVING
      re_data wa_item.           " Item Data
  IF wa_item-bnfpo IS NOT INITIAL.
    READ TABLE ch_fieldselection ASSIGNING <fs_kostl> WITH TABLE KEY metafield lv_kostl.
    IF  sy-subrc 0.
      <fs_kostl>-fieldstatus '*'.
    ENDIF.
  ENDIF.
  READ TABLE ch_fieldselection ASSIGNING <fs_sakto> WITH TABLE KEY metafield lv_sakto.
  IF  sy-subrc 0.
    <fs_sakto>-fieldstatus '*'.
  ENDIF.
ENDIF.

Step 9: Check and activate the function module.


Check

    * Goto T-code:  ME51N.

    * Give required fields.


******************************Thank You***************************

Comments

Popular posts from this blog

Pf status and user command in factory method - OOPS ALV in ABAP

fetch the data from table and send an email in ABAP

Enhancements in abap