‎2008 Jun 18 10:07 AM
hi expert,
I have a method, the return parameter is defined as index table.
at run time, I need to loop through the table and manipulate the data that meet the condition.
What I did is:
OUT_DATA TYPE INDEX TABLE
...
FIELD-SYMBOLS <fs_out> LIKE LINE OF OUT_DATA
LOOP AT OUT_DATA ASSIGNING <fs_out>.
IF <fs_out>-code = '72'.
<fs_out>-result = 'Opp'.
ENDIF.
...
ENDLOOP.
but system said, code, result is not a component of <fs_out>.
That is true, but I know the structure of <fs_out> would contain two fields of such. How can I handle the problem like this?
‎2008 Jun 18 10:10 AM
FIELD-SYMBOLS <fs_out> LIKE LINE OF OUT_DATA
LOOP AT OUT_DATA ASSIGNING <fs_out>.
ASSIGN COMPONENT 'CODE' OF STRUCTURE <fs_out> TO <f_fs1>.
IF <f_fs1> = '72'.
ASSIGN COMPONENT 'RESULT' OF STRUCTURE <fs_out> TO <f_fs2>.
<f_fs2> = 'Opp'.
ENDIF.
...
ENDLOOP.Regards
Kannaiah
‎2008 Jun 18 10:09 AM
HI,
Try to handle the fieldstring using offset like
<FS>+n(m) and check the condition basing on this.
‎2008 Jun 18 10:10 AM
FIELD-SYMBOLS <fs_out> LIKE LINE OF OUT_DATA
LOOP AT OUT_DATA ASSIGNING <fs_out>.
ASSIGN COMPONENT 'CODE' OF STRUCTURE <fs_out> TO <f_fs1>.
IF <f_fs1> = '72'.
ASSIGN COMPONENT 'RESULT' OF STRUCTURE <fs_out> TO <f_fs2>.
<f_fs2> = 'Opp'.
ENDIF.
...
ENDLOOP.Regards
Kannaiah
‎2008 Jun 18 10:10 AM
declare a workarea wa_out of type out_data.
then loop at out_data into wa_out.
IF wa_out-code = '72'.
wa_out-result = 'Opp'.
ENDIF.
modify out_data from wa_out transporting result.
endloop.