TABLES:
sdibe_massfields.
FORM create_mrp_area USING p_display LIKE gt_display.
DATA: r_descr TYPE REF TO cl_abap_structdescr,
wa_comp1 TYPE abap_compdescr,
wa_comp2 TYPE abap_compdescr,
lw_selfs LIKE sdibe_massfields.
FIELD-SYMBOLS: <fs1>.
r_descr ?= cl_abap_typedescr=>describe_by_data( p_display ).
*上傳檔案欄位有的都更新
LOOP AT r_descr->components INTO wa_comp1.
r_descr ?= cl_abap_typedescr=>describe_by_data( sdibe_massfields ).
LOOP AT r_descr->components INTO wa_comp2.
IF wa_comp2-name CS wa_comp1-name.
ASSIGN COMPONENT wa_comp2-name OF STRUCTURE lw_selfs TO <fs1>.
<fs1> = 'X'.
EXIT.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM.