‎2019 Nov 06 8:31 AM
how do I refer to the table with a given column number?
for example I want the field of the number 5 column
‎2019 Nov 06 9:05 AM
‎2019 Nov 06 9:05 AM
‎2019 Nov 06 9:47 AM
‎2019 Nov 06 9:40 AM
hi luca treva,
DATA : idetails TYPE abap_compdescr_tab,
xdetails TYPE abap_compdescr,
lt_root TYPE TABLE OF ehhssd_inc_root,
ref_table_des TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS : <lfs_any> TYPE any.
ref_table_des ?= cl_abap_typedescr=>describe_by_name( 'YOUR INTERNAL TABLE STRUCURE NAME' ). "note it should be global
idetails[] = ref_table_des->components[].
READ TABLE idetails INTO xdetails INDEX 5.
IF sy-subrc EQ 0.
LOOP AT your_table INTO work_area.
ASSIGN COMPONENT xdetails-name OF STRUCTURE work_area TO <lfs_any>.
ENDLOOP.
ENDIF. Cheers,
Prasanna CD
‎2019 Nov 06 9:46 AM
Or simply:
LOOP AT your_table INTO work_area.
ASSIGN COMPONENT 5 OF STRUCTURE work_area TO FIELD-SYMBOL(<lfs_any>).
ENDLOOP.