Application Development 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: 

how proceed with the logic

Former Member
0 Kudos

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..

1 ACCEPTED SOLUTION

madan_ullasa
Contributor
0 Kudos

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

5 REPLIES 5

madan_ullasa
Contributor
0 Kudos

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

Former Member
0 Kudos

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

naveen_inuganti2
Active Contributor
0 Kudos

Hi...

Simply utilize the COLLECT statement. It can solve your problem.

Thanks,

Naveen.I

Former Member
0 Kudos

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.

0 Kudos

Thanks to u all and I'm awarding the points...