Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Open Purchase Orders and Open Sales Orders

Former Member
0 Kudos

Hi,

Please let me know the table names for open purchase orders and sales orders.

Regards,

Prii

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

amit_khare
Active Contributor
0 Kudos

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos

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.