SAP Function Modules

SRET_DOCS_LS_SYN_INSERT SAP Function module







SRET_DOCS_LS_SYN_INSERT 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_DOCS_LS_SYN_INSERT into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM SRET_DOCS_LS_SYN_INSERT - SRET DOCS LS SYN INSERT





CALL FUNCTION 'SRET_DOCS_LS_SYN_INSERT' "
  EXPORTING
    catid =                     " sretidcat-catid
*   langu =                     " sretidlaci-langu
*   laiso =                     " sretidlaci-laiso
*   client =                    " sy-mandt       Client
*   sapcodepage =               " sretgstruc-sapcp
  IMPORTING
    rcode =                     " sretgstruc-rcode  Error Code
  TABLES
    docidtab =                  " sretdocinf
    docattrtab =                " sretdcatvi
    docconttab =                " sretdoccon
    binconttab =                " sretbincon
  EXCEPTIONS
    CATID_UNKNOWN = 1           "
    NO_SSR_FOUND = 2            "
    IDXCAT_IS_INACTIVE = 3      "
    NO_DOCS_GIVEN = 4           "
    LANGU_NOT_VALID = 5         "
    CAT_HAS_NO_INDEX = 6        "
    RFC_SYS_FAILURE = 7         "
    RFC_COM_FAILURE = 8         "
    NO_RFC_DEST = 9             "
    INDEX_COULD_NOT_BE_CHANGED = 10  "
    XERROR = 11                 "               Other Error
    .  "  SRET_DOCS_LS_SYN_INSERT

ABAP code example for Function Module SRET_DOCS_LS_SYN_INSERT





The ABAP code below is a full code listing to execute function module SRET_DOCS_LS_SYN_INSERT 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_rcode  TYPE SRETGSTRUC-RCODE ,
it_docidtab  TYPE STANDARD TABLE OF SRETDOCINF,"TABLES PARAM
wa_docidtab  LIKE LINE OF it_docidtab ,
it_docattrtab  TYPE STANDARD TABLE OF SRETDCATVI,"TABLES PARAM
wa_docattrtab  LIKE LINE OF it_docattrtab ,
it_docconttab  TYPE STANDARD TABLE OF SRETDOCCON,"TABLES PARAM
wa_docconttab  LIKE LINE OF it_docconttab ,
it_binconttab  TYPE STANDARD TABLE OF SRETBINCON,"TABLES PARAM
wa_binconttab  LIKE LINE OF it_binconttab .


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


SELECT single LANGU
FROM SRETIDLACI
INTO @DATA(ld_langu).


SELECT single LAISO
FROM SRETIDLACI
INTO @DATA(ld_laiso).

DATA(ld_client) = 'Check type of data required'.

DATA(ld_sapcodepage) = Check type of data required

"populate fields of struture and append to itab
append wa_docidtab to it_docidtab.

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

"populate fields of struture and append to itab
append wa_docconttab to it_docconttab.

"populate fields of struture and append to itab
append wa_binconttab to it_binconttab. . CALL FUNCTION 'SRET_DOCS_LS_SYN_INSERT' EXPORTING catid = ld_catid * langu = ld_langu * laiso = ld_laiso * client = ld_client * sapcodepage = ld_sapcodepage IMPORTING rcode = ld_rcode TABLES docidtab = it_docidtab docattrtab = it_docattrtab docconttab = it_docconttab binconttab = it_binconttab EXCEPTIONS CATID_UNKNOWN = 1 NO_SSR_FOUND = 2 IDXCAT_IS_INACTIVE = 3 NO_DOCS_GIVEN = 4 LANGU_NOT_VALID = 5 CAT_HAS_NO_INDEX = 6 RFC_SYS_FAILURE = 7 RFC_COM_FAILURE = 8 NO_RFC_DEST = 9 INDEX_COULD_NOT_BE_CHANGED = 10 XERROR = 11 . " SRET_DOCS_LS_SYN_INSERT
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 ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "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_rcode  TYPE SRETGSTRUC-RCODE ,
ld_catid  TYPE SRETIDCAT-CATID ,
it_docidtab  TYPE STANDARD TABLE OF SRETDOCINF ,
wa_docidtab  LIKE LINE OF it_docidtab,
ld_langu  TYPE SRETIDLACI-LANGU ,
it_docattrtab  TYPE STANDARD TABLE OF SRETDCATVI ,
wa_docattrtab  LIKE LINE OF it_docattrtab,
ld_laiso  TYPE SRETIDLACI-LAISO ,
it_docconttab  TYPE STANDARD TABLE OF SRETDOCCON ,
wa_docconttab  LIKE LINE OF it_docconttab,
ld_client  TYPE SY-MANDT ,
it_binconttab  TYPE STANDARD TABLE OF SRETBINCON ,
wa_binconttab  LIKE LINE OF it_binconttab,
ld_sapcodepage  TYPE SRETGSTRUC-SAPCP .


SELECT single CATID
FROM SRETIDCAT
INTO ld_catid.


"populate fields of struture and append to itab
append wa_docidtab to it_docidtab.

SELECT single LANGU
FROM SRETIDLACI
INTO ld_langu.


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

SELECT single LAISO
FROM SRETIDLACI
INTO ld_laiso.


"populate fields of struture and append to itab
append wa_docconttab to it_docconttab.
ld_client = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_binconttab to it_binconttab.

ld_sapcodepage = Check type of data required

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_DOCS_LS_SYN_INSERT or its description.