Show TOC

SELECT_TEXTLocate this document in the navigation structure

Use

The SELECT_TEXT creates a table with the text headers of all text modules which correspond to the requirements specified in OBJECT, NAME, ID, and LANGUAGE. The entries in the parameters OBJECT, NAME, ID, and LANGUAGE can also be generic.

Usually, the function module searches for texts in the text file as well as in the text memory. To limit the search area, use the options TEXTMEMORY_ONLY or DATABASE_ONLY.

If the option ARCHIV_HANDLE contains a value greater than 0, the system searches the archive for the specified texts.

Function call:

CALL FUNCTION  'SELECT_TEXT'
        EXPORTING
                CLIENT          = SY-MANDT
                OBJECT          = ?...
                NAME            = ?...
                ID              = ?...
                LANGUAGE        = ?...
                DATABASE_ONLY   = SPACE
                TEXTMEMORY_ONLY = SPACE
                ARCHIVE_HANDLE  = 0
        IMPORTING
                ENTRIES         =
        TABLES
                SELECTIONS      = ?...
        EXCEPTIONS
                WRONG_ACCESS_TO_ARCHIVE =
            

Export parameters:

CLIENT

Specify the client, in which to search for the texts. If you omit this parameter, the system uses the current client as default.

Reference field: SY-MANDT

Default value: SY-MANDT

OBJECT

If you omit this parameter, the system uses the current client as default. You can enter a generic value.

Reference field: THEAD-TDOBJECT

NAME

Enter the name of the text module you want to find. You can enter a generic value.

Reference field: THEAD-TDNAME

ID

Enter a text ID. You can enter a generic value.

Reference field: THEAD-TDID

LANGUAGE

Enter the language key of the text module. You can enter a generic value. The system then searches for the text in all languages that match the entry.

Reference field: THEAD-TDSPRAS

DATABASE_ONLY

The parameter can be used to specify whether the text modules should only be searched for in the text file.

Possible values:

  • ' ' Search in both the text file and text memory

  • 'X' Search in text file only

Default value: SPACE

TEXTMEMORY_ONLY

The parameter can be used to specify whether the text modules should be searched for in the text memory only.

Possible values:

  • ' ' Search in both the text file and text memory

  • 'X' Search in the text memory only

Default value: SPACE

ARCHIVE_HANDLE

If you want to search for the texts in the archive, you must enter a handle here. The system needs the handle to access the archive. You can use the function module ACHIVE_OPEN_FOR_READ to create the handle.

The value '0' indicates that you do not want to read the archive.

Reference field: SY-TABIX

Default value: 0

Import parameter:

ENTRIES

ENTRIES contains the number of selected text modules. The value corresponds to the number of lines in the table SELECTIONS.

Reference field: SY-TFILL

Table parameters:

SELECTIONS

The table SELECTIONS contains the text headers of all found texts that match the selection criteria specified in the call of function module SELECT_TEXT.

Structure: THEAD

Exceptions:

WRONG_ACCESS_TO

_ARCHIVE

The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).