Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Open SQL - using string function in JOIN clause

Former Member
0 Likes
4,045

Hi,

I'm writing an open sql query and I should use a string function in the JOIN/ON clause, but Hana Studio gives error.

The join should be like this:

LEFT OUTER JOIN T024 AS t3
ON RIGHT(t3~EKGRP,2) = t2~FRGC1 

and the error is: "A Boolean expression is required in positions starting with RIGHT(T3~EKGRP."

If I try to use a concatenation operator I get another error:

LEFT OUTER JOIN T024 AS t3
ON t3~EKGRP like ('S' || t2~FRGC1) 

the error is: "(" is invalid here (due to grammar). contains an invalid character or it is a

The strange thing is that both ways run well if I use the sql script inside a sql Client like DBeaver.

How can I arrange my join?

Is there a way to write standard sql inside an Abap program?

Or should I perform the join outside the open sql script?

Best regards

LK

1 REPLY 1
Read only

DoanManhQuynh
Active Contributor
0 Likes
1,592

you can use like in ON condition but the right side must be character, and as far as i know there is no character expression could do what you are trying to do...