Enhancement for adding old material number field in MM60 transaction
First, append the old material number field in listwa_type structure in program RMMVRZ00. In the standard structure you will find enhancement point. Create enhancement spot and write the below code in between enhancement and endenhancement. Save and activate it.
TYPES BISMT TYPE MARA-BISMT.
Second, append the field in field catalog in the end of the form alv_list_fieldcat_create. At line 135 you will find enhancement point for adding field in field catalog. Write the below code, save and activate it.
CLEAR ls_fieldcat. ls_fieldcat-fieldname = 'BISMT'. ls_fieldcat-tabname = 'MARA'. ls_fieldcat-ref_tabname = 'MARA'. ls_fieldcat-col_pos = '100'. APPEND ls_fieldcat TO et_fieldcat.
Third, write the query for fetching the old material number. Create enhancement spot in the beginning of the form alv_list_output (line 8).
TYPES: BEGIN OF ty_out, matnr TYPE mara-matnr, bismt TYPE mara-bismt, END OF ty_out. DATA lt_out TYPE STANDARD TABLE OF ty_out. FIELD-SYMBOLS <s_out> TYPE ty_out. IF gt_list IS NOT INITIAL. SELECT matnr bismt FROM mara INTO TABLE lt_out FOR ALL ENTRIES IN gt_list WHERE matnr = gt_list-matnr AND spras = sy-langu. ENDIF. FIELD-SYMBOLS <s_list> LIKE LINE OF gt_list. LOOP AT gt_list ASSIGNING <s_list>. READ TABLE lt_out ASSIGNING <s_out> WITH KEY matnr = <s_list>-matnr. IF sy-subrc = 0. <s_list>-bismt = <s_out>-bismt. ENDIF. ENDLOOP.
Save and activate it. Now, execute the MM60 transaction and you will see the old material number field in the output list.