Skip to Content
author's profile photo Former Member
Former Member

type TABLE how modify the value of a field

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2009 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.