SAP EHSB_SCRT_TEXT_FIND Function Module for NOTRANSL: EHS: Suchen über die Langexte
EHSB_SCRT_TEXT_FIND is a standard ehsb scrt text find SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: EHS: Suchen über die Langexte 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 ehsb scrt text find FM, simply by entering the name EHSB_SCRT_TEXT_FIND into the relevant SAP transaction such as SE37 or SE38.
Function Group: EHSB_SCRT
Program Name: SAPLEHSB_SCRT
Main Program: SAPLEHSB_SCRT
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function EHSB_SCRT_TEXT_FIND 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 'EHSB_SCRT_TEXT_FIND'"NOTRANSL: EHS: Suchen über die Langexte.
EXPORTING
* I_SEARCHMODE = ESP1_SRCHMD_INIT "Search mode to find historical data
I_VALDAT = "Key Date
* I_DATERANGE = "EHS: Struct. for searching via time frame (historical data)
I_TABLENAME = "
* I_FIELDNAME = ' ' "
I_LANGUAGE = "ABAP System Field: Language Key of Text Environment
I_SEARCH_STRING = "
IMPORTING
E_NUM_FOUND = "ABAP System Field: Row Index of Internal Tables
TABLES
I_RESTRICTION_TAB = "EHS: Minimum Key for FB Call Interface
E_KEY_TAB = "EHS: Object key, sub-object key for long text entries
* E_FRTO_KEYTAB = "Result of the Historical Search
EXCEPTIONS
PARAMETER_ERROR = 1 TEXT_READ_ERROR = 2
IMPORTING Parameters details for EHSB_SCRT_TEXT_FIND
I_SEARCHMODE - Search mode to find historical data
Data type: RCGSELSCR-SEARCHMODEDefault: ESP1_SRCHMD_INIT
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_VALDAT - Key Date
Data type: RCGADDINF-VALDATOptional: No
Call by Reference: No ( called with pass by value option)
I_DATERANGE - EHS: Struct. for searching via time frame (historical data)
Data type: RCGDATERANGEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TABLENAME -
Data type: ESP1_TAB_NAMEOptional: No
Call by Reference: No ( called with pass by value option)
I_FIELDNAME -
Data type: ESP1_FIELD_NAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LANGUAGE - ABAP System Field: Language Key of Text Environment
Data type: SY-LANGUOptional: No
Call by Reference: No ( called with pass by value option)
I_SEARCH_STRING -
Data type: ESP1_STRINGOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for EHSB_SCRT_TEXT_FIND
E_NUM_FOUND - ABAP System Field: Row Index of Internal Tables
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for EHSB_SCRT_TEXT_FIND
I_RESTRICTION_TAB - EHS: Minimum Key for FB Call Interface
Data type: EHSBS_STDRECNOptional: No
Call by Reference: No ( called with pass by value option)
E_KEY_TAB - EHS: Object key, sub-object key for long text entries
Data type: EHSBS_LTXTKEYOptional: No
Call by Reference: No ( called with pass by value option)
E_FRTO_KEYTAB - Result of the Historical Search
Data type: EHSBS_LTXTKEY_FRTOOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
PARAMETER_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TEXT_READ_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for EHSB_SCRT_TEXT_FIND 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_e_num_found | TYPE SY-TABIX, " | |||
| lv_i_searchmode | TYPE RCGSELSCR-SEARCHMODE, " ESP1_SRCHMD_INIT | |||
| lv_parameter_error | TYPE RCGSELSCR, " | |||
| lt_i_restriction_tab | TYPE STANDARD TABLE OF EHSBS_STDRECN, " | |||
| lv_i_valdat | TYPE RCGADDINF-VALDAT, " | |||
| lt_e_key_tab | TYPE STANDARD TABLE OF EHSBS_LTXTKEY, " | |||
| lv_text_read_error | TYPE EHSBS_LTXTKEY, " | |||
| lv_i_daterange | TYPE RCGDATERANGE, " | |||
| lt_e_frto_keytab | TYPE STANDARD TABLE OF EHSBS_LTXTKEY_FRTO, " | |||
| lv_i_tablename | TYPE ESP1_TAB_NAME, " | |||
| lv_i_fieldname | TYPE ESP1_FIELD_NAME, " SPACE | |||
| lv_i_language | TYPE SY-LANGU, " | |||
| lv_i_search_string | TYPE ESP1_STRING. " |
|   CALL FUNCTION 'EHSB_SCRT_TEXT_FIND' "NOTRANSL: EHS: Suchen über die Langexte |
| EXPORTING | ||
| I_SEARCHMODE | = lv_i_searchmode | |
| I_VALDAT | = lv_i_valdat | |
| I_DATERANGE | = lv_i_daterange | |
| I_TABLENAME | = lv_i_tablename | |
| I_FIELDNAME | = lv_i_fieldname | |
| I_LANGUAGE | = lv_i_language | |
| I_SEARCH_STRING | = lv_i_search_string | |
| IMPORTING | ||
| E_NUM_FOUND | = lv_e_num_found | |
| TABLES | ||
| I_RESTRICTION_TAB | = lt_i_restriction_tab | |
| E_KEY_TAB | = lt_e_key_tab | |
| E_FRTO_KEYTAB | = lt_e_frto_keytab | |
| EXCEPTIONS | ||
| PARAMETER_ERROR = 1 | ||
| TEXT_READ_ERROR = 2 | ||
| . " EHSB_SCRT_TEXT_FIND | ||
ABAP code using 7.40 inline data declarations to call FM EHSB_SCRT_TEXT_FIND
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 TABIX FROM SY INTO @DATA(ld_e_num_found). | ||||
| "SELECT single SEARCHMODE FROM RCGSELSCR INTO @DATA(ld_i_searchmode). | ||||
| DATA(ld_i_searchmode) | = ESP1_SRCHMD_INIT. | |||
| "SELECT single VALDAT FROM RCGADDINF INTO @DATA(ld_i_valdat). | ||||
| DATA(ld_i_fieldname) | = ' '. | |||
| "SELECT single LANGU FROM SY INTO @DATA(ld_i_language). | ||||
Search for further information about these or an SAP related objects