SAP INSERT TEXTPOOL ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID INSERT-TEXTPOOL
• INSERT TEXTPOOL ABAP Statement
• FROM INSERT TEXTPOOL
• LANGUAGE INSERT TEXTPOOL

INSERT TEXTPOOL
Short Reference

ABAP_SYNTAX
INSERT TEXTPOOL prog FROM itab LANGUAGE lang.

What does it do?
This statement places the content of table itab into the repository as a text pool of the language specified in lang for the ABAP program specified in prog. If a text pool for the specified language already exists, all its text elements are overwritten. Otherwise, a new text pool is created for this language. By default, the text pool is saved in an active state.
prog expects a flat character-like data object, which contains the name of the program of the text elements to be read. The name is not case-sensitive.
lang expects a character-like flat data object that contains a language key with a maximum length of one character, and this value must be contained in the column SPRAS of the database table T002. If an invalid language is specified in lang, no text pool is created or overwritten. If lang contains a space, the behavior is undefined.
The internal table itab can be in any table category and its line type must correspond to the DDIC structure TEXTPOOL. If a nonexistent program is specified in prog , no text pool is created or overwritten.
In the internal table itab, the column ENTRY can contain the texts of the text symbols, the selection texts, the list headers, and the title for the program properties. Their length can be specified in the column LENGTH. The individual text elements are identified using the entries in the columns ID and KEY, whose valid values are shown in the table for READ TEXTPOOL.
If the columns ID or KEY of the internal table contain invalid values or if duplicate entries exist, an inconsistent text pool is created. If the internal table is empty, all text elements of an existing text pool are deleted or a text pool without text elements is created. If the length specified in LENGTH is shorter than the text length in ENTRY, it is automatically set to the text length in the text pool.
Return Codes
The statement INSERT TEXTPOOL always sets sy-subrc to the value 0.



Latest notes:

The specification of the text length in LENGTH defines the maximum length of the text element that is available in the ABAP Workbench when translating the text pool into other languages and should be set sufficiently large.
In the case of selection texts, there must be eight blanks before the actual text in ENTRY. If a selection text from the dictionary is to be used, the first character of ENTRY must be a D.
The INSERT TEXTPOOL statement should be used with caution, because it completely overwrites existing text pools.
ABAP_HINT_END



Example ABAP Coding

Attempt at a translation tool for text elements. The text pools of a source and a target language are imported into internal tables and, for each text element of the source language, a selection screen is displayed as a translation template. After the translation has been completed, the text pool of the target language is overwritten with the correspondingly changed internal table.
ABEXA 00350
ABAP_EXAMPLE_END

Return to menu