Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Error in query but can't identify where

$
0
0

Hello, i'm trying to make a query. This is my query:

 

SELECT

  T0."DocNum",

  T2."SlpName",

  T0."DocDate", 

  T0."CardName",

  ( 

  T0."VatSum" + T0."TotalExpns"

  + COALESCE( ( SELECT SUM(T4."LineTotal" ) FROM INV1 T4 WHERE ( T0."DocEntry" = T4."DocEntry" ) ),0)

  - T0."DiscSum" 

  ) AS DOCUMENT_TOTAL,

  ( 

  T0."VatSum" + T0."TotalExpns"

  + COALESCE( ( SELECT SUM( T1."LineTotal" ) FROM INV1 T1 WHERE ( T0."DocEntry" = T1."DocEntry" ) ) ,0) 

  - COALESCE( ( SELECT SUM( T3."DrawnSum" ) FROM INV9 T3 WHERE ( T0."DocEntry" = T3."DocEntry" ) AND ( T3."ObjType" = 203 ) ) ,0) 

  - T0."DiscSum" - T0."PaidToDate" 

  ) AS BALANCE_DUE,

  T0."GrosProfit"

FROM 

  OINV T0 

  INNER JOIN OSLP T2 ON (T0."SlpCode" = T2."SlpCode")

WHERE 

     (T0."DocDate" <= [%DocDate1] OR [%DocDate1] = '') 

  AND (T0."DocDate" >= [%DocDate2] OR [%DocDate2] = '') 

  AND (T2."SlpName" <= [%SlpName1] OR [%SlpName1] = '') 

  AND (T2."SlpName" >= [%SlpName2] OR [%SlpName2] = '') 

ORDER BY 

  T2."SlpName" ASC, 

  T0."DocDate" DESC

 

When i run the query (without the WHERE section) on HANA STUDIO it works fine.

 

When i go to SAP Query Manager and try to run it i have these scenarios:

 

1 - The query doesn't run.

2 - If i remove only the "WHERE" section, it works.

3 - If i remove only the "BALANCE DUE" and "DOCUMENT TOTAL" sections, it works (even with the "WHERE" section).

 

I don't know what to do to solve my problem.

 

Any idea?


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>