ABAP Keyword Documentation →  ABAP − Reference →  Declarations →  Declaration Statements →  Data Types and Data Objects →  Declaring Data Objects →  Literals → 

Literal Operator

The literal operator & can be used to join two literals (of the same type) as a single literal. In this way, the definition of one literal can be extended across 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 be used for the character literals, but not for the numeric literals. The syntax for text field literals and text string literals is:

'...' & '...' & ... & '...'
`...` & `...` & ... & `...`

These categories of literals cannot be mixed.

The literal operator can normally be used to join literals in any reader 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

Example

Constructs an HTML string from subliterals.

DATA html TYPE string.

html =
  `<html>`   &
  `<body>`   &
  `Text`     &
  `</body>`  &
  `</html>`.

cl_abap_browser=>show_html( html_string = html ).