2008 Mar 04 12:20 PM
how to add different amounts for a same account id ?
ex: accid- 1000 amt - 100
accid- 1000 amt - 1000
accid- 1000 amt - 200
accid- 1000 amt - 10000
accid- 1000 amt - 300
Hi,
Use the Collect Statement inside the Loop..Endloop.
you have to use this collect statement on work area of the internal table.
HTH.
Regards,
Dhruv Shah
2008 Mar 04 12:23 PM
2008 Mar 04 12:24 PM
Hi,
Use the Collect Statement inside the Loop..Endloop.
you have to use this collect statement on work area of the internal table.
HTH.
Regards,
Dhruv Shah
2008 Mar 04 12:25 PM
Use loop for the account id table
Loop at accidtable.
amount = amount + accountid-amount.
Endloop.
Thanks,
Sunil
2008 Mar 04 12:25 PM
Hi,
let us assume accid and amt fields are in an internal table say itab
now
loop at itab.
at end of accid.
sum.
write : / itab-accid,itab-amt.
endat.
endloop.Cheers,
jose.
2008 Mar 04 12:30 PM
hi ,
Use following code,
sort itab by accid.
Loop at itab,
itab1-amount = itab1-amount + itab-amount.
at end of accid.
itab1-accid = itab-acccid.
append itab1.
clear itab1.
endat.
endat.
endloop.
Regards,
Talwinder
2008 Mar 04 12:36 PM
Hi,
You can use collect statement.
"Declare a work area and another internal table same as internal table.
loop at itab into wa.
collect wa into itab1.
endloop.
Thanks,
Sriram Ponna.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |