Thanks to visit codestin.com
Credit goes to www.scribd.com

100% found this document useful (2 votes)
2K views3 pages

Delivery Quantity Should No More Than PO STO

This document discusses implementing a check in SAP to ensure delivery quantities in a STO delivery do not exceed the open quantity in the associated purchase order. Specifically, it involves: 1) Using the BAdI LE_SHP_DELIVERY_PROC and method DELIVERY_FINAL_CHECK to check delivery quantities. 2) Checking only for delivery type Z4LN, and that the delivery quantity does not exceed the open quantity (purchase order quantity minus total delivered quantity so far). 3) If the delivery quantity is greater, an error message is inserted into the CT_FINCHDEL table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views3 pages

Delivery Quantity Should No More Than PO STO

This document discusses implementing a check in SAP to ensure delivery quantities in a STO delivery do not exceed the open quantity in the associated purchase order. Specifically, it involves: 1) Using the BAdI LE_SHP_DELIVERY_PROC and method DELIVERY_FINAL_CHECK to check delivery quantities. 2) Checking only for delivery type Z4LN, and that the delivery quantity does not exceed the open quantity (purchase order quantity minus total delivered quantity so far). 3) If the delivery quantity is greater, an error message is inserted into the CT_FINCHDEL table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Delivery Quantity Should No More Than PO

STO

Ensure than in your delivery item category (0VLP) the control "Availabiliy check Off" is blank and
the control "Check quantity 0" is B. Also ensure that the control for avalability check is as per
your business requirement.

You need to create error message if user create delivery PO STO and entered delivery
quantity more than quantity in PO STO using VL10D SAP Transaction.

The solution is you need to implement BAdI LE_SHP_DELIVERY_PROC in your SAP


System. and write your code into DELIVERY_FINAL_CHECK method.

For example, We need to check only for Delivery type Z4LN and the delivery quantity
was entered is not more than Open Qty ( PO Qty Total Delivery Qty ).

DATA: lf_cannot_over TYPE c,

ls_finchdel TYPE finchdel.

DATA : ls_xlikp TYPE likpvb,

ls_xlips TYPE lipsvb.

DATA : lv_menge TYPE menge_d,

lv_tot_menge TYPE menge_d,

lv_ekbe_menge TYPE menge_d.

DATA : lt_ekbe TYPE TABLE OF ekbe,

ls_ekbe TYPE ekbe.

LOOP AT it_xlikp INTO ls_xlikp.

IF ls_xlikp-lfart = 'Z4LN' AND if_trtyp = 'H'.


CLEAR lf_cannot_over.

LOOP AT it_xlips INTO ls_xlips WHERE vbeln = ls_xlikp-vbeln.

CLEAR : lv_tot_menge, lv_menge, lv_ekbe_menge.

REFRESH : lt_ekbe.

SELECT * FROM ekbe INTO TABLE lt_ekbe WHERE ebeln = ls_xlips-vgbel

AND ebelp = ls_xlips-vgpos

AND vgabe = '8'.

SELECT SINGLE menge INTO lv_menge FROM ekpo WHERE ebeln = ls_xlips-vgbel

AND ebelp = ls_xlips-vgpos.

LOOP AT lt_ekbe INTO ls_ekbe.

lv_ekbe_menge = lv_ekbe_menge + ls_ekbe-menge.

ENDLOOP.

lv_tot_menge = lv_menge - lv_ekbe_menge.

IF ls_xlips-lgmng > lv_tot_menge.

lf_cannot_over = 'X'.

EXIT.

ENDIF.

ENDLOOP.

ENDIF.

ENDLOOP.

IF lf_cannot_over EQ 'X'.
CLEAR ls_finchdel.

ls_finchdel-vbeln = ls_xlikp-vbeln.

ls_finchdel-pruefung = '99'.

ls_finchdel-msgty = 'E'.

ls_finchdel-msgid = 'ZMM'.

ls_finchdel-msgno = '005'.

INSERT ls_finchdel INTO TABLE ct_finchdel.

ENDIF.

You might also like