Application Development and Automation 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: 
Read only

index table type parameter processing

max_huang
Associate
Associate
0 Likes
1,068

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
824
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

3 REPLIES 3
Read only

Former Member
0 Likes
824

HI,

Try to handle the fieldstring using offset like

<FS>+n(m) and check the condition basing on this.

Read only

Former Member
0 Likes
825
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

Read only

former_member195383
Active Contributor
0 Likes
824

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.