ABAPEXEC_HOST - EXEC HOST
CL_GUI_FRONTEND_SERVICES - Frontend Services TXBHW - Original Tax Base Amount in Local CurrencyThis documentation is copyright by SAP AG.
EXEC SQL - Host Variables
Host variables are global or local variables declared in the ABAP program, or variables that are used in operand positions byNative SQL statements. For identification purposes, the variable name has a colon(:) directly in front of it. Instead of specifying a variable itself, you can also specify afield symbol to which the variable is assigned. The specification of a dereferenced data reference variable is not possible.
With an exception,you can only use flat elementary fields and flat structures with elementary components as host variables.If a structure is listed in a Native SQL statement after INTO, it is converted by the Native SQL interface as if its components were listed as individual fields separated by commas.
In a SELECT statement, you can specify the SAP-specific addition STRUCTURE between INTO and an individual host variable. This addition has the effect that the host variableis treated like a structure, even if a non-typed formal parameter or a non-typed field symbol is specified.Otherwise, when several values are being passed, depending on the platform, either the first value only is passed or an exception occurs.
If you have assignments between host variales and fields in database tables, the Native SQL interfacepasses a description of type, size, and storage location of the used ABAP fields to the database system.The actual database accesses and conversions are usually executed directly by the corresponding operations of the database system. In some cases, however, the Native SQL interface executes extensive compatibility checks.
The conversion rules between ABAP data types and types of database columns are listed in the programming interface manuals of the appropriate database system - both for write accesses(INSERT, UPDATE) as well as for read (SELECT) accesses. These conversion rules apply also to the input and output parameters fordatabase procedures. Any combinations listed there are undefined and should not be used.
Notes
The indicator variables provided in the SAP standard, which can be specified after an operand to identify null values, can be specified in Native SQL by a host variable that has to be of anexternal data type INT2.
Example
Reading a row from the database table SPFLIusing Native SQL and host variables. If a row was found, sy-subrc is set to 0; if not, it isset to 4. After INTO, the STRUCTURE addition could be specified. However, this is notnecessary since wa can be statically recognized as a structure. If a structure, wa is handled in the INTO clause as if all subfields were listed separately: INTO :wa-cityfrom, :wa-cityto.
PARAMETERS: p_carrid TYPE spfli-carrid,
p_connid TYPE spfli-connid.
DATA: BEGIN OF wa,
cityfrom TYPE spfli-cityfrom,
cityto TYPE spfli-cityto,
END OF wa.
EXEC SQL.
SELECT cityfrom, cityto
INTO :wa
FROM spfli
WHERE mandt = :sy-mandt AND
carrid = :p_carrid AND connid = :p_connid
ENDEXEC.
BAL Application Log Documentation SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up
This documentation is copyright by SAP AG.
Length: 4323 Date: 20120522 Time: 053310 triton ( 218 ms )






