Skip to Content
0
Former Member
Apr 18, 2008 at 05:52 AM

HI GURUS

10 Views

I VE WRITTEN A PROGRAMME FOR RETRIEVING DATA FROM 3 TABLES ,, KNA1 , VBAK N LIPS USING ALL ENTRIES ,, I AM NOT GETTING THE DATA FROM THE LAST TABLE ... I WILL SEND MY CODE ... PLEASE TELL ME WHERE I WENT WRONG N GIVE ME THE CORRECTED PROGRAMME .

DATA : BEGIN OF ITAB OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

END OF ITAB.

data : begin of itab1 occurs 1 ,

VBELN LIKE VBAK-VBELN, " sales document

AUART LIKE VBAK-AUART, " sales document type

KNUMV LIKE VBAK-KNUMV, " number of the document condition

ERDAT LIKE VBAK-ERDAT, " date on which record was created

kunnr like vbak-kunnr, " customer number ( sold to party )

end of itab1 .

data : begin of itab2 occurs 1 ,

VBELN LIKE LIPS-VBELN, " deliver no

LFIMG LIKE LIPS-LFIMG, " actual quantity delivered

end of itab2 .

SELECT KUNNR NAME1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE ITAB .

SELECT VBELN AUART KNUMV ERDAT KUNNR FROM VBAK INTO CORRESPONDING FIELDS OF TABLE ITAB1

FOR ALL ENTRIES IN ITAB

WHERE KUNNR = ITAB-KUNNR .

SELECT VBELN LFIMG FROM LIPS INTO CORRESPONDING FIELDS OF TABLE ITAB2

FOR ALL ENTRIES IN ITAB1

WHERE VBELN = ITAB1-VBELN .

LOOP AT ITAB2 .

READ TABLE ITAB1 WITH KEY VBELN = ITAB2-VBELN .

READ TABLE ITAB WITH KEY KUNNR = ITAB1-KUNNR .

WRITE : / ITAB-KUNNR , ITAB-NAME1 , ITAB1-VBELN , ITAB1-AUART , ITAB1-KNUMV,90 ITAB1-ERDAT , ITAB2-LFIMG .

ENDLOOP .

THANK U IN ADVANCE ....