Hi,
I am using the function module RSDRI_INFOPROV_READ to read the data from transactional cube.
I am using the below code but data is not getting retrived.
The FM is not getting triggred in the while loop
WHILE v_end_of_data = rs_c_false.
System is not recognizing the rs_c_false and rs_c_true, if is put in the comments 'rs_c_false' it is accepting but the FM is not triggering and v_end_of_data is type TYPE rs_bool so it is accepting the singlecharacter because of this the FM is not geting triggred.
Here is the code i am using
TYPES: BEGIN OF t_s_data,
tmp_ZMKTSPED type /BIC/OIZMKTSPED,
tmp_Z_MKSRATE type /BIC/OIZ_MKSRATE
tmp_FISCYEAR(4) type C,
End of t_s_data.
DATA: i_t_data TYPE STANDARD TABLE OF t_s_data WITH HEADER LINE,
i_t_data2 TYPE STANDARD TABLE OF t_s_data WITH HEADER LINE,
i_th_sfc TYPE rsdri_th_sfc,
i_th_sfk TYPE rsdri_th_sfk,
wa_s_sfc TYPE rsdri_s_sfc,
wa_s_sfk TYPE rsdri_s_sfk,
wa_s_range TYPE rsdri_s_range,
i_t_range TYPE rsdri_t_range,
i_td_range TYPE rsdri_t_range,
v_first_call TYPE rs_bool,
v_end_of_data TYPE rs_bool.
Characteristics
wa_s_sfc-chanm = 'ZMKTSPED'. "name of characteristic
wa_s_sfc-chaalias = 'tmp_ZMKTSPED'. "column in G_T_DATA
wa_s_sfc-orderby = 0. " order by
INSERT wa_s_sfc INTO TABLE i_th_sfc.
Characteristics
wa_s_sfc-chanm = '0FISCYEAR'. "name of characteristic
wa_s_sfc-chaalias = 'tmp_FISCYEAR'. "column in G_T_DATA
wa_s_sfc-orderby = 0. " order by
INSERT wa_s_sfc INTO TABLE i_th_sfc.
Key Figures.
wa_s_sfk-kyfnm = 'Z_MKSRATE'. "Name of key figure
wa_s_sfk-kyfalias = 'tmp_Z_MKSRATE'. "Column heading
wa_s_sfk-aggr = 'SUM'. "Aggregation
INSERT wa_s_sfk INTO TABLE i_th_sfk.
First call indicator. Must be set to true.
v_first_call = rs_c_true.
End of data flag. Must be set to false.
v_end_of_data = rs_c_false.
REFRESH i_t_range.
End of data flag. Must be set to false.
v_end_of_data = rs_c_false.
REFRESH i_t_range.
CLEAR wa_s_range.
Select all data in cube that is equal to Fiscal year 2007
wa_s_range-chanm = '0FISCYEAR'. "Name Of Characteristic
wa_s_range-sign = 'I'. "Include
wa_s_range-compop = 'EQ'. "Operator
wa_s_range-low = '2007'.
APPEND wa_s_range TO i_td_range.
The call to this function module must be performed within a loop
while the v_end_of_data flag is 'false' because the number of records
returned is based on the 'packagesize' parameter. Once all records
have been extracted, The function sets v_end_of_data to 'true' and
the loop is terminated.
WHILE v_end_of_data = rs_c_false.
REFRESH i_t_data2.
CALL FUNCTION 'RSDRI_INFOPROV_READ'
EXPORTING
i_infoprov = 'ZCPN_C08' "Info Cube Name
i_th_sfc = i_th_sfc "Characteristics Table
i_th_sfk = i_th_sfk "Key Figures Table
i_t_range = i_t_range "Range Filter Table
i_use_db_aggregation = rs_c_false "Default True
i_currency_conversion = rs_c_false "Default True
i_packagesize = 10000 "Default 1000
IMPORTING
e_t_data = i_t_data2[] "RESULT File
e_end_of_data = v_end_of_data "End Of Data Flag
CHANGING
c_first_call = v_first_call "First Call Ind.
EXCEPTIONS
illegal_input = 1
illegal_input_sfc = 2
illegal_input_sfk = 3
illegal_input_range = 4
illegal_input_tablesel = 5
no_authorization = 6
ncum_not_supported = 7
illegal_download = 8
illegal_tablename = 9
OTHERS = 11.
IF sy-subrc = 0.
LOOP AT i_t_data2.
MOVE-CORRESPONDING i_t_data2 TO i_t_data.
APPEND i_t_data.
ENDLOOP.
ENDIF.
ENDWHILE.
Please suggest if i am missing something. I did the debug also i couldn't find out exact cause of the error.
Thanks
Best regards
SG