2006 Aug 24 8:18 AM
I have a ALV report which has dynamic internal table building logic. This ALV report is giving proper output if it is executed in debugging mode step by step, but when i execute in normal mode it is not giving proper output.
Thanks in advance.
2006 Aug 24 8:25 AM
2006 Aug 24 10:10 AM
FIELD-SYMBOLS <FS>.
DATA : T_KBETR(50) .
DATA : T_ZPLTNAMEC LIKE ZVENDPLT-ZPLTNAMEC,
T_SOURCING LIKE ZOPSDWBOM-SOURCING,
T_ZMATGRP LIKE ZRMRPMATERIAL-ZMATGRP,
T_ZCOLLECTION LIKE ZRMRPMATERIAL-ZCOLLECTION,
T_FISCINTRODT LIKE ZRMRPMATERIAL-ZFISCINTRODT,
T_BEDNR LIKE EKPO-BEDNR,
T_REVLV LIKE EKPO-REVLV,
T_EMATN LIKE EKPO-EMATN.
LOOP AT OUTTAB.
TABIX = SY-TABIX.
IF ( ( TABIX <> 1 ) AND ( ( OUTTAB-ZPLTNAMEC <> T_ZPLTNAMEC ) OR
( OUTTAB-SOURCING <> T_SOURCING ) OR
( OUTTAB-ZMATGRP <> T_ZMATGRP ) OR
( OUTTAB-ZCOLLECTION <> T_ZCOLLECTION ) OR
( OUTTAB-FISCINTRODT <> T_FISCINTRODT ) OR
( OUTTAB-BEDNR <> T_BEDNR ) OR
( OUTTAB-REVLV <> T_REVLV ) OR
( OUTTAB-EMATN <> T_EMATN ) ) ).
APPEND DYNTAB .
CLEAR DYNTAB .
CLEAR : T_KBETR .
MOVE-CORRESPONDING OUTTAB TO DYNTAB.
CLEAR IT_UDATE.
READ TABLE IT_UDATE WITH KEY UDATE = OUTTAB-UDATE.
CONCATENATE 'DYNTAB-KBETR' IT_UDATE-CO_POS INTO T_KBETR.
ASSIGN (T_KBETR) TO <FS> .
<FS> = OUTTAB-KBETR .
ENDIF.
IF TABIX = 1.
MOVE-CORRESPONDING OUTTAB TO DYNTAB.
CLEAR IT_UDATE.
CLEAR : T_KBETR .
READ TABLE IT_UDATE WITH KEY UDATE = OUTTAB-UDATE.
CONCATENATE 'DYNTAB-KBETR' IT_UDATE-CO_POS INTO T_KBETR.
ASSIGN (T_KBETR) TO <FS> .
<FS> = OUTTAB-KBETR .
ELSE.
*move-corresponding outtab to dyntab.
CLEAR IT_UDATE.
CLEAR : T_KBETR .
READ TABLE IT_UDATE WITH KEY UDATE = OUTTAB-UDATE.
CONCATENATE 'DYNTAB-KBETR' IT_UDATE-CO_POS INTO T_KBETR.
ASSIGN (T_KBETR) TO <FS> .
<FS> = OUTTAB-KBETR .
ENDIF.
T_ZPLTNAMEC = OUTTAB-ZPLTNAMEC.
T_SOURCING = OUTTAB-SOURCING.
T_ZMATGRP = OUTTAB-ZMATGRP.
T_ZCOLLECTION = OUTTAB-ZCOLLECTION.
T_FISCINTRODT = OUTTAB-FISCINTRODT.
T_BEDNR = OUTTAB-BEDNR.
T_REVLV = OUTTAB-REVLV.
T_EMATN = OUTTAB-EMATN.
*endif.
*move
ENDLOOP.
APPEND DYNTAB .
2006 Aug 24 8:37 AM