ABAP inside SQL statements
2022-01-31
Did you know that, if you SAP is recent enough, you can use complex ABAP expressions in the middle of SQL commands?
Like this, for example:
SELECT name1
FROM kna1
WHERE kunnr =
@( VALUE kunnr( itbl[ vbeln = i_vbeln ]-kunnr OPTIONAL ) )
INTO result.
See?
SAP calls them host expressions and says they can be used in several places in the SQL command. Even in the UP TO
.
Thank you Manuel Andrade for the tip.
Foto: Egisto Sani.
Greetings from Abapinho.