2014 May 07 12:09 PM
Hi experts,
getting problem in using COLLECT statement. attaching my code below.
LOOP AT it_final1 INTO wa_final1.
LOOP AT it_final INTO wa_final WHERE vagrp = wa_final1-vagrp AND verwmerkm = wa_final1-verwmerkm.
wa_final1-anzwertg = wa_final-anzwertg.
COLLECT wa_final1 INTO it_final1.
ENDLOOP.
CLEAR: wa_final1, wa_final.
ENDLOOP.
here , i want to use collect statement only for "anzwertg" field from internal table. but 2 more fields also getting compressed .
attaching screen shot
here, original_input and max fields also getting compressed.
could anybody please help me out in this.
Thanks in advance.
Regards
satish
2014 May 07 12:19 PM
Hi Satish,
All numeric fields are summed up in Collect statement if all the character fields are same.
thx
2014 May 07 12:37 PM
2014 May 07 12:19 PM
Hi,
Make sure original_input and max fields are charecter types,
revert if any issues after changing those to charecter fields
Regards
Pavan
2014 May 07 12:36 PM
hi pavan,
I've given those types are P decimals 2. without changing the type , can we achieve this?
Thanks & Regards
satish
2014 May 07 12:41 PM
Hi,
The floating point fields are also added in collect statement. So you have to loop through the table and add the field required on your own.
Regards,
Aswath.
2014 May 07 12:53 PM
problem solved. thank u guys for your prompt reply and I am really happy with your knowledge transfer.
2014 May 07 1:00 PM
Hi satish....
collect statement works based on char fields..
by default it will taken char fields as a key fields .........
if any char field is repeated then corresponding numc values will be added....
other wise it will act as a APPEND statement......
Here in ur code there is no char field then how it will caliculate that values...
just check it once..
Regards,
Vamsi....
2014 May 07 1:41 PM
yes vamsi, you are right, i found the solution. thanks for the KT.
regards
satish