2006 Jul 10 1:21 PM
i have itab (matnr,lgort,qty)
i want to make collect qty only at matnr,and append the result into another itab???
2006 Jul 10 1:24 PM
Hi rani,
1. simple.
Note : SUMTAB has only 2 fields, and with same name.
data : begin of sumtab occurs 0,
matnr,
qty,
end of sumtab.
LOOP AT ITAB.
move-corresponding itab to sumtab.
COLLECT SUMTAB.
ENDLOOP.
regards,
amit m.
i have itab (matnr,lgort,qty)
i want to make collect qty only at matnr,and append the result into another itab???
2006 Jul 10 1:23 PM
Hello,
Try like this.
Select matnr lgort menge from mard into itab. where ...
collect itab.
append itab1.
endselect.
If useful reward points.
Rgerads,
Vasanth
2006 Jul 10 1:24 PM
Hi rani,
1. simple.
Note : SUMTAB has only 2 fields, and with same name.
data : begin of sumtab occurs 0,
matnr,
qty,
end of sumtab.
LOOP AT ITAB.
move-corresponding itab to sumtab.
COLLECT SUMTAB.
ENDLOOP.
regards,
amit m.
2006 Jul 10 1:25 PM
data: itab1 like itab.
LOOP at itab.
move itab to itab1.
collect itab into itab1.
endloop.Provided matnr,lgort are character fields and qty is numberic.
rgds,
TM
2006 Jul 10 1:33 PM
Hi Rani ,
The COLLECT statement can be used with internal tables whose non-key fields are all numeric types I, P, F.
The COLLECT statement adds the work area or header line to an internal entry with the same type or, if
there is none, adds a new entry to the table.
It searches for the entry according to the table type and
defined key. If it finds an entry in the table, it adds all numeric fields that are not part of the key to the
existing values. If there is not already an entry in the table, it appends the contents of the work area or
header line to the end of the table.
Hope it clarifies your doubt.....
regards,
Vijay
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |