SAP Function Modules

SRET_DOCUMENTS_SEARCH_XML_NEW SAP Function module







SRET_DOCUMENTS_SEARCH_XML_NEW is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SRET_DOCUMENTS_SEARCH_XML_NEW into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SRQU
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM SRET_DOCUMENTS_SEARCH_XML_NEW - SRET DOCUMENTS SEARCH XML NEW





CALL FUNCTION 'SRET_DOCUMENTS_SEARCH_XML_NEW' "
  EXPORTING
    catid =                     " sretidcat-catid
    docuspace =                 " sdokdocsph-docuspace
  IMPORTING
    numofhits =                 " sretgstruc-numofhit
    rcode =                     " sretgstruc-rcode
    es_errorcode =              " sretserrorcode
  TABLES
    languagetab =               " sretlan2
    queryparamtab =             " sretqatr1
    xmlquerytab =               " sretqxse
*   docattrtab =                " sretatr2
    resultdoctab =              " sretresdoc
*   resultattrtab =             " sretdcatvl
  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_XML_NEW

ABAP code example for Function Module SRET_DOCUMENTS_SEARCH_XML_NEW





The ABAP code below is a full code listing to execute function module SRET_DOCUMENTS_SEARCH_XML_NEW including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_numofhits  TYPE SRETGSTRUC-NUMOFHIT ,
ld_rcode  TYPE SRETGSTRUC-RCODE ,
ld_es_errorcode  TYPE SRETSERRORCODE ,
it_languagetab  TYPE STANDARD TABLE OF SRETLAN2,"TABLES PARAM
wa_languagetab  LIKE LINE OF it_languagetab ,
it_queryparamtab  TYPE STANDARD TABLE OF SRETQATR1,"TABLES PARAM
wa_queryparamtab  LIKE LINE OF it_queryparamtab ,
it_xmlquerytab  TYPE STANDARD TABLE OF SRETQXSE,"TABLES PARAM
wa_xmlquerytab  LIKE LINE OF it_xmlquerytab ,
it_docattrtab  TYPE STANDARD TABLE OF SRETATR2,"TABLES PARAM
wa_docattrtab  LIKE LINE OF it_docattrtab ,
it_resultdoctab  TYPE STANDARD TABLE OF SRETRESDOC,"TABLES PARAM
wa_resultdoctab  LIKE LINE OF it_resultdoctab ,
it_resultattrtab  TYPE STANDARD TABLE OF SRETDCATVL,"TABLES PARAM
wa_resultattrtab  LIKE LINE OF it_resultattrtab .


SELECT single CATID
FROM SRETIDCAT
INTO @DATA(ld_catid).


SELECT single DOCUSPACE
FROM SDOKDOCSPH
INTO @DATA(ld_docuspace).


"populate fields of struture and append to itab
append wa_languagetab to it_languagetab.

"populate fields of struture and append to itab
append wa_queryparamtab to it_queryparamtab.

"populate fields of struture and append to itab
append wa_xmlquerytab to it_xmlquerytab.

"populate fields of struture and append to itab
append wa_docattrtab to it_docattrtab.

"populate fields of struture and append to itab
append wa_resultdoctab to it_resultdoctab.

"populate fields of struture and append to itab
append wa_resultattrtab to it_resultattrtab. . CALL FUNCTION 'SRET_DOCUMENTS_SEARCH_XML_NEW' EXPORTING catid = ld_catid docuspace = ld_docuspace IMPORTING numofhits = ld_numofhits rcode = ld_rcode es_errorcode = ld_es_errorcode TABLES languagetab = it_languagetab queryparamtab = it_queryparamtab xmlquerytab = it_xmlquerytab * docattrtab = it_docattrtab resultdoctab = it_resultdoctab * resultattrtab = it_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_XML_NEW
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_numofhits  TYPE SRETGSTRUC-NUMOFHIT ,
ld_catid  TYPE SRETIDCAT-CATID ,
it_languagetab  TYPE STANDARD TABLE OF SRETLAN2 ,
wa_languagetab  LIKE LINE OF it_languagetab,
ld_rcode  TYPE SRETGSTRUC-RCODE ,
ld_docuspace  TYPE SDOKDOCSPH-DOCUSPACE ,
it_queryparamtab  TYPE STANDARD TABLE OF SRETQATR1 ,
wa_queryparamtab  LIKE LINE OF it_queryparamtab,
ld_es_errorcode  TYPE SRETSERRORCODE ,
it_xmlquerytab  TYPE STANDARD TABLE OF SRETQXSE ,
wa_xmlquerytab  LIKE LINE OF it_xmlquerytab,
it_docattrtab  TYPE STANDARD TABLE OF SRETATR2 ,
wa_docattrtab  LIKE LINE OF it_docattrtab,
it_resultdoctab  TYPE STANDARD TABLE OF SRETRESDOC ,
wa_resultdoctab  LIKE LINE OF it_resultdoctab,
it_resultattrtab  TYPE STANDARD TABLE OF SRETDCATVL ,
wa_resultattrtab  LIKE LINE OF it_resultattrtab.


SELECT single CATID
FROM SRETIDCAT
INTO ld_catid.


"populate fields of struture and append to itab
append wa_languagetab to it_languagetab.

SELECT single DOCUSPACE
FROM SDOKDOCSPH
INTO ld_docuspace.


"populate fields of struture and append to itab
append wa_queryparamtab to it_queryparamtab.

"populate fields of struture and append to itab
append wa_xmlquerytab to it_xmlquerytab.

"populate fields of struture and append to itab
append wa_docattrtab to it_docattrtab.

"populate fields of struture and append to itab
append wa_resultdoctab to it_resultdoctab.

"populate fields of struture and append to itab
append wa_resultattrtab to it_resultattrtab.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SRET_DOCUMENTS_SEARCH_XML_NEW or its description.