Skip to Content
Mar 01, 2012 at 11:36 AM

Collect Statement to group on character fields



I am working on some specific requirements on a support project and found a bit scenario where there is a data in an internal table and displayed the group wise total. for which the collect statement is used.

loop at lt_matdata into lwa_matdata.

lwa_final-docno = lwa_matdata-docno.

lwa_final-matnr = lwa_matdata-matnr.

lwa_final-puqty = lwa_matdata-puqty.

lwa_final-amt = lwa_matdata-amount.

collect lwa_final into lt_final.


now the problem is i need to add RATE also to the final table. if i add the field rate to the final it will display a sum. I tried to find something that helps me adding a field RATE. Please suggest a way where i can skip the sum in collect for the specific field.

one way is i can create an another internal table and make a read statement to display the data, but wanted to know if there is any other simple and suitable solution to this.