Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Stored Proc works intermittently

$
0
0

It might help the analysis if you look at the data:

 

What do the wrong row look like when you execute:

 

SELECT       T1."DocEntry", T0."DocEntry", T0."DocTotal",

             T0."VatSum", T2."U_MinMargin", T2."U_MaxMargin"

 

            FROM OINV T0

          INNERJOIN INV1 T1

               ON T0."DocEntry" = T1."DocEntry"

                           INNERJOIN OCRD T2

               ON T0."CardCode" = T2."CardCode"

            WHERE

          T0."DocEntry" = :list_of_cols_val_tab_del

 

            GROUPBY T1."DocEntry", T0."DocEntry", T0."DocTotal",

             T0."VatSum",T2."U_MinMargin",T2."U_MaxMargin"

           

     HAVING

         (nullif(T0."DocTotal" - T0."VatSum"

               - (SUM(T1."Quantity" * T1."GrossBuyPr")), 0)

           / nullif(SUM(T1."Quantity" * T1."GrossBuyPr"), 0)

            * 100)

          NOTBETWEEN"U_MinMargin"and"U_MaxMargin";

 

Also: is :list_of_cols_val_tab_del actually a single literal value or a list?

 

- Lars


Viewing all articles
Browse latest Browse all 9165

Trending Articles