SAP STREX_SEARCH Function Module for
STREX_SEARCH is a standard strex search SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 strex search FM, simply by entering the name STREX_SEARCH into the relevant SAP transaction such as SE37 or SE38.
Function Group: STREX_TEXT_MINING
Program Name: SAPLSTREX_TEXT_MINING
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function STREX_SEARCH 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 'STREX_SEARCH'".
EXPORTING
INTERVAL_FROM = "
INTERVAL_TO = "
QUERY_LAISO = "Language According to ISO 639
* QUERY_CODE_PAGE = "
* SORTED_BY = "Sort Criteria for Search Result
QUERY_TERMS = "Search Request Terms
INDICES = "Index IDs
* REQ_ATTRIBUTES = "AttributeName
IMPORTING
SEARCH_RESULTS = "Found Documents
RESULT_PROPERTIES = "Document Properties
NUM_OF_HITS = "No. documents found
CALL_RETURN_CODE = "Return Code with Text
EXCEPTIONS
APPENDING_NODE_FAILED = 1 RENDERING_FAILED = 2 PARSING_RESPONSE_FAILED = 3 HTTP_SERVER_ERROR = 4 NO_INDEX_AVAILABLE_FOR_LANGU = 5
IMPORTING Parameters details for STREX_SEARCH
INTERVAL_FROM -
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
INTERVAL_TO -
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
QUERY_LAISO - Language According to ISO 639
Data type: LAISOOptional: No
Call by Reference: No ( called with pass by value option)
QUERY_CODE_PAGE -
Data type: STRINGOptional: Yes
Call by Reference: No ( called with pass by value option)
SORTED_BY - Sort Criteria for Search Result
Data type: STRX_SRTBYOptional: Yes
Call by Reference: No ( called with pass by value option)
QUERY_TERMS - Search Request Terms
Data type: STRX_QTRMSOptional: No
Call by Reference: No ( called with pass by value option)
INDICES - Index IDs
Data type: STRX_IXIDSOptional: No
Call by Reference: No ( called with pass by value option)
REQ_ATTRIBUTES - AttributeName
Data type: STRX_ATTRSOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for STREX_SEARCH
SEARCH_RESULTS - Found Documents
Data type: STRX_RESDSOptional: No
Call by Reference: No ( called with pass by value option)
RESULT_PROPERTIES - Document Properties
Data type: STRX_DPRPSOptional: No
Call by Reference: No ( called with pass by value option)
NUM_OF_HITS - No. documents found
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
CALL_RETURN_CODE - Return Code with Text
Data type: STRX_RCTXTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
APPENDING_NODE_FAILED -
Data type:Optional: No
Call by Reference: Yes
RENDERING_FAILED -
Data type:Optional: No
Call by Reference: Yes
PARSING_RESPONSE_FAILED -
Data type:Optional: No
Call by Reference: Yes
HTTP_SERVER_ERROR -
Data type:Optional: No
Call by Reference: Yes
NO_INDEX_AVAILABLE_FOR_LANGU -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for STREX_SEARCH 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_interval_from | TYPE I, " | |||
| lv_search_results | TYPE STRX_RESDS, " | |||
| lv_appending_node_failed | TYPE STRX_RESDS, " | |||
| lv_interval_to | TYPE I, " | |||
| lv_rendering_failed | TYPE I, " | |||
| lv_result_properties | TYPE STRX_DPRPS, " | |||
| lv_num_of_hits | TYPE I, " | |||
| lv_query_laiso | TYPE LAISO, " | |||
| lv_parsing_response_failed | TYPE LAISO, " | |||
| lv_query_code_page | TYPE STRING, " | |||
| lv_call_return_code | TYPE STRX_RCTXT, " | |||
| lv_http_server_error | TYPE STRX_RCTXT, " | |||
| lv_sorted_by | TYPE STRX_SRTBY, " | |||
| lv_no_index_available_for_langu | TYPE STRX_SRTBY, " | |||
| lv_query_terms | TYPE STRX_QTRMS, " | |||
| lv_indices | TYPE STRX_IXIDS, " | |||
| lv_req_attributes | TYPE STRX_ATTRS. " |
|   CALL FUNCTION 'STREX_SEARCH' " |
| EXPORTING | ||
| INTERVAL_FROM | = lv_interval_from | |
| INTERVAL_TO | = lv_interval_to | |
| QUERY_LAISO | = lv_query_laiso | |
| QUERY_CODE_PAGE | = lv_query_code_page | |
| SORTED_BY | = lv_sorted_by | |
| QUERY_TERMS | = lv_query_terms | |
| INDICES | = lv_indices | |
| REQ_ATTRIBUTES | = lv_req_attributes | |
| IMPORTING | ||
| SEARCH_RESULTS | = lv_search_results | |
| RESULT_PROPERTIES | = lv_result_properties | |
| NUM_OF_HITS | = lv_num_of_hits | |
| CALL_RETURN_CODE | = lv_call_return_code | |
| EXCEPTIONS | ||
| APPENDING_NODE_FAILED = 1 | ||
| RENDERING_FAILED = 2 | ||
| PARSING_RESPONSE_FAILED = 3 | ||
| HTTP_SERVER_ERROR = 4 | ||
| NO_INDEX_AVAILABLE_FOR_LANGU = 5 | ||
| . " STREX_SEARCH | ||
ABAP code using 7.40 inline data declarations to call FM STREX_SEARCH
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.Search for further information about these or an SAP related objects