Skip to Content

Change Field names in loop

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 03, 2017 at 03:54 PM

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

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

    Add comment
    10|10000 characters needed characters exceeded