Skip to Content
0
Former Member
Nov 07, 2007 at 06:40 AM

URGENT-- Data is going to delete after end of loop .

11 Views

hi all,

i have written code .....

SELECT DISTINCT M1VKBUR M1KUNNR M1VBELN M1BSTNK M1AUDAT M1KNUMV M2NETWR M2MWSBP M3ERDAT M3FKART

INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM VBAK AS M1 INNER JOIN VBRP AS M2

ON M1VBELN = M2AUBEL

INNER JOIN VBRK AS M3 ON M2VBELN = M3VBELN

WHERE M1~VKBUR IN VKBUR

AND M3~ERDAT IN ERDAT

AND M1~KUNNR IN KUNNR

AND M3~FKART IN FKART .

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING VBELN .

LOOP AT ITAB .

SELECT KAWRT KBETR INTO CORRESPONDING FIELDS OF TABLE ITAB2 FROM KONV

WHERE KNUMV = ITAB-KNUMV

AND KSCHL IN ('SKTO' , 'INV1') .

MODIFY ITAB2 INDEX SY-TABIX TRANSPORTING KAWRT KBETR .

ENDLOOP .

********************************************************************

LOOP AT ITAB2 .

ITAB-CD_AMT = ITAB2-KAWRT * ITAB2-KBETR / 10 .

ITAB-AMT_DUE = ITAB-NETWR + ITAB-MWSBP - ITAB-CD_AMT .

MODIFY ITAB INDEX SY-TABIX TRANSPORTING CD_AMT AMT_DUE .

ENDLOOP .

problem is that i m not getting values in itab2 at end of itab, its going to delete after completing last itab value of KNUMV.

can anybody help me its urgent .

thanks in advance .

Anil .