2015 May 07 11:10 PM
How can I do this? I assume it is with the assign component instruction but I am not aware on how to do this. I want to loop the dynamic table into the structure to read that value, but since the field symbol does not have a structure and therefore it doesn't have the component I want the value from, it is failing. Any help is appreciated.
2015 May 08 4:47 AM
Let's assume dyntab is the dynamic internal table, and it contains two fields, one of type C and one of type i.
FIELD-SYMBOLS : <record> type any,
<fld1> type c,
<fld2> type i.
DATA: lr_record type ref to data.
CREATE DATA lr_record like line of dyntab.
ASSIGN lr_record->* to <record> .
ASSIGN COMPONENT 'FLD1' of structure <record> to <fld1>.
ASSIGN COMPONENT 'FLD2' of structure <record> to <fld2>.
LOOP AT dyntab INTO <record>.
" Use <fld1> and <fld2> just like you would use wa-fld1 and wa-fld2
WRITE / : <fld1>,<fld2>.
ENDLOOP.
How can I do this? I assume it is with the assign component instruction but I am not aware on how to do this. I want to loop the dynamic table into the structure to read that value, but since the field symbol does not have a structure and therefore it doesn't have the component I want the value from, it is failing. Any help is appreciated.
2015 May 08 4:47 AM
Let's assume dyntab is the dynamic internal table, and it contains two fields, one of type C and one of type i.
FIELD-SYMBOLS : <record> type any,
<fld1> type c,
<fld2> type i.
DATA: lr_record type ref to data.
CREATE DATA lr_record like line of dyntab.
ASSIGN lr_record->* to <record> .
ASSIGN COMPONENT 'FLD1' of structure <record> to <fld1>.
ASSIGN COMPONENT 'FLD2' of structure <record> to <fld2>.
LOOP AT dyntab INTO <record>.
" Use <fld1> and <fld2> just like you would use wa-fld1 and wa-fld2
WRITE / : <fld1>,<fld2>.
ENDLOOP.
2015 May 08 10:02 PM