10-13-2008 2:41 AM
Hi All,
the selection screen is with customer(select-options).
how to proceed the logic for:
for the same customer with different dates in a month has to add the currency.
i.e: Customers: date currency
D102345 10.10.2007 2000
D102345 12.10.2007 3000
D203023 08.11.2007 500
D203023 20.11.2007 7000
Requirement is: customer month and year currency
D102345 10.2007 5000
D203023 11.2007 7500
thanks,
srii..
10-13-2008 3:00 AM
hi,
if ur itab has cust, date and currenncy...
have the customer no. in a another table itab_cust....
loop at itab_cust...
loop at itab where cust. no = itab_cust-cust_no.
keep adding the currency to a variable w_curr..
on change of date+(use substring to get the month)..
assign the added currency to another variable w_curr_tot...
clear w_curr.
endon..
refine this logic...
regards,
Madan....
Edited by: Madan Kochana on Oct 13, 2008 7:31 AM
10-13-2008 3:00 AM
hi,
if ur itab has cust, date and currenncy...
have the customer no. in a another table itab_cust....
loop at itab_cust...
loop at itab where cust. no = itab_cust-cust_no.
keep adding the currency to a variable w_curr..
on change of date+(use substring to get the month)..
assign the added currency to another variable w_curr_tot...
clear w_curr.
endon..
refine this logic...
regards,
Madan....
Edited by: Madan Kochana on Oct 13, 2008 7:31 AM
10-13-2008 3:01 AM
hey,
try this....first sort you internal table by customer,after that,just loop the internal table.Inside the loop you should add the fields you want after that using ON CHANGE OF customer ...ENDON inside the on change of command you write an append statement which appends the values in a new internal table.
Regards,
Midhun Abraham
10-13-2008 4:12 AM
Hi...
Simply utilize the COLLECT statement. It can solve your problem.
Thanks,
Naveen.I
10-13-2008 4:19 AM
Hi Try like this..
first declare one more internal table as
customer number
variable to hold the month and year
amount.
then loop the main table
loop at main_tab.
secondtable_customeer = main_tab-customer.
secodntable_variable = pass the month and year
amount = amount.
collect secondtable.
endloop.
Regards,
Sunil Kumar Mutyala.
10-13-2008 7:08 AM