SAP Function Modules

RS_DS_INT_INIT_LDB SAP Function module







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

Associated Function Group: SSEL
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM RS_DS_INT_INIT_LDB - RS DS INT INIT LDB





CALL FUNCTION 'RS_DS_INT_INIT_LDB' "
  EXPORTING
*   p_ldbname =                 " ldbd-ldbname
    p_texpr =                   " rsds_texpr    Must(!) have type RSDS_TEXPR!!
*   p_submode =                 "
*   p_ldbpg =                   " syldbpg       ABAP program, logical database program
  IMPORTING
    p_twhere =                  " rsds_twhere   Must(!) have type RSDS_WHERE!!
    p_selid =                   " rsdynsel-selid
    p_texpr =                   " rsds_texpr    Must(!) have type RSDS_TEXPR!!
    p_actnum =                  " sy-tfill
    p_trange =                  " rsds_trange
  TABLES
*   p_nodes =                   " rsdfsnodes
    p_fields =                  " rsdsfields    Preselected fields
*   p_varidyn =                 " rsvaridyn
  EXCEPTIONS
    NO_TABLES = 1               "               Table P_TABLES is empty
    TABLE_NOT_FOUND = 2         "               A table from P_TABLES was not found
    EXPRESSION_NOT_SUPPORTED = 3  "             Expression (previously) not supported
    INCORRECT_EXPRESSION = 4    "               Incorrect logical expression
    FIELD_NOT_FOUND = 5         "               Field does not exist in Dictionary
    INCONSISTENT_AREA = 6       "               Inconsistent functional area
    ILLEGAL_LDB = 7             "
    .  "  RS_DS_INT_INIT_LDB

ABAP code example for Function Module RS_DS_INT_INIT_LDB





The ABAP code below is a full code listing to execute function module RS_DS_INT_INIT_LDB 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_p_twhere  TYPE RSDS_TWHERE ,
ld_p_selid  TYPE RSDYNSEL-SELID ,
ld_p_texpr  TYPE RSDS_TEXPR ,
ld_p_actnum  TYPE SY-TFILL ,
ld_p_trange  TYPE RSDS_TRANGE ,
it_p_nodes  TYPE STANDARD TABLE OF RSDFSNODES,"TABLES PARAM
wa_p_nodes  LIKE LINE OF it_p_nodes ,
it_p_fields  TYPE STANDARD TABLE OF RSDSFIELDS,"TABLES PARAM
wa_p_fields  LIKE LINE OF it_p_fields ,
it_p_varidyn  TYPE STANDARD TABLE OF RSVARIDYN,"TABLES PARAM
wa_p_varidyn  LIKE LINE OF it_p_varidyn .


SELECT single LDBNAME
FROM LDBD
INTO @DATA(ld_p_ldbname).

DATA(ld_p_texpr) = 'Check type of data required'.
DATA(ld_p_submode) = 'some text here'.
DATA(ld_p_ldbpg) = 'some text here'.

"populate fields of struture and append to itab
append wa_p_nodes to it_p_nodes.

"populate fields of struture and append to itab
append wa_p_fields to it_p_fields.

"populate fields of struture and append to itab
append wa_p_varidyn to it_p_varidyn. . CALL FUNCTION 'RS_DS_INT_INIT_LDB' EXPORTING * p_ldbname = ld_p_ldbname p_texpr = ld_p_texpr * p_submode = ld_p_submode * p_ldbpg = ld_p_ldbpg IMPORTING p_twhere = ld_p_twhere p_selid = ld_p_selid p_texpr = ld_p_texpr p_actnum = ld_p_actnum p_trange = ld_p_trange TABLES * p_nodes = it_p_nodes p_fields = it_p_fields * p_varidyn = it_p_varidyn EXCEPTIONS NO_TABLES = 1 TABLE_NOT_FOUND = 2 EXPRESSION_NOT_SUPPORTED = 3 INCORRECT_EXPRESSION = 4 FIELD_NOT_FOUND = 5 INCONSISTENT_AREA = 6 ILLEGAL_LDB = 7 . " RS_DS_INT_INIT_LDB
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 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_p_twhere  TYPE RSDS_TWHERE ,
ld_p_ldbname  TYPE LDBD-LDBNAME ,
it_p_nodes  TYPE STANDARD TABLE OF RSDFSNODES ,
wa_p_nodes  LIKE LINE OF it_p_nodes,
ld_p_selid  TYPE RSDYNSEL-SELID ,
ld_p_texpr  TYPE RSDS_TEXPR ,
it_p_fields  TYPE STANDARD TABLE OF RSDSFIELDS ,
wa_p_fields  LIKE LINE OF it_p_fields,
ld_p_texpr  TYPE RSDS_TEXPR ,
ld_p_submode  TYPE STRING ,
it_p_varidyn  TYPE STANDARD TABLE OF RSVARIDYN ,
wa_p_varidyn  LIKE LINE OF it_p_varidyn,
ld_p_actnum  TYPE SY-TFILL ,
ld_p_ldbpg  TYPE SYLDBPG ,
ld_p_trange  TYPE RSDS_TRANGE .


SELECT single LDBNAME
FROM LDBD
INTO ld_p_ldbname.


"populate fields of struture and append to itab
append wa_p_nodes to it_p_nodes.
ld_p_texpr = 'some text here'.

"populate fields of struture and append to itab
append wa_p_fields to it_p_fields.
ld_p_submode = 'some text here'.

"populate fields of struture and append to itab
append wa_p_varidyn to it_p_varidyn.
ld_p_ldbpg = 'some text here'.

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