Skip to Content
0

Change Field names in loop

Feb 03, 2017 at 02:29 PM

65

avatar image

Hi

I have 4 info objects zmat1, zmat2, zmat3 and zmat4.

I need to populate data for these in 1 row.

The internal table I have populated have got data in below format

zmat1

zmat2

zmat3

zmat4

All are separate row. I want to do the below example

loop at result_package assigning <result_fields>.

loop at internal table into wa.

c =c +1

<result_fields>zmat + c = wa value.

endloop.

endloop.

Any ideas?

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sandra Rossi Feb 03, 2017 at 03:54 PM
0

Use ASSIGN COMPONENT ('ZMAT1') OF STRUCTURE <result_fields> TO <zmat_dobj>

Instead of 'ZMAT1', use a variable to define the name at runtime.

Share
10 |10000 characters needed characters left characters exceeded