Ansicht
Dokumentation

ABENTEXTPOOL_STRUCTURE - TEXTPOOL STRUCTURE

ABENTEXTPOOL_STRUCTURE - TEXTPOOL STRUCTURE

General Data in Customer Master   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Text Elements

Text elements are used to store texts which are not supposed to be hard-coded in programs. You can maintain text elements outside the program that use them (in the ABAP/4 Editor, choose Goto -> Text elements). They are particularly suitable for maintaining texts in multiple language applications.

The following types of text elements exist:

  • Program titles
  • List headers
  • Column headers
  • Selection texts (text belonging to selection criteria
    and program parameters)
  • Text symbols (constant text passages)


The structure of text elements is defined by the structure TEXTPOOL which contains the following fields:

ID:
A single character for the text element type. The following values are possible:

R - Program titles
T - List headers
H - Column headers
S - Selection texts
I - Text symbols

KEY:
Key field which can contain any of the values below, depending on the text element type:

H - Number of a line with column
headers (001 - 004)
S - Max. 8-character name of a selection
criterion or program parameter
I - 3-character number of a text symbol

For program titles and list headers, the field is blank.

ENTRY:
Text belonging to the text element, max. 255 characters

LENGTH:
Length of the text

Examples

The table below contains some typical values for text elements.

ID KEY ENTRY LENGTH
-----------------------------------------------------
H 001 'Name   Age' 10
I 100 'Tax' 10
R   'Test program' 12
S CUST 'Customer' 8
T   'Sales' 10

Notes

  1. LENGTH contains the length of the text. If the text is to be translated into another language at a later stage, the value chosen for LENGTH is generally greater than that for the original language. In this way, you can allow for translations that are longer.

  2. There are two ways you can address text symbols - with TEXT-xxx or with '...'(xxx). Here, xxx stands for the number and ... for the text of the text symbol.

    The first form requires an appropriate text to be stored under the number xxx. If this is not the case, the output will be blank.

    The second form makes programs eaiser to read. The text in quotation marks should match the text stored under the text symbol. If this is not the case, the text stored under the text symbol is used, unless the number xxx has no text. In this case, the text in quotation marks is used.

    Example: If the text symbol with the number 001 contains 'Please enter your name', the command

    WRITE: / TEXT-001,
    / 'Please enter your name'(001),
    / 'What is your name?'(001).

    outputs "Please enter your name" three times.

    You can perform a comparison of texts used in a program with texts stored under text symbols from the ABAP/4 program editor by selecting Goto -> Text elements and then choosing Compare text symbols.

  3. If the LENGTH you choose for text symbols is greater than the length of the actual text, the system interprets this as if it has to pad the text up to the length LENGTH with blanks. When you use the notation '...'(xxx), this means that the text in quotation marks must be explicitly padded Text with blanks up to the length LENGTH. Otherwise, the text stored under the text symbol would not match the text in quotation marks (see note 2).

    Example: If the text symbol with the number 036 contains 'Name', but is defined with the length 10, the command

    WRITE: / SY-VLINE, TEXT-036, SY-VLINE,
    / SY-VLINE, 'Tax '(036), SY-VLINE,
    / SY-VLINE, 'Tax'(036), SY-VLINE.

    outputs "| Tax |" three times. In the third line, the text stored under the number 036 is output in the length 8 and not as the three-character long text "Tax". When you perform a comparison of these text elements (see note 2), the text symbols in the second and third lines are recognized as different.





General Material Data   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 6046 Date: 20240425 Time: 174450     sap01-206 ( 87 ms )