Skip to Content

Validation required for updation lock.

Hello World!

My client requested a validation I'll explain the requirement-

It is required that

"When a purchase quotation is forwarded to a Purchase order only a 10% updation on quantity can be possible. If added more than that SAP generates an error".

Eg- for a quotation with qty 50 on PO only 5 more qty (10%) can be added.

Thanks Much

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 14, 2018 at 12:47 PM

    Hi Shivam,

    You can add your check to the transaction notification stored procedure.

    Please try the following:

    IF @object_type = 22 AND @transaction_type IN ('A', 'U')
    BEGIN 
    	SELECT TOP 1
    		@error = 1,
    		@error_message = N'Quatation->order quantity change restriction is violated in line #' + CAST(POR1.VisOrder AS NVARCHAR(30))
    	FROM POR1
    	JOIN PQT1 ON POR1.BaseEntry = PQT1.DocEntry
    		AND POR1.BaseLine = PQT1.LineNum
    		AND POR1.BaseType = '540000006'
    		AND POR1.Quantity > PQT1.Quantity * 1.1 -- Here is your quantity condition
    	WHERE POR1.DocEntry = @list_of_cols_val_tab_del	
    END
    
    Add comment
    10|10000 characters needed characters exceeded