Ansicht
Dokumentation

ABENLITERAL_OPERATOR - LITERAL OPERATOR

ABENLITERAL_OPERATOR - LITERAL OPERATOR

Vendor Master (General Section)   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

Literal Operator

... ${ '...' & '...' $[& '...' $[...$] $] $}
  $| ${ `...` & `...` $[& `...` $[...$] $] $} ...

Effect

The literal operator & can be used to combine two character literals of the same type into a single character literal. The two categories of literals cannot be mixed. As a result, the definition of one literal can span multiple program lines. The content of the resulting literal must match its type and its length must not exceed the associated maximum length.

The literal operator can normally be specified to combine literals in all read position. Exceptions to this are literals specified dynamically in parentheses, literals in parenthesized lists separated by commas (here the only relevant operand position is WHERE IN), and literals in embedded Native SQL.

Notes

  • Apart from character literals, the literal operator can also be used to combine string templates.
  • Any trailing blanks in text field literals are respected by the literal operator.
  • When used for literals, the literal operator & must not be confused with the concatenation operator && that can be used in string expressions to concatenate character-like operators. While literals are combined using the literal operator once when a program is compiled, the concatenation operator executes a real operation at runtime and concatenates any number of character-like operands. The trailing blanks of operands with fixed lengths, particularly text field literals, are ignored.
  • Character literals combined using the literal operator & are subject to the upper limit of 255 characters. Longer character strings can only be concatenated at runtime, for example using the concatenation operator &&.

Example

Construction of an HTML string from literals.






BAL_S_LOG - Application Log: Log header data   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 2988 Date: 20240420 Time: 052223     sap01-206 ( 49 ms )