03-02-2007 8:29 PM
Hi,
Please let me know the table names for open purchase orders and sales orders.
Regards,
Prii
03-02-2007 8:36 PM
Hi Preeti,
You can determine whether an order is open order through <b>VBUK</b> table.
Query on VBUK on the field GBSTK as 'A' or 'B' then it will gives you Open order.
SELECT vbeln
FROM vbuk
INTO TABLE it_vbuk
WHERE vbeln IN s_vbeln
AND gbstk IN ('A','B').
Thanks,
Vinay
Thanks,
Vinay
03-02-2007 8:36 PM
Hi Preeti,
You can determine whether an order is open order through <b>VBUK</b> table.
Query on VBUK on the field GBSTK as 'A' or 'B' then it will gives you Open order.
SELECT vbeln
FROM vbuk
INTO TABLE it_vbuk
WHERE vbeln IN s_vbeln
AND gbstk IN ('A','B').
Thanks,
Vinay
Thanks,
Vinay
03-02-2007 8:44 PM
03-02-2007 8:51 PM
HI Priti,
EKPO-ELIKZ "Delivery completed" indicator, This tell if the given PO line items has any open quantity or not.
Logic to find out if a given PO has Open Quantity or not is do the following:
" select the PO Qunatity.
SELECT SINGLE MENGE FROM EKPO INTO PO_QTY WHERE
EBELN = ITAB_PO_LN-EBELN AND
EBELP = ITAB_PO_LN-EBELP.
" select the GR qunatity which has been received.
SELECT SUM( MENGE ) FROM EKBE INTO GR_QTY WHERE
EBELN = ITAB_PO_LN-EBELN AND
EBELP = ITAB_PO_LN-EBELP AND
BWART = '101'.
" select GR Quantity which has been reversed.
SELECT SUM( MENGE ) FROM EKBE INTO GR_REV_QTY WHERE
EBELN = ITAB_PO_LN-EBELN AND
EBELP = ITAB_PO_LN-EBELP AND
BWART = '102'.
POSTED_QTY = GR_QTY - GR_REV_QTY .
OPEN_QTY = PO_QTY - POSTED_QTY.
Regards,
-Venkat.