SAP Function Modules

UCR_DATA_READ_2 SAP Function module







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

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


Pattern for FM UCR_DATA_READ_2 - UCR DATA READ 2





CALL FUNCTION 'UCR_DATA_READ_2' "
  EXPORTING
*   i_packagesize = 1000        " i
    i_first_call =              " uc_flg        General Indicator for SAP Consolidation
    i_infoprov =                " rsinfocube    InfoCube
    i_rfcdest =                 " rfcdest       Logical Destination (Specified when Calling Function)
*   i_keydate = SY-DATUM        " sy-datum      Date and Time, Current (Application Server) Date
  IMPORTING
    e_xstring =                 " xstring
    e_end_of_data =             " uc_flg        General Indicator for SAP Consolidation
    c_first_call =              " uc_flg        General Indicator for SAP Consolidation
* TABLES
*   it_seltype =                " ucr_t_bw_seltype  Type of Selection per Row/Column
*   it_hienode =                " ucr_t_bw_hienode  Node Selection per Row/Column
*   it_hienodename =            " ucr_t_bw_hienodename  Node Selection per Row/Column -> Char.Values
*   it_range =                  " ucr_t_bw_range  Selection Range per Row/Column
*   it_sfc =                    " ucr_t_bw_iobj  List of InfoObjects
*   it_sfk =                    " ucr_t_bw_iobj  List of InfoObjects
*   et_message =                " ucr_t_bw_message  Messages
    .  "  UCR_DATA_READ_2

ABAP code example for Function Module UCR_DATA_READ_2





The ABAP code below is a full code listing to execute function module UCR_DATA_READ_2 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_e_xstring  TYPE XSTRING ,
ld_e_end_of_data  TYPE UC_FLG ,
ld_c_first_call  TYPE UC_FLG ,
it_it_seltype  TYPE STANDARD TABLE OF UCR_T_BW_SELTYPE,"TABLES PARAM
wa_it_seltype  LIKE LINE OF it_it_seltype ,
it_it_hienode  TYPE STANDARD TABLE OF UCR_T_BW_HIENODE,"TABLES PARAM
wa_it_hienode  LIKE LINE OF it_it_hienode ,
it_it_hienodename  TYPE STANDARD TABLE OF UCR_T_BW_HIENODENAME,"TABLES PARAM
wa_it_hienodename  LIKE LINE OF it_it_hienodename ,
it_it_range  TYPE STANDARD TABLE OF UCR_T_BW_RANGE,"TABLES PARAM
wa_it_range  LIKE LINE OF it_it_range ,
it_it_sfc  TYPE STANDARD TABLE OF UCR_T_BW_IOBJ,"TABLES PARAM
wa_it_sfc  LIKE LINE OF it_it_sfc ,
it_it_sfk  TYPE STANDARD TABLE OF UCR_T_BW_IOBJ,"TABLES PARAM
wa_it_sfk  LIKE LINE OF it_it_sfk ,
it_et_message  TYPE STANDARD TABLE OF UCR_T_BW_MESSAGE,"TABLES PARAM
wa_et_message  LIKE LINE OF it_et_message .

DATA(ld_i_packagesize) = 'Check type of data required'.
DATA(ld_i_first_call) = 'Check type of data required'.
DATA(ld_i_infoprov) = 'Check type of data required'.
DATA(ld_i_rfcdest) = 'Check type of data required'.
DATA(ld_i_keydate) = '20210129'.

"populate fields of struture and append to itab
append wa_it_seltype to it_it_seltype.

"populate fields of struture and append to itab
append wa_it_hienode to it_it_hienode.

"populate fields of struture and append to itab
append wa_it_hienodename to it_it_hienodename.

"populate fields of struture and append to itab
append wa_it_range to it_it_range.

"populate fields of struture and append to itab
append wa_it_sfc to it_it_sfc.

"populate fields of struture and append to itab
append wa_it_sfk to it_it_sfk.

"populate fields of struture and append to itab
append wa_et_message to it_et_message. . CALL FUNCTION 'UCR_DATA_READ_2' EXPORTING * i_packagesize = ld_i_packagesize i_first_call = ld_i_first_call i_infoprov = ld_i_infoprov i_rfcdest = ld_i_rfcdest * i_keydate = ld_i_keydate IMPORTING e_xstring = ld_e_xstring e_end_of_data = ld_e_end_of_data c_first_call = ld_c_first_call * TABLES * it_seltype = it_it_seltype * it_hienode = it_it_hienode * it_hienodename = it_it_hienodename * it_range = it_it_range * it_sfc = it_it_sfc * it_sfk = it_it_sfk * et_message = it_et_message . " UCR_DATA_READ_2
IF SY-SUBRC EQ 0. "All OK 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_e_xstring  TYPE XSTRING ,
ld_i_packagesize  TYPE I ,
it_it_seltype  TYPE STANDARD TABLE OF UCR_T_BW_SELTYPE ,
wa_it_seltype  LIKE LINE OF it_it_seltype,
ld_e_end_of_data  TYPE UC_FLG ,
ld_i_first_call  TYPE UC_FLG ,
it_it_hienode  TYPE STANDARD TABLE OF UCR_T_BW_HIENODE ,
wa_it_hienode  LIKE LINE OF it_it_hienode,
ld_c_first_call  TYPE UC_FLG ,
ld_i_infoprov  TYPE RSINFOCUBE ,
it_it_hienodename  TYPE STANDARD TABLE OF UCR_T_BW_HIENODENAME ,
wa_it_hienodename  LIKE LINE OF it_it_hienodename,
ld_i_rfcdest  TYPE RFCDEST ,
it_it_range  TYPE STANDARD TABLE OF UCR_T_BW_RANGE ,
wa_it_range  LIKE LINE OF it_it_range,
ld_i_keydate  TYPE SY-DATUM ,
it_it_sfc  TYPE STANDARD TABLE OF UCR_T_BW_IOBJ ,
wa_it_sfc  LIKE LINE OF it_it_sfc,
it_it_sfk  TYPE STANDARD TABLE OF UCR_T_BW_IOBJ ,
wa_it_sfk  LIKE LINE OF it_it_sfk,
it_et_message  TYPE STANDARD TABLE OF UCR_T_BW_MESSAGE ,
wa_et_message  LIKE LINE OF it_et_message.

ld_i_packagesize = '20210129'.

"populate fields of struture and append to itab
append wa_it_seltype to it_it_seltype.
ld_i_first_call = '20210129'.

"populate fields of struture and append to itab
append wa_it_hienode to it_it_hienode.
ld_i_infoprov = '20210129'.

"populate fields of struture and append to itab
append wa_it_hienodename to it_it_hienodename.
ld_i_rfcdest = '20210129'.

"populate fields of struture and append to itab
append wa_it_range to it_it_range.
ld_i_keydate = '20210129'.

"populate fields of struture and append to itab
append wa_it_sfc to it_it_sfc.

"populate fields of struture and append to itab
append wa_it_sfk to it_it_sfk.

"populate fields of struture and append to itab
append wa_et_message to it_et_message.

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