Skip to Content
0
Former Member
May 12, 2008 at 07:59 AM

Error Message when delivery qty more then po qty in MV50AFZ1

124 Views

Hi

Sap Gurus,

I gt a requirement that while creating deliveries in vl02n

if delivery quantity greater then po qty it should through error

but i have alredy done coding in mv50afz1 user exit its working fine. My problem is if delivery no is differnt for the po no.

it is not giving error because delivery quantity is less for differnt deliveries .

this is the code i have written,

data : v_menge type ekpo-menge,

  • Getting Quantity from ekpo Table

select single menge

into v_menge from ekpo

where ebeln = lips-vgbel

and ebelp = lips-vgpos.

if sy-subrc = 0.

  • Cheking the Condition for Delivery Type

if likp-lfart = 'ZGND' or likp-lfart = 'ZGNL' or likp-lfart = 'ZGNS'.

  • Cheking Condition if Delivery Quntity More than Po Quantity

if v_menge < lips-lfimg.

message e002(zt) with 'Delivery Qty Cannot be Greater than PO Qty'.

endif.

endif.

endif.

this is checking for single delivery quantiry greater then po qty

but if multiple deliveries it is not working.

Please suggest me to write logic and coding chages.

ravi n

Edited by: Nekkannti Ravi Kumar on May 12, 2008 10:01 AM