SAP SQL STRING



Get Example source ABAP code based on a different SAP table
  


• ABAP_OSQL_EXP

ABAP_SQLEXP - sql_string

ABAP_SYNTAX
... sql_elem1 sql_elem2 $[ sql_elem3 ... $] ...

What does it do?
String expression in AB_SQL . The operator concatenates the character strings in two adjacent operands into a single character string. Elementary SQL expressions can be specified as the operands sql_elem1, sql_elem2 with the following restrictions:
A literal must be a non-empty text field literal of type c.
Host variables and host expressions must be of ABAP type c.
Columns of data sources must have one of the dictionary types CHAR, CLNT, CUKY, LANG, or UNIT.
The result of the concatenation must be no longer than 255 characters. Trailing blanks are handled as follows:
Precisely one blank is respected in host variables declared using CONSTANTS and in text field literals consisting only of blanks.
In all other cases, trailing blanks are cut off on the right.
The result has the type CHAR in the resulting length and can be assigned to the ABAP types c and string in accordance with the associated assignment rule.
If the operand of a string expression has the null value, the result of the full string expression is the null value.



Latest notes:

Specifying a string expression always means specifying an SQL expression. String expressions can only be specified for operand positions for which SQL expressions are possible.
Strings can also be concatenated using the SQL function CONCAT. The function CONCAT is restricted to concatenating two operands but has the following benefits when compared to the operator :
It allows any SQL expressions as operands.
It allows more data types.
It does not apply any special handling to constants and text field literals that contain only blanks.
It allows results to be longer than 255 characters.
A string expression cannot be evaluated in the table buffer and always causes table buffering to be bypassed.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
The two columns in a result set are created using a concatenation of character-like columns of the data source and of literals.
ABEXA 01283
ABAP_EXAMPLE_END

ABAP_EXAMPLE_ABEXA
SQL Expressions, Concatenations
ABAP_EXAMPLE_END