SAP Function Modules

DD_RANGE_SEL2 SAP Function module - Universal mass accesses with symbol table and two result tables







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

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


Pattern for FM DD_RANGE_SEL2 - DD RANGE SEL2





CALL FUNCTION 'DD_RANGE_SEL2' "Universal mass accesses with symbol table and two result tables
  EXPORTING
*   delete_dups = 'X'           " ddrefstruc-bool
*   deviation = 0               " sy-tabix
*   formid = ' '                " ddrefstruc-symbol
*   length = 10                 " sy-fdpos
*   no_limit = ' '              " ddrefstruc-bool
*   offset = 0                  " sy-fdpos
*   par1 = ' '                  "
*   par2 = ' '                  "
*   par3 = ' '                  "
*   par4 = ' '                  "
*   prid = 0                    " sy-tabix
*   range_size = 64             " sy-tabix
    repid =                     " sy-repid
*   from_index = 0              " sy-tabix
*   to_index = 0                " sy-tabix
  TABLES
    result_tab1 =               "
    result_tab2 =               "
    result_tab3 =               "
    symbol_tab =                "
  EXCEPTIONS
    ILLEGAL_VALUE = 1           "
    .  "  DD_RANGE_SEL2

ABAP code example for Function Module DD_RANGE_SEL2





The ABAP code below is a full code listing to execute function module DD_RANGE_SEL2 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:
it_result_tab1  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_result_tab1  LIKE LINE OF it_result_tab1 ,
it_result_tab2  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_result_tab2  LIKE LINE OF it_result_tab2 ,
it_result_tab3  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_result_tab3  LIKE LINE OF it_result_tab3 ,
it_symbol_tab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_symbol_tab  LIKE LINE OF it_symbol_tab .


DATA(ld_delete_dups) = some text here
DATA(ld_deviation) = '123 '.

DATA(ld_formid) = some text here
DATA(ld_length) = '123 '.

DATA(ld_no_limit) = some text here
DATA(ld_offset) = '123 '.
DATA(ld_par1) = 'some text here'.
DATA(ld_par2) = 'some text here'.
DATA(ld_par3) = 'some text here'.
DATA(ld_par4) = 'some text here'.
DATA(ld_prid) = '123 '.
DATA(ld_range_size) = '123 '.
DATA(ld_repid) = '123 '.
DATA(ld_from_index) = '123 '.
DATA(ld_to_index) = '123 '.

"populate fields of struture and append to itab
append wa_result_tab1 to it_result_tab1.

"populate fields of struture and append to itab
append wa_result_tab2 to it_result_tab2.

"populate fields of struture and append to itab
append wa_result_tab3 to it_result_tab3.

"populate fields of struture and append to itab
append wa_symbol_tab to it_symbol_tab. . CALL FUNCTION 'DD_RANGE_SEL2' EXPORTING * delete_dups = ld_delete_dups * deviation = ld_deviation * formid = ld_formid * length = ld_length * no_limit = ld_no_limit * offset = ld_offset * par1 = ld_par1 * par2 = ld_par2 * par3 = ld_par3 * par4 = ld_par4 * prid = ld_prid * range_size = ld_range_size repid = ld_repid * from_index = ld_from_index * to_index = ld_to_index TABLES result_tab1 = it_result_tab1 result_tab2 = it_result_tab2 result_tab3 = it_result_tab3 symbol_tab = it_symbol_tab EXCEPTIONS ILLEGAL_VALUE = 1 . " DD_RANGE_SEL2
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_delete_dups  TYPE DDREFSTRUC-BOOL ,
it_result_tab1  TYPE STANDARD TABLE OF STRING ,
wa_result_tab1  LIKE LINE OF it_result_tab1,
ld_deviation  TYPE SY-TABIX ,
it_result_tab2  TYPE STANDARD TABLE OF STRING ,
wa_result_tab2  LIKE LINE OF it_result_tab2,
ld_formid  TYPE DDREFSTRUC-SYMBOL ,
it_result_tab3  TYPE STANDARD TABLE OF STRING ,
wa_result_tab3  LIKE LINE OF it_result_tab3,
ld_length  TYPE SY-FDPOS ,
it_symbol_tab  TYPE STANDARD TABLE OF STRING ,
wa_symbol_tab  LIKE LINE OF it_symbol_tab,
ld_no_limit  TYPE DDREFSTRUC-BOOL ,
ld_offset  TYPE SY-FDPOS ,
ld_par1  TYPE STRING ,
ld_par2  TYPE STRING ,
ld_par3  TYPE STRING ,
ld_par4  TYPE STRING ,
ld_prid  TYPE SY-TABIX ,
ld_range_size  TYPE SY-TABIX ,
ld_repid  TYPE SY-REPID ,
ld_from_index  TYPE SY-TABIX ,
ld_to_index  TYPE SY-TABIX .


ld_delete_dups = some text here

"populate fields of struture and append to itab
append wa_result_tab1 to it_result_tab1.
ld_deviation = '123 '.

"populate fields of struture and append to itab
append wa_result_tab2 to it_result_tab2.

ld_formid = some text here

"populate fields of struture and append to itab
append wa_result_tab3 to it_result_tab3.
ld_length = '123 '.

"populate fields of struture and append to itab
append wa_symbol_tab to it_symbol_tab.

ld_no_limit = some text here
ld_offset = '123 '.
ld_par1 = 'some text here'.
ld_par2 = 'some text here'.
ld_par3 = 'some text here'.
ld_par4 = 'some text here'.
ld_prid = '123 '.
ld_range_size = '123 '.
ld_repid = '123 '.
ld_from_index = '123 '.
ld_to_index = '123 '.

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