‎2006 Jul 17 2:26 PM
Hi,
I want to perform a field symbol assign for a dynamic data type(Structure).But i am not sure how the components
of the structure need to be accessed at runtime.
Ex:
'text' - VARIABLE which contains the structure name.
...................................
DATA : ls_DATA TYPE REF TO DATA.
field-symbols: <fs_list> type any.
CREATE DATA ls_DATA TYPE (text).
assign ls_data->* to <fs_list>.
.................................................
.............................
In all the target structures a field named 'VALUE' will be present.And i want to populate it with some value.
How do i access that at runtime?
<fs_list>-VALUE cannot be used DIRECTLY?
‎2006 Jul 17 2:33 PM
You need to know the column name that you want to access.
ASSIGN COMPONENT 'COLUMN1' OF STRUCTURE XXX TO <FS_ANY>.
Now, you have the value of column1 in <FS_ANY>.
You can even have a variable that holds the column name.
ASSIGN COMPONENT (COLUMN1) OF STRUCTURE XXX TO <FS_ANY>.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 17 2:30 PM
hi,
use command:
do.
assign component sy-index of structure <fs_list> to <f>.
if sy-subrc <> 0.
exit.
endif.
...
enddo.regards Andreas
‎2006 Jul 17 2:31 PM
DO.
ASSIGN COMPONENT SY-INDEX OF (STRUCTURE) TO <FS>.
WRITE: <FS>.
ENDDO.
‎2006 Jul 17 2:33 PM
You need to know the column name that you want to access.
ASSIGN COMPONENT 'COLUMN1' OF STRUCTURE XXX TO <FS_ANY>.
Now, you have the value of column1 in <FS_ANY>.
You can even have a variable that holds the column name.
ASSIGN COMPONENT (COLUMN1) OF STRUCTURE XXX TO <FS_ANY>.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 17 2:37 PM