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

Facing error in sql query.

amysh95
Participant
20,348

Hey,

am facing an error while writing sql query. I am using gui7.2.

error: If the new OpenSQL syntax is used, it must be used throughout. This includes using @ to escape host variables.

what is this. my code is:

SELECT SINGLE * FROM
ADRCT LEFT JOIN TVKO
ON ADDRNUMBER = TVKO-ADRNR
INTO ADRCT
WHERE TVKO-BUKRS = VBRK-BUKRS.

I also tried this.

SELECT SINGLE * FROM
ADRCT LEFT JOIN TVKO
ON ADDRNUMBER = TVKO-ADRNR
INTO (@ADRCT)
WHERE TVKO-BUKRS = VBRK-BUKRS.

but still facing error.

1 ACCEPTED SOLUTION
Read only

DoanManhQuynh
Active Contributor
6,427

(@ADRCT) should be @ADRCT only, no bracket, where condition also need @.

Also, for join sql you have to use ~ instead of -.

3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
6,427

Don't use host expressions at all (don't use @) or use only host expressions (@ in front of all variables)

Read only

DoanManhQuynh
Active Contributor
6,428

(@ADRCT) should be @ADRCT only, no bracket, where condition also need @.

Also, for join sql you have to use ~ instead of -.

Read only

matt
Active Contributor
6,427

Read the ABAP help on the syntax of select.