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:
BEGINOF ty_out,
matnr TYPE mara-matnr,
bismt TYPE mara-bismt,
ENDOF ty_out.
DATA lt_out TYPESTANDARDTABLEOF ty_out.
FIELD-SYMBOLS<s_out>TYPE ty_out.
IF gt_list ISNOTINITIAL.
SELECT matnr bismt
FROM mara
INTOTABLE lt_out
FORALLENTRIESIN gt_list
WHERE matnr = gt_list-matnr.
ENDIF.
FIELD-SYMBOLS<s_list>LIKELINEOF gt_list.
LOOPAT gt_list ASSIGNING<s_list>.
READTABLE lt_out ASSIGNING<s_out>WITHKEY 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.
ABAP source code in this document was coloured using the ABAP code lighter for SCN.
Best regards,
George Shlyahov