04-10-2007 10:23 AM
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!
04-10-2007 10:28 AM
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
04-10-2007 10:26 AM
04-10-2007 10:27 AM
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
04-10-2007 10:27 AM
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
04-10-2007 10:28 AM
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
04-10-2007 10:30 AM
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
07-03-2007 1:44 PM
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