‎2008 Sep 01 2:26 PM
Hi All,
i have a requirment .
i have a internal table ITAB1.
when iam displaying my alv report.
vendor name profitcntr plnt valclas materlno matdec quantity Standard price
1000 ram 100 200 abc m-123 test1 200 20
ram 100 200 abc m-123 test1 100 20
ram 100 200 abc m-123 test1 700 20
ram 100 200 abc m-123 test1 900 20
1000 ram 100 200 abc m-345 test2 200 20
ram 100 200 abc m-345 test2 100 20
2000 dam 100 200 abc m-123 test1 400 20
dam 100 200 abc m-123 test1 100 20
dam 100 200 abc m-123 test1 800 20
dam 100 200 abc m-123 test1 900 20
i need to collect reocrds which are same for a particular vendor..
instead of append iam using collect statement.
i need outupt in this way.
1000 ram 100 200 abc m-123 test1 1900 20
1000 ram 100 200 abc m-345 test2 300 20
2000 dam 100 200 abc m-123 test1 2200 20
but its displaying in this way.
1000 ram 100 200 abc m-123 test1 1900 80
1000 ram 100 200 abc m-345 test2 300 40
2000 dam 100 200 abc m-123 test1 2200 80
the last numeric field standard price is also adding but it should not add.
how can i do that.
Thanks & Regards
Jerry
‎2008 Sep 01 2:28 PM
Hi,
declare your last numeric field as N .
COLLECT add only those fields which are of number typy like I.
regards,
Anirban
‎2008 Sep 01 2:28 PM
Hi,
declare your last numeric field as N .
COLLECT add only those fields which are of number typy like I.
regards,
Anirban
‎2008 Sep 01 2:36 PM
Hi,
you can us append statement instead of collect statement so that it wont add fields
Regards
Chandu
‎2008 Sep 01 3:05 PM
Declaring with type as Numeric for the last field will avoid the problem ( xyz type N).
otherwise remove the last field from itab1 and move to itab2. Do the collect statement and move back the last field to itab2.
‎2008 Sep 01 11:16 PM
Hi Jerry,
I hope your issue got resolved. Please close the thread if it has.
To add few points on it, even SAP recommends not to use collect. But if you can give a try it's well and good.
The other option is: Try using the 'At New'/'At End' with SUM option.
Let me know if you need more details on it.
Regards,
Santosh Verma,
Deloitte, India