2008 May 23 3:16 PM
Hi,
I have some
Account Entity Category period1value pd2value
10 A C 100 200
Now I need to populate it into database table having structure
Account Entity Category period Value
10 A C 1 100
10 A C 2 200
that means instead of having values of all the periods in the same row we insert a column period in the database table which means we denormalize the table and new rows are created for each entry.
Pleadse help
Ankit
Hello
wa2 will have the same structure as a line of itab2.
Regards
Greg Kern
2008 May 23 6:47 PM
Hello Ankit,
Perhaps you could try something like this:
(Please forgive the sytnax errors)
I am assuming that you will only produce 2 lines per each in the original table as per your example.
Account Entity Category period Value
10 A C 1 100
10 A C 2 200
data: itab1 type itab1type
itab2 type itab2type.
loop at itab1 into wa1.
wa2-acct = wa-acct.
wa2-entity = wa-entity
wa2-category = wa-category
wa2-period = 1.
wa2-value = wa-period1value
append wa2 to itab2.
wa2-period = 2
wa2-value = wa-period2value.
append wa2 to itab2
endloop.
Regards
Greg Kern
2008 May 26 7:38 AM
Hi Kern,
Thanks a lot for the help.
can you please tell me
data: itab1 type itab1type
itab2 type itab2type.
loop at itab1 into wa1.
wa2-acct = wa-acct.
wa2-entity = wa-entity
wa2-category = wa-category
wa2-period = 1.
wa2-value = wa-period1value
append wa2 to itab2.
wa2-period = 2
wa2-value = wa-period2value.
append wa2 to itab2
endloop.
what are u taking wa2 as?
Ankit
2008 Jun 02 6:44 PM
Hello
wa2 will have the same structure as a line of itab2.
Regards
Greg Kern
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |