Skip to content

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

Text Symbols

A text symbol is a named data object of an ABAP program that is not declared in the program itself and instead is defined as a part of the text elements of the program. A text symbol has the data type c and the length defined in the text elements by mlen.

A text symbol behaves like a constant and can be specified in reading positions using its names as follows:

... text-idf ...

Here, idf is the three-character ID of the text symbol. This ID can consist of any alphanumeric characters plus "_". The text symbol is taken from the currently loaded text pool.

If the text symbol is not in the currently loaded text pool, text-idf is handled like an initial single-character text field.

A text symbol can be joined with text field literals using the following syntax:

... 'Literal'(idf) ...

If the text symbol is in the currently loaded text pool, it replaces the literal. If the text symbol does not exist, the literal is used.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • Like all text elements, text symbols are linked to the translation environment. They can be used in all locations where translated texts are to be displayed by the program.

  • The maximum length of a text symbol must be chosen so that there is enough space for the translation. For example, the German translation of the six-character English word "window" requires seven characters ("Fenster").

  • The name text-idf is reserved for text symbols. A structure called text cannot have any components with three-character names. It is best never to call a structure text. This can cause syntax errors, in particular in structures that reference global data types.

Example

Accesses the text symbol exa of the current program. Its text is displayed (if available). If the text does not exist, the text field literal is used in the first case and a blank is used in the second case.

cl_demo_output=>new( 
  )->write( 'Text in text symbol'(exa) 
  )->write( TEXT-exa 
  )->display(  ).