on 2019 Mar 28 3:16 PM
Hello SAP Experts,
I am trying to read data from a BW standard cube using the function module
'RSDRI_INFOPROV_READ'
. I am getting the SY_SUBRC =11 error. I don't know what is wrong with the code. I referred the KBA
https://wiki.scn.sap.com/wiki/display/BI/OT-DBIF-RSDRI_INFOPROV_READ
and also the demo program
RSDRI_INFOPROV_READ_DEMO
and for the SY-SUBRC = 11 says
I gave the names correctly.
Can you guys check if I am missing anything. The code is below.
TYPE-POOLS: rs, rsdrc.
TYPES:
BEGIN OF gt_s_data,
zbpc_emp2(10) TYPE c,
zbpc_title(32) TYPE c,
0comp_code(4) TYPE c,
zrxstatus(20) TYPE c,
zbpc_init(32) TYPE c,
zbpc_site(32) TYPE c,
zbpc_fiwk(6) TYPE c,
0costcenter(10) TYPE c,
END OF gt_s_data.
g_s_data TYPE gt_s_data,
g_t_data TYPE STANDARD TABLE OF gt_s_data
WITH DEFAULT KEY INITIAL SIZE 10,
g_s_sfc TYPE rsdri_s_sfc,
g_th_sfc TYPE rsdri_th_sfc,
g_s_sfk TYPE rsdri_s_sfk,
g_th_sfk TYPE rsdri_th_sfk,
g_s_range_rfc TYPE rsdri_s_range_rfc,
g_t_range_rfc TYPE rsdri_t_range_rfc,
g_s_range TYPE rsdri_s_range,
g_t_range TYPE rsdri_t_range.
CLEAR g_th_sfc.
* zbpc_emp2
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = 'ZBPC_EMP2'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = 'ZBPC_EMP2'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* zbpc_title
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = 'ZBPC_TITLE'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = 'ZBPC_TITLE'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0comp_code
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0COMP_CODE'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = '0COMP_CODE'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* zrxstatus
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = 'ZRXSTATUS'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = 'ZRXSTATUS'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* zbpc_emp2
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = 'ZBPC_INIT'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = 'ZBPC_INIT'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* zbpc_title
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = 'ZBPC_SITE'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = 'ZBPC_SITE'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0comp_code
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = 'ZBPC_FIWK'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = 'ZBPC_FIWK'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* zrxstatus
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0COSTCENTER'.
* --- name of corresponding column in G_T_DATA
g_s_sfc-chaalias = '0COSTCENTER'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* For the following key figures should be returned:
* 0INVCD_CST, 0INVCD_VAL
CLEAR g_th_sfk.
* 0INVCD_CST
CLEAR g_s_sfk.
* --- name of key figure
g_s_sfk-kyfnm = 'ZCOUNT'.
* --- name of corresponding column in G_T_DATA
g_s_sfk-kyfalias = 'ZCOUNT'.
* --- aggregation
g_s_sfk-aggr = 'SUM'.
* --- include into list of key figures
INSERT g_s_sfk INTO TABLE g_th_sfk.
* 0INVCD_VAL
CLEAR g_s_sfk.
* --- name of key figure
g_s_sfk-kyfnm = '0AMOUNT'.
* --- name of corresponding column in G_T_DATA
g_s_sfk-kyfalias = '0AMOUNT'.
* --- aggregation
g_s_sfk-aggr = 'SUM'.
* --- include into list of key figures
INSERT g_s_sfk INTO TABLE g_th_sfk.
CLEAR g_t_range.
CLEAR g_s_range.
* --- name of the characteristic
g_s_range-chanm = 'ZBPC_FIWK'.
* --- including or excluding condition ?
g_s_range-sign = rs_c_range_sign-including.
* --- comparison operator
g_s_range-compop = rs_c_range_opt-between.
* --- low value
g_s_range-low = '201901'.
* --- high value
g_s_range-high = '201952'.
* --- include into list of restrictions
APPEND g_s_range TO g_t_range.
CLEAR g_s_range.
* --- name of the characteristic
g_s_range-chanm = '0COMP_CODE'.
* --- including or excluding condition ?
g_s_range-sign = rs_c_range_sign-including.
* --- comparison operator
g_s_range-compop = rs_c_range_opt-equal.
* --- low value
g_s_range-low = '2100'.
* --- include into list of restrictions
APPEND g_s_range TO g_t_range.
DATA: g_end_of_data TYPE rs_bool,
g_first_call TYPE rs_bool.
* --- this variable will be set to TRUE when the last data
* package is read
g_end_of_data = rs_c_false.
* --- this variable indicates whether this is an initial
* call to the reading module or a follow-up call (which
* simply retrieves already selected data)
g_first_call = rs_c_true.
WHILE g_end_of_data = rs_c_false.
CALL FUNCTION 'RSDRI_INFOPROV_READ'
EXPORTING
i_infoprov = 'ZBPC_HC03'
i_th_sfc = g_th_sfc
i_th_sfk = g_th_sfk
i_t_range = g_t_range
i_reference_date = sy-datum
i_save_in_table = rs_c_false
i_save_in_file = rs_c_false
i_packagesize = 10
i_authority_check = rsdrc_c_authchk-read
* i_debug = 'X'
IMPORTING
e_t_data = g_t_data
e_end_of_data = g_end_of_data
CHANGING
c_first_call = g_first_call
EXCEPTIONS
illegal_input = 1
illegal_input_sfc = 2
illegal_input_sfk = 3
illegal_input_range = 4
illegal_input_tablesel = 5
no_authorization = 6
illegal_download = 8
illegal_tablename = 9
OTHERS = 11.
IF sy-subrc <> 0.
BREAK-POINT. "#EC NOBREAK
EXIT.
ENDIF.
* for the sake of the example: print returned data
PERFORM print_result.
ENDWHILE.
*---------------------------------------------------------------------*
* FORM print_result
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
FORM print_result.
LOOP AT g_t_data INTO g_s_data.
WRITE: / g_s_data-zbpc_emp2,
g_s_data-zbpc_title,
g_s_data-0comp_code,
g_s_data-zbpc_init,
g_s_data-zbpc_site.
ENDLOOP.
ENDFORM.
Request clarification before answering.
Thanks Frederic. This was very useful tip. Now I captured the error message
E DBMAN 305 ZBPC_HC03$X
and it points to the cube . Any idea what this error message means ? Thanks again.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
50 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.