ABAP HANA 7.51: Comma and Escaping variable
Comma: With New SQL, fields to be selected are separated by comma operator. Old SQL statement is still valid however the written SQL should be either fully new SQL or old SQL… mixing both syntaxes give a syntax error! e.g. If a field list is separated by a comma, the host variables must be escaped with @ sign.
Escaping Variable: Now any Variable, Work area or Internal table which are local to logic, must be escaped with @ sign when using New SQL. This clearly distinguishes the table fields from external variables.
Sample Source Code: Variant 1
With new open SQL:
- Selection list of fields has to be separated by a comma AND
- At the same time, any host variable used for either for comparison or storing a value must be escaped by @ sign
With new open SQL, either both of above should hold true or new SQL shouldn’t be used at all and old SQL should be used.
Check the video for Illustration and Example: