09-23-2009 4:44 PM
Hi,
how can I modify a the value of a field if the type is type table ? Usually you can
say e.g.
*MODIFY ET_ITEM FROM <fs_wa> TRANSPORTING BE_LOG_SYSTEM.
But you will get the error in has not a componenet like 'BE_LOG_SYSTEM'
because it has the type type table
data ET_ITEM type table.
field-symbols: <fs_wa> TYPE data.
FIELD-SYMBOLS: <fs_logsyst>.
DATA dy_row type ref to data.
create data dy_row like line of ET_ITEM.
assign dy_row->* to <fs_wa>.
LOOP AT ET_ITEM ASSIGNING <fs_wa>.
ASSIGN COMPONENT 8 OF STRUCTURE <fs_wa> TO <fs_logsyst>.
IF <fs_wa> IS ASSIGNED.
<fs_logsyst> = 'E77CLNT200'.
*MODIFY ET_ITEM FROM <fs_wa> TRANSPORTING BE_LOG_SYSTEM.
ENDIF.
ENDLOOP.
Regards
Alexander
09-23-2009 4:48 PM
Hi
U don't need any MODIFY statament, the field-symbol is just a pointer only, so when the value of field-symbol is changed, the value of variable assigned to the field-symbol is changed too:
LOOP AT ET_ITEM ASSIGNING <fs_wa>.
ASSIGN COMPONENT 8 OF STRUCTURE <fs_wa> TO <fs_logsyst>.
IF <fs_wa> IS ASSIGNED.
<fs_logsyst> = 'E77CLNT200'.
ENDIF.
ENDLOOP.
Max
09-23-2009 4:48 PM
Hi
U don't need any MODIFY statament, the field-symbol is just a pointer only, so when the value of field-symbol is changed, the value of variable assigned to the field-symbol is changed too:
LOOP AT ET_ITEM ASSIGNING <fs_wa>.
ASSIGN COMPONENT 8 OF STRUCTURE <fs_wa> TO <fs_logsyst>.
IF <fs_wa> IS ASSIGNED.
<fs_logsyst> = 'E77CLNT200'.
ENDIF.
ENDLOOP.
Max