‎2008 May 22 1:43 PM
Hi,
i need to build Fm That the user put how much month he wont to get data and i need to bring him data for every month and sum but the problem is that i don't now how to do that.
e.g.
import
pernr = 123
start_period 012007
end_period 042007
i need to export :
pernr month1 mont2 month3 month4 sum
123 2 5 7 10 24
456 2 3 4 5 17
....
and if user put :
import
pernr = 123
start_period 012007
end_period 022007
pernr month1 mont2 sum
123 2 5 7
456 3 3 6
.....i now that in abap we don't have dynamic structure but maybe other suggestion how to bring it ?
Regards
‎2008 May 22 1:54 PM
Ricardo,
You can do this with an internal table with an internal table like this
data:
begin of period_rec,
amount type i,
end of period_rec.
data:
begin of itab occurs 0,
pernr like pa0001-pernr,
total type i,
period_tab like standard table of period_rec,
end of itab occurs 0.
For each itab you create, use DO X TIMES for the number of periods there will be and append each one to the itab-period_tab.
Create another table that contains the periods and then the postion of the matching period can be used
to properly update the period_tab.
I have been providing a similar solution in this thread
‎2008 May 22 1:57 PM
Hi Paul Chapman ,
thanks but the problem is how to display the table
because all time the table can be change (period month)
Regards
‎2008 May 22 2:01 PM
Ricardo,
Follow that link to show how the table can be displayed. Both you and the other poster have similiar requirements.