2009 Apr 23 7:20 AM
DATA: BEGIN OF IT_BSIS OCCURS 0,
BUKRS TYPE BSIS-bukrs, " co code
HKONT TYPE BSIS-HKONT, "General Ledger Account
BUDAT TYPE BSIS-BUDAT, "Posting Date in the Document
AUFNR TYPE BSIS-AUFNR, " SO Number
WRBTR1 TYPE BSIS-WRBTR, " Amount in document currency
END OF IT_BSIS.
I want to collect the data on wrbtr1 .
LOOP AT IT_BSIS .
COLLECT IT_BSIS INTO IT_BSIS2 .
ENDLOOP.
data in table
1000 0000300000 20071024 0000100000 2560.00
1000 0000300000 20071117 0610000004 100000.00
1000 0000300000 20071201 0000100000 200.00
do i need to have char type fields in table atleast 1 to have proper answer ?
DATA: BEGIN OF IT_BSIS OCCURS 0,
BUKRS TYPE BSIS-bukrs, " co code
HKONT TYPE BSIS-HKONT, "General Ledger Account
BUDAT TYPE BSIS-BUDAT, "Posting Date in the Document
AUFNR TYPE BSIS-AUFNR, " SO Number
WRBTR1 TYPE BSIS-WRBTR, " Amount in document currency
END OF IT_BSIS.
I want to collect the data on wrbtr1 .
LOOP AT IT_BSIS .
COLLECT IT_BSIS INTO IT_BSIS2 .
ENDLOOP.
data in table
1000 0000300000 20071024 0000100000 2560.00
1000 0000300000 20071117 0610000004 100000.00
1000 0000300000 20071201 0000100000 200.00
do i need to have char type fields in table atleast 1 to have proper answer ?
2009 Apr 23 7:22 AM
Use F1 help.
"Prerequisite for the use of this statement is that wa is compatible with the row type of itab and all components that are not part of the table key must have a numeric data type (i, p, f). "
2009 Apr 23 7:25 AM
Hi,
Its not mandatory to have character type fields to use collect statement.
infact if u have character field , collect statement will not work
table key must have a numeric data type (i, p, f).
tc
sajimon chandran
2009 Apr 23 7:25 AM
<<removed_by_moderator>>
Moderator message:
Don't Copy Paste SAP Help Documentation
Edited by: Vijay Babu Dudla on Apr 23, 2009 2:35 AM
2009 Apr 23 7:32 AM
hi,
my question is if my internal table has 5 flds all r integers then how does collect statement works ?
so is there any need for char type field
2009 Apr 23 7:35 AM
No need of char field.
You can collect the field of ur choice in an internal table.
Soemthing like:
Collect HKONT.
Append it_collect.
2009 Apr 23 7:30 AM
2009 Apr 23 7:31 AM
Hi,
Collect compares all the char and if values in all char fields are same then the numeric fields are added.
In you case as posting date and SO number's are different it cannot add the WRBTR1 for the same BUKRS & HKONT.
2009 Apr 23 7:35 AM
Read the F1 help or SAP Help documentation on Basic ABAP statements.
Thread is locked for Further posting.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |