Skip to Content
author's profile photo Former Member
Former Member

SAP B1 HANA - Query conversion

hello

how would I change this to work in SAP b1 HANA Sbo trns notification stored procedure?

IF @OBJECT_TYPE='17' AND @TRANSACTION_TYPE in ('U','A')

BEGIN

IF exists

(select count(*) from rdr1 T0 inner join oitm T1 on T0.ItemCode = T1.ItemCode inner join OITW t2 on t2.ItemCode = t1.ItemCode and t0.WhsCode = t2.WhsCode

where T1.U_ALLOWNEG = 'No'

AND T0.DocEntry = @list_of_cols_val_tab_del

having SUM(t2.OnHand + t2.OnOrder - t2.IsCommited ) < 0 )

select TOP 1 @ERROR = 1 ,@ERROR_MESSAGE = 'This Item Cannot be Ordered - Causing Negative Stock' END

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Feb 27, 2014 at 03:37 AM

    Hi,

    Please check this document http://scn.sap.com/docs/DOC-47664

    Thanks & Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 18, 2016 at 07:48 AM

    IF :OBJECT_TYPE = '17' AND :TRANSACTION_TYPE=U' OR :TRANSACTION_TYPE='A') THEN

    dECLARE temp_var_0 integer;

    SELECT

    (SELECT COUNT(*)

    FROM RDR1 T0

    INNER JOIN OITM T1 ON T0."ItemCode" = T1."ItemCode"

    INNER JOIN OITW t2 ON t2."ItemCode" = t1."ItemCode" AND t0."WhsCode" = t2."WhsCode"

    WHERE T1.U_ALLOWNEG = 'No' AND T0."DocEntry" = :list_of_cols_val_tab_del HAVING SUM(t2."OnHand" + t2."OnOrder" -

    t2."IsCommited") < 0) INTO temp_var_0 FROM DUMMY;

    IF :temp_var_0 > 0 THEN

    SELECT 1, 'This Item Cannot be Ordered - Causing Negative Stock' INTO ERROR, ERROR_MESSAGE FROM DUMMY;

    END IF;

    END IF;

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 18, 2016 at 07:48 AM

    AS REQUIRED.. PLS SEE

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.