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: 

SO open quantity

Former Member
0 Kudos

Hi,

I need to get open quantity for each sales order in my Z report. Is there any field to store it or i need to calculate it. How can i do that, Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

For each Sales Order Item (VBAP-POSNR) take the ORDER Qty field (VBAP-KWMENG) and substract the Del QTY field(LIPS-LFIMG).

that gives the Open order Qty.

or sum up at the order level.

Sum up all Order Qty's and Del qty's .

difference gives the open order qty.

there is no straight field

reward points for useful answers

regards,

ANJI

6 REPLIES 6

Former Member
0 Kudos

check VA05 tcode.

Regards

Prabhu

Former Member
0 Kudos

Hi,

For any SO check if any Delivery is created. If no, the SO Qty is open Qty.

If yes, check the diff in Delivery and SO qty. The diff is open Qty.

The joining condition is:

LIPS-VGBEL = VBAP-VBELN and

LIPS-VGPOS = VBAP-POSNR.

Thanks

former_member632991
Active Contributor
0 Kudos

Hi,

u need to calculate the open quantity,from SO and the delivery .

i.e. the qty for which delivery has been made .

Regards,

Sonika

Former Member
0 Kudos

Hi,

For each Sales Order Item (VBAP-POSNR) take the ORDER Qty field (VBAP-KWMENG) and substract the Del QTY field(LIPS-LFIMG).

that gives the Open order Qty.

or sum up at the order level.

Sum up all Order Qty's and Del qty's .

difference gives the open order qty.

there is no straight field

reward points for useful answers

regards,

ANJI

Former Member
0 Kudos

You need to check the Deliveries which created with reference to SO , then the Open Quantity is the difference between the Total and Delivered , i think.

Regards,

Senthil N S

Former Member
0 Kudos

Hi..

check the below code to get the open quantity.

open quantity = ordered quantity - delivered quantity

  • Fetch delivery information

SELECT vbeln posnr vgbel vgpos lfimg

FROM lips

INTO TABLE gt_lips

FOR ALL ENTRIES IN gt_vbap

WHERE vgbel = gt_vbap-vbeln AND

vgpos = gt_vbap-posnr.

*Compute delivered qty

LOOP AT gt_lips INTO st_lips WHERE vgbel = st_details-vbeln AND

vgpos = st_details-posnr.

gv_lfimg = gv_lfimg + st_lips-lfimg.

CLEAR st_lips.

ENDLOOP.

st_details-open_qty = st_details-ord_qty - gv_lfimg.

i guess you know how to get the ordered quantity for the sales order item.

Award points if found useful.

Regards

Divakar