Text symbols, sometimes also referred to as text elements, are stored in the text pool of global ABAP classes.
A text symbol is identified by a three character ID, which has to be unique within the text pool. The ID of a text symbol consists of digits, letters or a combination of both. Text symbol IDs are not case-sensitive. In the text pool editor they are always displayed in upper case.
In our example, the text pool contains a text symbol 001 and a text symbol HAU.
Do not confuse text IDs with message IDs. For messages in message classes only digits are allowed.
Every text symbol defines a text in the original language of the ABAP class. The technical limit for the text length is 255 characters. In addition to this technical limit, a semantical maximum length has to be defined for each text symbol. The maximum length has to lie between the actual length and the technical limit.
In our example, the text symbol HAU has an actual length of 12 and a maximum length of 30.
The maximum length defines a hard limit for the translator. It should be significantly higher than the actual length to avoid the need for cryptic abbreviations in translated text elements.
There are two ways to access a text symbols in ABAP:
- Standalone, that is with text, followed by a hyphen, and the text ID
- Attached to a text literal, that is with the ID inside a pair of brackets immediately after a text literal.
In the second variant the text literal is used as a type of fallback. If the text symbol exists in the currently loaded text pool, then the content of the text symbol is used instead of the literal, otherwise the literal is used.
To avoid confusion, the text of the text symbol and the text in the literal should always match. The "Extended Program Check (SLIN)" in ATC contains a check of character strings. This check issues a warning if the literal and the text symbol are different.
After the translation of the text symbols, the ABAP runtime uses the text that fits the logon language of the user.