SAP SRET_DOCUMENTS_SEARCH Function Module for
SRET_DOCUMENTS_SEARCH is a standard sret documents 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 sret documents search FM, simply by entering the name SRET_DOCUMENTS_SEARCH into the relevant SAP transaction such as SE37 or SE38.
Function Group: SRQU
Program Name: SAPLSRQU
Main Program: SAPLSRQU
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function SRET_DOCUMENTS_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 'SRET_DOCUMENTS_SEARCH'".
EXPORTING
CATID = "Key of index category
* STRICTCHECK = "
* ALLATTRBACK = 'X' "
* DOCU' ' = ' ' "
IMPORTING
NUMOFHITS = "Number of Hits
RCODE = "Error Number
ES_ERRORCODE = "
TABLES
LANGUAGETAB = "
QUERYPARAMTAB = "
QUERYTAB = "
TERMATTRTAB = "
* DOCATTRTAB = "
RESULTDOCTAB = "Search Result
* RESULTATTRTAB = "
EXCEPTIONS
CADID_UNKNOWN = 1 INTERN_ERROR = 2 PARAMETER_ERROR = 3 LANGUAGE_ERROR = 4 ATTRIBUTE_ERROR = 5 RFC_SYS_FAILURE = 6 RFC_COM_FAILURE = 7 NO_RFC_DEST = 8 XERROR = 9
IMPORTING Parameters details for SRET_DOCUMENTS_SEARCH
CATID - Key of index category
Data type: SRETIDCAT-CATIDOptional: No
Call by Reference: No ( called with pass by value option)
STRICTCHECK -
Data type: SRETGSTRUC-FLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
ALLATTRBACK -
Data type: SRETGSTRUC-FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DOCUSPACE -
Data type: SDOKDOCSPH-DOCUSPACEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SRET_DOCUMENTS_SEARCH
NUMOFHITS - Number of Hits
Data type: SRETGSTRUC-NUMOFHITOptional: No
Call by Reference: No ( called with pass by value option)
RCODE - Error Number
Data type: SRETGSTRUC-RCODEOptional: No
Call by Reference: No ( called with pass by value option)
ES_ERRORCODE -
Data type: SRETSERRORCODEOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SRET_DOCUMENTS_SEARCH
LANGUAGETAB -
Data type: SRETLAN2Optional: No
Call by Reference: Yes
QUERYPARAMTAB -
Data type: SRETQATR1Optional: No
Call by Reference: Yes
QUERYTAB -
Data type: SRETQYSEOptional: No
Call by Reference: Yes
TERMATTRTAB -
Data type: SRETTERATROptional: No
Call by Reference: Yes
DOCATTRTAB -
Data type: SRETATR2Optional: Yes
Call by Reference: Yes
RESULTDOCTAB - Search Result
Data type: SRETRESDOCOptional: No
Call by Reference: Yes
RESULTATTRTAB -
Data type: SRETDCATVLOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
CADID_UNKNOWN -
Data type:Optional: No
Call by Reference: Yes
INTERN_ERROR -
Data type:Optional: No
Call by Reference: Yes
PARAMETER_ERROR -
Data type:Optional: No
Call by Reference: Yes
LANGUAGE_ERROR -
Data type:Optional: No
Call by Reference: Yes
ATTRIBUTE_ERROR -
Data type:Optional: No
Call by Reference: Yes
RFC_SYS_FAILURE -
Data type:Optional: No
Call by Reference: Yes
RFC_COM_FAILURE -
Data type:Optional: No
Call by Reference: Yes
NO_RFC_DEST -
Data type:Optional: No
Call by Reference: Yes
XERROR - Other Error
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SRET_DOCUMENTS_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_catid | TYPE SRETIDCAT-CATID, " | |||
| lv_numofhits | TYPE SRETGSTRUC-NUMOFHIT, " | |||
| lt_languagetab | TYPE STANDARD TABLE OF SRETLAN2, " | |||
| lv_cadid_unknown | TYPE SRETLAN2, " | |||
| lv_rcode | TYPE SRETGSTRUC-RCODE, " | |||
| lv_strictcheck | TYPE SRETGSTRUC-FLAG, " | |||
| lv_intern_error | TYPE SRETGSTRUC, " | |||
| lt_queryparamtab | TYPE STANDARD TABLE OF SRETQATR1, " | |||
| lt_querytab | TYPE STANDARD TABLE OF SRETQYSE, " | |||
| lv_allattrback | TYPE SRETGSTRUC-FLAG, " 'X' | |||
| lv_es_errorcode | TYPE SRETSERRORCODE, " | |||
| lv_parameter_error | TYPE SRETSERRORCODE, " | |||
| lv_docuspace | TYPE SDOKDOCSPH-DOCUSPACE, " SPACE | |||
| lt_termattrtab | TYPE STANDARD TABLE OF SRETTERATR, " | |||
| lv_language_error | TYPE SRETTERATR, " | |||
| lt_docattrtab | TYPE STANDARD TABLE OF SRETATR2, " | |||
| lv_attribute_error | TYPE SRETATR2, " | |||
| lt_resultdoctab | TYPE STANDARD TABLE OF SRETRESDOC, " | |||
| lv_rfc_sys_failure | TYPE SRETRESDOC, " | |||
| lt_resultattrtab | TYPE STANDARD TABLE OF SRETDCATVL, " | |||
| lv_rfc_com_failure | TYPE SRETDCATVL, " | |||
| lv_no_rfc_dest | TYPE SRETDCATVL, " | |||
| lv_xerror | TYPE SRETDCATVL. " |
|   CALL FUNCTION 'SRET_DOCUMENTS_SEARCH' " |
| EXPORTING | ||
| CATID | = lv_catid | |
| STRICTCHECK | = lv_strictcheck | |
| ALLATTRBACK | = lv_allattrback | |
| DOCUSPACE | = lv_docuspace | |
| IMPORTING | ||
| NUMOFHITS | = lv_numofhits | |
| RCODE | = lv_rcode | |
| ES_ERRORCODE | = lv_es_errorcode | |
| TABLES | ||
| LANGUAGETAB | = lt_languagetab | |
| QUERYPARAMTAB | = lt_queryparamtab | |
| QUERYTAB | = lt_querytab | |
| TERMATTRTAB | = lt_termattrtab | |
| DOCATTRTAB | = lt_docattrtab | |
| RESULTDOCTAB | = lt_resultdoctab | |
| RESULTATTRTAB | = lt_resultattrtab | |
| EXCEPTIONS | ||
| CADID_UNKNOWN = 1 | ||
| INTERN_ERROR = 2 | ||
| PARAMETER_ERROR = 3 | ||
| LANGUAGE_ERROR = 4 | ||
| ATTRIBUTE_ERROR = 5 | ||
| RFC_SYS_FAILURE = 6 | ||
| RFC_COM_FAILURE = 7 | ||
| NO_RFC_DEST = 8 | ||
| XERROR = 9 | ||
| . " SRET_DOCUMENTS_SEARCH | ||
ABAP code using 7.40 inline data declarations to call FM SRET_DOCUMENTS_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.| "SELECT single CATID FROM SRETIDCAT INTO @DATA(ld_catid). | ||||
| "SELECT single NUMOFHIT FROM SRETGSTRUC INTO @DATA(ld_numofhits). | ||||
| "SELECT single RCODE FROM SRETGSTRUC INTO @DATA(ld_rcode). | ||||
| "SELECT single FLAG FROM SRETGSTRUC INTO @DATA(ld_strictcheck). | ||||
| "SELECT single FLAG FROM SRETGSTRUC INTO @DATA(ld_allattrback). | ||||
| DATA(ld_allattrback) | = 'X'. | |||
| "SELECT single DOCU' ' FROM SDOKDOCSPH INTO @DATA(ld_docuspace). | ||||
| DATA(ld_docuspace) | = ' '. | |||
Search for further information about these or an SAP related objects