SAP EXEC HOST ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• : ABAP_ESCAPE

ABAP_EXEC_SQL - Host Variables

ABAP_SYNTAX
... :dobj ...

What does it do?
Host variables are global or local data objects (usually variables) declared in the ABAP program that are used in operand positions of embedded Native SQL statements. Named data objects can be identified by an escape character (a colon :) placed in front of the names of the data objects. Instead of the data object itself, a field symbol to which the data object is assigned can also be specified. Dereferenced data reference variables cannot be specified. Depending on the operand position, the data objects can be variables or constants. Constant host variables are host constants.
Usually, only flat elementary fields and flat structures with elementary components can be used as host variables. If a structure is specified after the INTO clause by Native SQL, it is transformed by the Native SQL interface as if its components were specified as individual fields separated by commas.
• STRUCTURE EXEC SQL
In assignments between host variables and fields in database tables, a mapping takes place between the ABAP types and the database types. The ABAP types must match the database types. If they do not match, conversions must be made in the Native SQL interface. These conversions are platform-dependent and can raise exceptions.



Latest notes:

When passed to a host variable, a null value is transformed to its type-dependent initial value.
The indicator variables provided in the SQL standard, which can be specified after an operand to identify null values, can be specified in static Native SQL using a host variable that has to be of an external data type INT2.
As it is common in ABAP, trailing blanks are truncated in text field host variables.
Host variables cannot be enumerated objects.
ABAP_HINT_END



Example ABAP Coding

Like the example for literals. Here, the row to be read is specified using host variables.
ABEXA 00242
ABAP_EXAMPLE_END

Return to menu