SAP SELECT_TEXT Function Module for SAPscript: Select text
SELECT_TEXT is a standard select text SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for SAPscript: Select text processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for select text FM, simply by entering the name SELECT_TEXT into the relevant SAP transaction such as SE37 or SE38.
Function Group: STXD
Program Name: SAPLSTXD
Main Program: SAPLSTXD
Appliation area:
Release date: 16-Jan-1995
Mode(Normal, Remote etc): Normal Function Module
Update:
Function SELECT_TEXT pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'SELECT_TEXT'"SAPscript: Select text.
EXPORTING
* CLIENT = SY-MANDT "Client
* WILDCARD_PLUS = ' ' "
* DATABASE_ONLY = ' ' "Indicator: Search in text file only
* TEXTMEMORY_ONLY = ' ' "Indicator: Search in text memory only
* OBJECT = '*' "Text object of texts to be searched for
* NAME = '*' "Name of text to be searched for
* ID = '*' "Text ID of texts to be searched for
* LANGUAGE = '*' "Language of texts to be searched for
* ARCHIVE_HANDLE = 0 "Archive handle
* LOCAL_CAT = ' ' "Text catalog local
IMPORTING
ENTRIES = "Number of texts found
TABLES
* SELECTIONS = "Text header of texts found
* T_OBJECT = "Table for text objects (RANGES)
* T_NAME = "Table for text names (RANGES)
* T_ID = "Table for text IDs (RANGES)
* T_LANGUAGE = "Table for text languages (RANGES)
* I_NAME = "Structure Contains Elementary Type TDNAME
EXCEPTIONS
WRONG_ACCESS_TO_ARCHIVE = 1
IMPORTING Parameters details for SELECT_TEXT
CLIENT - Client
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
WILDCARD_PLUS -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DATABASE_ONLY - Indicator: Search in text file only
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TEXTMEMORY_ONLY - Indicator: Search in text memory only
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECT - Text object of texts to be searched for
Data type: THEAD-TDOBJECTDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NAME - Name of text to be searched for
Data type: THEAD-TDNAMEDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ID - Text ID of texts to be searched for
Data type: THEAD-TDIDDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language of texts to be searched for
Data type: THEAD-TDSPRASDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ARCHIVE_HANDLE - Archive handle
Data type: SY-TABIXOptional: Yes
Call by Reference: No ( called with pass by value option)
LOCAL_CAT - Text catalog local
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SELECT_TEXT
ENTRIES - Number of texts found
Data type: SY-TFILLOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SELECT_TEXT
SELECTIONS - Text header of texts found
Data type: THEADOptional: Yes
Call by Reference: No ( called with pass by value option)
T_OBJECT - Table for text objects (RANGES)
Data type: STXDROBJOptional: Yes
Call by Reference: No ( called with pass by value option)
T_NAME - Table for text names (RANGES)
Data type: STXDRNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
T_ID - Table for text IDs (RANGES)
Data type: STXDRIDOptional: Yes
Call by Reference: No ( called with pass by value option)
T_LANGUAGE - Table for text languages (RANGES)
Data type: STXDRLANGOptional: Yes
Call by Reference: No ( called with pass by value option)
I_NAME - Structure Contains Elementary Type TDNAME
Data type: STEXTNAMEOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
WRONG_ACCESS_TO_ARCHIVE - Archive handle invalid for access
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SELECT_TEXT Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_client | TYPE SY-MANDT, " SY-MANDT | |||
lv_entries | TYPE SY-TFILL, " | |||
lt_selections | TYPE STANDARD TABLE OF THEAD, " | |||
lv_wrong_access_to_archive | TYPE THEAD, " | |||
lv_wildcard_plus | TYPE THEAD, " SPACE | |||
lt_t_object | TYPE STANDARD TABLE OF STXDROBJ, " | |||
lv_database_only | TYPE STXDROBJ, " SPACE | |||
lt_t_name | TYPE STANDARD TABLE OF STXDRNAME, " | |||
lv_textmemory_only | TYPE STXDRNAME, " SPACE | |||
lt_t_id | TYPE STANDARD TABLE OF STXDRID, " | |||
lv_object | TYPE THEAD-TDOBJECT, " '*' | |||
lv_name | TYPE THEAD-TDNAME, " '*' | |||
lt_t_language | TYPE STANDARD TABLE OF STXDRLANG, " | |||
lv_id | TYPE THEAD-TDID, " '*' | |||
lt_i_name | TYPE STANDARD TABLE OF STEXTNAME, " | |||
lv_language | TYPE THEAD-TDSPRAS, " '*' | |||
lv_archive_handle | TYPE SY-TABIX, " 0 | |||
lv_local_cat | TYPE SY. " SPACE |
  CALL FUNCTION 'SELECT_TEXT' "SAPscript: Select text |
EXPORTING | ||
CLIENT | = lv_client | |
WILDCARD_PLUS | = lv_wildcard_plus | |
DATABASE_ONLY | = lv_database_only | |
TEXTMEMORY_ONLY | = lv_textmemory_only | |
OBJECT | = lv_object | |
NAME | = lv_name | |
ID | = lv_id | |
LANGUAGE | = lv_language | |
ARCHIVE_HANDLE | = lv_archive_handle | |
LOCAL_CAT | = lv_local_cat | |
IMPORTING | ||
ENTRIES | = lv_entries | |
TABLES | ||
SELECTIONS | = lt_selections | |
T_OBJECT | = lt_t_object | |
T_NAME | = lt_t_name | |
T_ID | = lt_t_id | |
T_LANGUAGE | = lt_t_language | |
I_NAME | = lt_i_name | |
EXCEPTIONS | ||
WRONG_ACCESS_TO_ARCHIVE = 1 | ||
. " SELECT_TEXT |
ABAP code using 7.40 inline data declarations to call FM SELECT_TEXT
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single MANDT FROM SY INTO @DATA(ld_client). | ||||
DATA(ld_client) | = SY-MANDT. | |||
"SELECT single TFILL FROM SY INTO @DATA(ld_entries). | ||||
DATA(ld_wildcard_plus) | = ' '. | |||
DATA(ld_database_only) | = ' '. | |||
DATA(ld_textmemory_only) | = ' '. | |||
"SELECT single TDOBJECT FROM THEAD INTO @DATA(ld_object). | ||||
DATA(ld_object) | = '*'. | |||
"SELECT single TDNAME FROM THEAD INTO @DATA(ld_name). | ||||
DATA(ld_name) | = '*'. | |||
"SELECT single TDID FROM THEAD INTO @DATA(ld_id). | ||||
DATA(ld_id) | = '*'. | |||
"SELECT single TDSPRAS FROM THEAD INTO @DATA(ld_language). | ||||
DATA(ld_language) | = '*'. | |||
"SELECT single TABIX FROM SY INTO @DATA(ld_archive_handle). | ||||
DATA(ld_local_cat) | = ' '. | |||
Search for further information about these or an SAP related objects