2018 Mar 15 10:56 AM
Hi All,
I am Having a Requirement, for Dynamic structure generation with different Names in a Loop.
Ex: I am Having an Internal Table with 5 Records
Loop at lt_sflight in to Data(ls_wa)
EndLoop.
Since i have 5 records inside the Loop i want to generate 5 structure wa1, wa2, wa3, wa4, wa5 and the first record in Lt_sflight should me moved to wa1 and 2nd Record Moved to wa2 and so on.
In the Current Case we cannot predict the Number of records Received,
Hi All,
I am Having a Requirement, for Dynamic structure generation with different Names in a Loop.
Ex: I am Having an Internal Table with 5 Records
Loop at lt_sflight in to Data(ls_wa)
EndLoop.
Since i have 5 records inside the Loop i want to generate 5 structure wa1, wa2, wa3, wa4, wa5 and the first record in Lt_sflight should me moved to wa1 and 2nd Record Moved to wa2 and so on.
In the Current Case we cannot predict the Number of records Received,
2018 Mar 15 11:44 AM
2018 Mar 15 11:47 AM
You can try something like
data: lv_tabix TYPE string,
lv_struct TYPE string.
loop.
lv_tabix = sy-tabix.
CLEAR lv_struct.
CONCATENATE 'wa' lv_tabix INTO lv_struct.
ASSIGN COMPONENT x OF struct (lv_struct) INTO <fs>.
endloop.
2018 Mar 15 1:37 PM
The assignment operation is Failing that should be assigned from some Field-symbol/Data to the (lv_struct), Nothing was assigning to it
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |