2006 Sep 06 1:38 PM
hi all
the below given pseudocode is a little confusing.
could u help how to code for the following.
1. Ship-to Number: Get KUNNR (ship to) from VBPA-KUNNR when VBPA-PARVW (partner function) =SH where VBPA-VBELN(order number) =VBAP-VBELN and if VBPA-POSNR (item number) ne 00000 (item level exist) then get KUNNR when VBPA-PARVW=SH (partner function) where VBPA-VBELN &VBPA-POSNR =VBAP-VBELN &VBAP-POSNR .
2. Order Quantity: Select EBELN (order number) from VBAK where VBAK- ERDAT(creation date) = SY-DATUM. Get KWMENG (order quantity) from VBAP where VBAP-EBELN=VBAK-EBELN.
3. MTD Qty Ordered: Get the value based on formula= sum pseudo no. 2 and do grouping based on ship-to number-pseudo no. 1 and MATNR (material number).
thanks,
venkatesh.
2006 Sep 06 2:42 PM
SELECT PKUNNR BMATNR SUM(B~KWMENG)
INTO TABLE ITAB
From VBAP as B inner join VBPA as P on BVBELN = PVBELN
and BPOSNR = PPOSNR
inner join VBAK as A on BVBELN = AVBELN
Where P~parvw = 'SH' and
B~POSNR NE '0000' and
A~ERDAT = sy-datum
GROUP BY PKUNNR BMATNR.