2006 May 03 12:35 PM
hi,
i have a function module with an internal tablewhich displays in this manner
(data type) char quan quan unit
1234blk 4 3 7
1280blk 4 3 7
1234blk 6 7 3
but i want my result to b displayed as follows.
(data type) char quan quan unit
1234blk 10 10 10
1280blk 4 3 7.
i cont use collect bcos data types are not of integer,
pls awaiting for ur respone.
Hi,
Please go through the folloewing logic,
sort the table by char
loop at internal table.
at end of char.
sum .
append wa_area to new_internaltable. " should be of same type.
endat.
MarkHelfull answers if the problem is solved
Regards
2006 May 03 12:39 PM
Hi cyrilvictor,
1. No problem.
2. we can use Quantity field also in collect.
3. just copy paste in new program to get a taste of it.
4.
report abc.
*----
data : begin of itab occurs 0,
f(4) type c,
menge like ekpo-menge,
end of itab.
data : stab like table of itab with header line.
*----
itab-f = '1234'.
itab-menge = 25.
append itab.
itab-f = '1234'.
itab-menge = 50.
append itab.
*----
loop at itab.
move-corresponding itab to stab.
collect stab.
endloop.
*----
break-point.
regards,
amit m.
2006 May 03 12:43 PM
HI,
I THINK WE CAN USE COLLECT STMT AS IT IS FOR ABAP NUMERIC DATA TYPES.
hope this helps,
priya.
2006 May 03 12:44 PM
sort itab by field1.
SELECT field1 field3 SUM( field2 ) FROM dbtab
INTO ITABK
WHERE cond
GROUP BY field1 field3 .
APPEND ITABK.
CLEAR:ITABK.
ENDSELECT.
2006 May 03 12:46 PM
Hi,
Please go through the folloewing logic,
sort the table by char
loop at internal table.
at end of char.
sum .
append wa_area to new_internaltable. " should be of same type.
endat.
MarkHelfull answers if the problem is solved
Regards
2006 May 03 1:00 PM
hi,
collect statement adds all the numeric fiels(irrespective of the data types) of whose alpha numeric fields are equal.
award pts. if it helps.
thanks,
keerthi.
2006 May 03 1:52 PM
hi Charles,
use Collect Statement..
i.,e <b>COLLECT <wa> INTO <itab>.</b>
for further details check this link
http://help.sap.com/saphelp_erp2005/helpdata/en/fc/eb36d5358411d1829f0000e829fbfe/frameset.htm
Regards,
Santosh
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |