Skip to Content
0
Jul 19, 2018 at 08:21 PM

Syntax error in view filter expression

1840 Views Last edit Jul 19, 2018 at 08:22 PM 2 rev

Hello,

I am working on a requirement to build a view on BKPF with below where clause.

Where BUKRS NOT IN ('AAAA','BBBB')

AND ( GJAHR = '2018' OR (GJAHR = '2017' AND BLART = 'V1') OR BLART = 'V2')

In the projection node, i have created the below filter expression

(not in("BUKRS",'AAAA','BBBB')) AND (("GJAHR" ='2018') OR (("GJAHR" ='2017') AND("BLART"='V1') OR ("BLART"='V2'))

During validation, it is giving syntax error as "Invalid expression, 2048: failed to"

"Expression is not valid: Evaluator: syntax error in expression string;expected TK_RPAREN,parsing "not in (\"BUKRS\" ,'AAAA','BBBB')\n AND ((\"GJAHR\" ='2018') OR ((\"GJAHR\" ='2017') AND(\"BLART\"='V1') OR (\"BLART\"='V2'))[here]"

Also tried filter expression as,

"BUKRS" not in ('AAAA','BBBB') AND (("GJAHR" ='2018') OR (("GJAHR" ='2017') AND("BLART"='V1') OR ("BLART"='V2'))

It is giving error as

"

"Cannot convert the filter expression to a valid query. Invalid syntax used in your filter expression. Use valid syntax in your filter expression"

Please help me with valid syntax of filter expression to get the desired where clause.

Thanks,

Prasad