Skip to Content
avatar image
Former Member

Stored Procedure to block MRN Qty >= PO Openqty

Dear Wael,

I wrote a SP to block Goods Receipt PO where GRPO qty should not more than Purchase Order Open qty. It was executed successfully.

But when I pass the entry for condition GRPO Qty = PO OpenqtySP triggered and blocking the entry. below is my stored procedure.

--Additional Validation for MRN Qty > PO Qty.

IF :object_type = '20' and (:transaction_type='A') then

SELECT PDN1."Quantity" into mrnqty FROM PDN1 WHERE PDN1."DocEntry" = :list_of_cols_val_tab_del;
SELECT IFNULL (POR1."OpenQty", 0) into poqty FROM POR1 LEFT JOIN PDN1 ON PDN1."BaseEntry"= POR1."DocEntry"
WHERE PDN1."ItemCode"=POR1."ItemCode" AND PDN1."BaseLine"=POR1."LineNum" AND PDN1."DocEntry" = :list_of_cols_val_tab_del;
IF :mrnqty > :poqty then
error := -002;
error_message := 'GRPO Qty should not be more than PO Qty';

End IF;

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers