Skip to Content
0
Nov 07, 2007 at 10:16 AM

A304 KNUMH

64 Views

Hi Folks,

I have to get all the conditon records with condition types zpr0 and zpr1(both) w.r.t to MATNR in VBRP

SELECT VBELN

FKART

VBTYP

VKORG

VTWEG

FKDAT

ERDAT

KUNRG

FROM VBRK INTO TABLE ITAB1

WHERE BUKRS = P_BUKRS AND

FKDAT IN S_FKDAT.

LOOP AT ITAB1.

MOVE-CORRESPONDING ITAB1 TO ITFINAL.

SELECT POSNR

FKIMG

MATNR

ARKTX

WERKS

BWTAR

FROM VBRP INTO CORRESPONDING FIELDS OF ITFINAL

WHERE VBELN = ITAB1-VBELN.

SELECT NAME1

FROM KNA1 INTO (ITFINAL-NAME1)

WHERE KUNNR = ITAB1-KUNRG.

ENDSELECT.

APPEND ITFINAL.

ENDSELECT.

CLEAR ITAB1.

CLEAR ITFINAL.

ENDLOOP.

Here it is overwriting the data w.r.t to materail,thus leaving me only the data w.r.t to the last material in the ITFINAL.But I want all the condition record numbers with zpro and zpr1.Where am I going wrong?

<b>LOOP AT ITFINAL.

SELECT KSCHL

DATBI

DATAB

KNUMH

FROM A304 INTO TABLE ITAB2

WHERE MATNR = ITFINAL-MATNR and

ENDLOOP.</b>

Thanks,

K.Kiran.