‎2021 Mar 23 12:10 PM
Hey everyone,
I would love to do something like the following, but i get a syntax error:
SELECT * FROM MARA
WHERE MATNR EQ @( GT[ 1 ]-MATNR ).
Is something like this possible?
‎2021 Mar 24 3:47 PM
I could make it work successfully in my 7.52 version:
DATA gt TYPE TABLE OF scarr.
gt = VALUE #( ( carrid = 'LH' ) ).
SELECT * FROM scarr
WHERE carrid = @( gt[ 1 ]-carrid )
INTO TABLE @DATA(scarr_table).I guess it does a syntax error in your system because you're using an old ABAP version where so-called Host Expressions (@( ... )) are not permitted yet (available since 7.50).
NB: you may also use CONV, VALUE, etc. in host expressions - The right documentation link for host expressions is this one: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenopen_sql_host_exp... (jorgen_lindqvist41 fyi)
NB: Kevin, thanks for reopening the question to let me add this answer.
‎2021 Mar 24 3:47 PM
I could make it work successfully in my 7.52 version:
DATA gt TYPE TABLE OF scarr.
gt = VALUE #( ( carrid = 'LH' ) ).
SELECT * FROM scarr
WHERE carrid = @( gt[ 1 ]-carrid )
INTO TABLE @DATA(scarr_table).I guess it does a syntax error in your system because you're using an old ABAP version where so-called Host Expressions (@( ... )) are not permitted yet (available since 7.50).
NB: you may also use CONV, VALUE, etc. in host expressions - The right documentation link for host expressions is this one: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenopen_sql_host_exp... (jorgen_lindqvist41 fyi)
NB: Kevin, thanks for reopening the question to let me add this answer.
‎2021 Mar 24 4:13 PM
Thank you Sandra! Yes there it is in plain sight! And also, when I write my own test example correctly, even I get it to work 🙂
Also, the ABAP Documentation DOES also link to them from the link i provided.
Former Member I'm really sorry I gave you an incorrect answer. It was to the best of my knowledge, but I was performing below my own personal standards here. I recommend you change the correct answer to this one from Sandra, and I can remove mine to not confuse others finding your question later on.