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

forming the final internal table based on date range

Former Member
0 Likes
481

Hi,

My selection-screen contains the date range.

my output is like below.

Date goodsreceived goodsissued

01/05/10 100 -

02/05/10 20 40

03/05/10 - 10

i got the goods received and goods issued data into two internal tables based on date range.

how can i form the final internal table.

regards,

suresh

Hi,

My selection-screen contains the date range.

my output is like below.

Date goodsreceived goodsissued

01/05/10 100 -

02/05/10 20 40

03/05/10 - 10

i got the goods received and goods issued data into two internal tables based on date range.

how can i form the final internal table.

regards,

suresh

2 REPLIES 2
Read only

Former Member
0 Likes
453

Hi,

See:



* i_gr => goods received 
* i_gi => goods issued 

loop at i_gr.
  clear _final.
  i_final-date = i_gr-date.
  i_final-qtd_gr = i_gr-qtd.
  collect i_final
endloop.

loop at i_gi.
  clear _final.
  i_final-date = i_gi-date.
  i_final-qtd_gi = i_gi-qtd.
  collect i_final
endloop.

* i_final => date, qtd_gr, qtd_gi

Best regards,

Leandro Mengue

Read only

Former Member
0 Likes
453

Hi Suresh,

Please elaborate a little more.

Are 'goods received', 'goods issues' and 'date' part of the same standard table? if they are from different tables, you need to know the key fields which link the three fields required.

data: begin of it_final occurs 0,
           date like sy-datum,
           r_qty(4) type n,
           i_qty(4) type n,
         end of it_final.

*if all the fields are from the same standard table use select as below.
select field1 field2 field3 from XXX(std table) into table it_final where 'date'(date field on std table) in s_date(selection screen date range). 
if sy-subrc = 0.
loop at it_final.
write:/ it_final-date, it_final-r_qty, it_final-i_qty.
endloop.

Not sure if this your requirement. If you can communicate it better, ppl on this forum will have a better chance to help you out.

Thanks!

Sandeep