Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

help with Structre

Former Member
0 Likes
457

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

3 REPLIES 3
Read only

Former Member
0 Likes
438

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

Read only

0 Likes
438

Hi Paul Chapman ,

thanks but the problem is how to display the table

because all time the table can be change (period month)

Regards

Read only

0 Likes
438

Ricardo,

Follow that link to show how the table can be displayed. Both you and the other poster have similiar requirements.