cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax error in view filter expression

former_member198680
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

ssurampally
Active Contributor
0 Kudos

Hi, you are missing a end ) in the second expression of code, adjust your brackets logically.

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

Thanks for ur sharp eyes.

Answers (0)