2005 Mar 10 9:02 PM
Hi guys,
S.O.S.
I have a request to modify a report,so I can show the
total of the money(wrbtr) that al the clients (kunnr) of a particular account group (ktokd)have to pay to my company.
how can I group this to fields (wrbtr, ktokd) taking in count that I have to know for sure that the money (wrbtr) belongs to the client (kunnr) that is in my account group (ktokd), so I can show the total per KTOKD.
If someone can please help me, I'll appreciate it.
Thanks in advanced,
Fidel.
Hi guys,
S.O.S.
I have a request to modify a report,so I can show the
total of the money(wrbtr) that al the clients (kunnr) of a particular account group (ktokd)have to pay to my company.
how can I group this to fields (wrbtr, ktokd) taking in count that I have to know for sure that the money (wrbtr) belongs to the client (kunnr) that is in my account group (ktokd), so I can show the total per KTOKD.
If someone can please help me, I'll appreciate it.
Thanks in advanced,
Fidel.
2005 Mar 10 9:20 PM
Assuming that you have an internal table with all three fields....
data:
Begin of itab,
ktokd type ktokd,
kunnr type kunnr,
wrbtr type wrbtr,
end of itab.Have a second itab with just ktokd and wrbtr.
Data:
Begin of itab2,
ktokd type ktokd,
wrbtr type wrbtr,
end of itab2.Now loop at the first and collect into the second.
Loop at itab.
move-corresponding itab to itab2.
collect itab2.
endloop.This will add up the "money" by account group.
Hope I understood your question.
Regards,
Rich Heilman
2005 Mar 11 12:37 PM
Hi Rich,
I should explain my self better. The report has to different itab; one with the client and the money, it_factura (that's the spanish for it_invoice) and the other, it_deudores (that's the spanish for it_indebted).
I was looking for the way to collect the data into one internal table that I created like the first one you assume I have the data in.
My problem is that I don't know another way to put the correct data ( all the wrbtr that belongs to a particular ktokd) in my internal table it_ktokd.
The only way I can do it is to create an inner join and put the data in my internal table it_ktokd (the one that has wrbtr and ktokd) and forget about the data that exist already in it_factura and it_deudores.
If there is a way for me to put the data in it_ktokd using it_factura and it_deudores, any help will be appreciate it.
Thanks a lot Rich,
Fidel.
2005 Mar 11 12:47 PM
2005 Mar 11 1:03 PM
Hi,
See if this works out for you.
ITAB1 : kunnr , wrbtr
ITAB2 : kunnr , ktokd
ITAB3 : wrbtr , ktokd "you want to build this one"
sort itab1 by kunnr.
sort itab2 by kunnr.
loop at itab1.
loop at itab2 where itab2-kunnr = itab1-kunnr.
move itab1-wrbtr to itab3-wrbtr.
move itab2-ktokd to itab3-ktokd.
collect itab3.
endloop.
endloop.For better performance, you can use parallel cursors.
Regards,
Anand Mandalika.
2005 Mar 11 4:53 PM
thanks Poornanad....you solve the problem. thank you so
much.
Fidel.