Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FORM display_entries
- USING
- it_tbllin TYPE tt_tbllindup
- it_tblkey TYPE tt_tblflddup
- it_tblfld TYPE tt_tblflddup.
- DATA : ls_tbllin TYPE ts_tbllindup.
- FIELD-SYMBOLS : <fs_tbl> TYPE ANY TABLE,
- <fs_str> TYPE any,
- <fs_fld> TYPE any.
- DATA : lcl_table TYPE REF TO cl_abap_tabledescr,
- lcl_struc TYPE REF TO cl_abap_structdescr,
- it_field TYPE abap_compdescr_tab,
- ls_field TYPE abap_compdescr.
- DATA : ls_tblfld TYPE ts_tblflddup.
- DATA : ls_line TYPE REF TO data.
- LOOP AT it_tbllin INTO ls_tbllin.
- FORMAT HOTSPOT ON.
- WRITE :/10(20) ls_tbllin-tabname.
- FORMAT HOTSPOT OFF.
- ASSIGN ls_tbllin-entries->* TO <fs_tbl>.
- CREATE DATA ls_line LIKE LINE OF <fs_tbl>.
- ASSIGN ls_line->* TO <fs_str>.
- lcl_table ?= cl_abap_typedescr=>describe_by_data( <fs_tbl> ).
- * Get the table line type i.e., structure details
- lcl_struc ?= lcl_table->get_table_line_type( ).
- * Get the components(fields) of the table line
- it_field = lcl_struc->components.
- LOOP AT <fs_tbl> INTO <fs_str>.
- LOOP AT it_field INTO ls_field.
- FORMAT INTENSIFIED ON.
- WRITE /30(20) ls_field-name.
- FORMAT INTENSIFIED OFF.
- ASSIGN COMPONENT ls_field-name
- OF STRUCTURE <fs_str> TO <fs_fld>.
- WRITE 60(20) <fs_fld>. " valeur actuelle
- READ TABLE it_tblkey WITH KEY tabname = ls_tbllin-tabname
- fieldname = ls_field-name INTO ls_tblfld.
- IF sy-subrc EQ 0.
- WRITE 90(20) ls_tblfld-newvalue. " nouvelle valeur
- ENDIF.
- READ TABLE it_tblfld WITH KEY tabname = ls_tbllin-tabname
- fieldname = ls_field-name INTO ls_tblfld.
- IF sy-subrc EQ 0.
- WRITE 90(20) ls_tblfld-newvalue. " nouvelle valeur
- ENDIF.
- ENDLOOP.
- SKIP 1.
- ENDLOOP.
- ENDLOOP.
- ENDFORM.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement