Skip to Content

Grpo qty is greater than Po qty in sap b1 hana Validation

Dear Experts,

How i Ensure that system should must not accept GRPO having quantity greater then PO quantity using SBO_TransactionNotice Procedure in Sap B1 hana.

Here i tried the below query not working. Help me shortout the issue.

vcountitem (NVARCHAR)

Select Count(T1."Quantity") into vcountitem from "PDN1" T1 inner join "POR1" T2 on T1."BaseEntry"=T2."DocEntry" and T1."BaseType"<>'20' and T1."BaseLine"=T2."LineNum" and T1."Quantity">T2."OpenCreQty" where T1."DocEntry"=:list_of_cols_val_tab_del;

If :vcountitem>0 then

error := -1001001;

error_message := 'Qty differ from po';

End If;

Thanks & Regards

Yugendra D

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 11 at 12:46 PM

    Try This -

    Note: It is in SQL Please convert it into HANA

    IF EXISTS

    ( SELECT T0.BaseEntry FROM [dbo].[PDN1] T0 INNER JOIN [POR1] T1 ON T1.DOCENTRY=T0.BASEENTRY WHERE T0.BaseType = 22 AND T0.ItemCode =T1.ItemCode AND T0.BaseLine = T1.LineNum AND T0.DOCENTRY = @list_of_cols_val_tab_del GROUP BY T0.BaseEntry HAVING(SUM(T0.Quantity) > SUM(T1.Quantity)) OR sum(t0.quantity) > sum(t0.BaseOpnQty) )

    BEGIN SET @OutPut=1

    SET @error_no=1008

    SET @error_text='GRPO Quantity Can Not Be Grater Than PO Quantity.'

    END

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 11 at 12:53 PM

    Dear Shrikant Mandavkar,

    Thanks For Your Response.

    How i covert SQL SP into to HANA SP in sap b1 HANA studio?

    Is there any posssiblities there help me.

    Thanks & Regards

    Yugendra D

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 12 at 04:58 AM

    Hi Experts,

    I Tried this Sap B1 hana validation But not.working. some one help me to sort out the issue,

    (Select Count(T1."BaseEntry") into vcountitem from "PDN1" T1 inner join "POR1" T2 on T1."BaseEntry"=T2."DocEntry" where T1."BaseType"='22' and T1."BaseLine"=T2."LineNum" and T1."DocEntry"=:list_of_cols_val_tab_del group by T1."BaseEntry" HAVING(SUM(T1."Quantity") > SUM(T2."Quantity")) OR sum(T1."Quantity") > sum(T1."BaseOpnQty")); If :vcountitem >0 then

    error := -1001001;

    error_message := 'Qty differ from po';

    End If;

    Add comment
    10|10000 characters needed characters exceeded