Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SP for PO Quantity Greater than GRPO

Dear All

Need Stored Procedure to block if Purchase Order Quantity Greater than PO Quantity

Jebastin

replied

Hi Jebastin

Try the below Stored Procedure.

IF @Object_type = N'20' and @transaction_type = N'A'

BEGIN

declare  @line int

SELECT @line = (LineNum + 1)

From PDN1

Where PDN1.DocEntry = @list_of_cols_val_tab_del

   and (Quantity > BaseOpnQty)

Order by LineNum

If (not ISNULL(@line, 0) = 0)

begin

  Set @error = 10

  Set @error_message = N'Line quantity ' + CONVERT(nvarchar(4), @line) + N' is more then ordered !'

end

END

With Regards

Balaji Sampath

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question