Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

collect statement

Hello seniors,

I am a little bit confused about collect statement.

DATA: BEGIN OF ZAMF0 OCCURS 1000,

BUKRS LIKE T001-BUKRS,

GJAHR(4) TYPE N,

MAPA(4) TYPE N,

A01(7) TYPE P DECIMALS 2,

CDDMO(9) TYPE P DECIMALS 2,

end of zamf0.

DATA: BEGIN OF MZAMF0 OCCURS 1000.

INCLUDE STRUCTURE ZAMF0.

DATA: END OF MZAMF0.

collect MZAMF0.

I didn't define any keys for collect statement.

The values are as follows

BUKRS GJAHR MAPA CDDMO

pt01 2008 3100 1.00 ;

pt01 2008 3100 1.00

The output is

BUKRS GJAHR MAPA CDDMO

pt01 2008 3100 2.00 ;

I don't know why it is coming like this. GJAHR,MAPA and CDDMO are of type N or P. But the collect statement adds only CDDMO field.

Could you please explain why it is happening like this?

( If i want the output as

BUKRS GJAHR MAPA CDDMO

pt01 2008 3100 1.00 ;

after the collect statement also, what should i do?)

Tags:
Not what you were looking for? View more on this topic or Ask a question