INSERT - Insert text elements

Basic form

INSERT TEXTPOOL prog ...FROM itab ...LANGUAGE lg.

Parts marked with " ..." are interchangeable

Addition:

... STATE state

Effect

Assigns the text elements in the internal table itab to the program prog and the language lg and inserts them in the library. The line structure of the table itab is described in the section Text elements.

Example

The following program uses the internal table TAB to set the text elements of the program PROGNAME.

DATA: PROGRAM(8) VALUE 'PROGNAME',
      TAB TYPE STANDARD TABLE OF TEXTPOOL WITH
               NON-UNIQUE DEFAULT KEY INITIAL SIZE 50,
      WA_TAB TYPE TEXTPOOL.
APPEND TAB.
WA_TAB-ID = 'T'. WA_TAB-KEY = SPACE.
WA_TAB-ENTRY = 'Sales'.
APPEND WA_TAB TO TAB.
WA_TAB-ID = 'H'. WA_TAB-KEY = '001'.
WA_TAB-ENTRY = 'Name   Age'.
APPEND WA_TAB TO TAB.
WA_TAB-ID = 'S'. WA_TAB-KEY = 'CUST'.
WA_TAB-ENTRY = '        Customer'.
APPEND WA_TAB TO TAB.
WA_TAB-ID = 'R'. WA_TAB-KEY = SPACE.
WA_TAB-ENTRY = 'Test program'.
APPEND WA_TAB TO TAB.

SORT TAB BY ID KEY.
INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE SY-LANGU.

Note

To ensure compatibility with previous releases, you must insert 8 spaces before the actual text in the ENTRY component when using selection texts ID = 'S') (see example above).

Addition

... STATE state

Note

This addition is for internal use only.
Changes and further developments, which may be incompatible, are possible at any time, and without notice or warning.


Effect

Determines the state in whcih the text elements in itab are stored in the library. State may be either A (for active) or I (for inactive). Inactive text elements are only visible to the user currently editing them, All other users work with the active version.

In the ABAP Workbench, you can define a set of objects being edited for each user (for example, text elements). These objects are saved as inactive until they are activated. If you omit the STATE addition, the system uses the "inactive" state for these objecs, and t the "active" state for all other objects.

This set is only ever available for a short time within transactions in the ABAP development environment, which ensures that all other programs that use the INSERT TEXTPOOL command without the STATE addition always insert "active" text elements.

Notes

  1. As in the example, the internal table should be sorted by the components ID and KEY to enable faster access to the text elements at runtime. However, this is not obligatory.

  2. The component LENGTH (see text elements) for the length of a text element does not have to be set explicitly. In this case - as in the example - the actual length of the text element is used.

  3. The value of LENGTH cannot be smaller than the text to which it applies. If your length specification is too short, it is ignored by INSERT and the actual length is used instead.
    On the other hand, larger values are allowed and can be used to reserve space for texts that may be longer when translated into other languages.


Exceptions

Non-Catchable Exceptions

Related

DELETE TEXTPOOL, READ TEXTPOOL