Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

type TABLE how modify the value of a field

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

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