cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Function Module - 'RSDRI_INFOPROV_READ' - Returns SY-SUBRC = 11

0 Kudos
2,335

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_TH_SFC - This internal table contains the list of characteristics / navigation attributes to be returned. Please note that CHAALIAS is the name of the return column (E_T_DATA) for the characteristic values ! If this does not match the program terminates (with sy-subrc=11).

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

FCI
Active Contributor
0 Kudos

I'm not so sure you can use this FM to read a BPC cube.

Maybe you can have a look to the method run_rsdri_query. See an example here.

Regards,

Frederic

former_member231709
Active Contributor
0 Kudos

If you read data from multiprovider try to restrict characteristics 0INFOPROV with needed cube/DSO. For example:

g_s_range-chanm = '0INFOPROV'. 
g_s_range-sign = rs_c_range_sign-including. 
g_s_range-compop = rs_c_range_opt-equal. 
g_s_range-low = 'ZCUBE'. 
APPEND g_s_range TO g_t_range.
0 Kudos

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.
DoanManhQuynh
Active Contributor
0 Kudos

Look at message class DBMAN, message ID 305, and it say: Error reading the data of InfoProvider ZBPC_HC03. Can you display that cube data with the same conditions in RSA1?

PS: please use code format to post your code, it would be easier to read.

FCI
Active Contributor
0 Kudos

Hi Senthil,

Did you check the point 9 of the given link ?

Regards,

Frederic