on 09-17-2015 11:32 AM
Hi,
I have a problem with FM 'RSDRI_INFOPROV_READ' , the parameter i_rollup_only. As I understand it this parameter decides whether compressed or none-compressed request should be included in the call.
The problem is that some requests in my cube are compressed and some are not. I’ve created a function module that calls this FM and in the result I want none-compressed results, but if there are no none-compressed results I want to get the compressed results.
According to SDN the variable I_ROLLUP_ONLY should be used to make one lookup for the compressed values and one for the none-compressed values… That is, I will have to call the FM twice, but that is fine. The issue is that no matter how I do, I can NOT collect only the none-compressed values, even in a test scenario.
FORM get_all_data_from_infocube CHANGING g_s_ZPY_P01.
TYPE-POOLS: rs, rsdrc.
DATA:
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 TYPE rsdri_s_range,
g_t_range TYPE rsdri_t_range.
DATA: g_end_of_data TYPE rs_bool,
g_first_call TYPE rs_bool.
* For the following characteristics / navigational attributes values
* should be returned:
CLEAR g_th_sfc.
* VERSION
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0VERSION'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0VERSION'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0EMPLOYEE
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0EMPLOYEE'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0EMPLOYEE'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0COSTCENTER
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0COSTCENTER'.
* --- name of corresponding column in g_s_ZPY_P01
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.
* 0FISCPER3
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0FISCPER3'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0FISCPER3'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0FISCYEAR
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0FISCYEAR'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0FISCYEAR'.
* --- 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:
CLEAR g_th_sfk.
* 0AMOUNT / Beløb
CLEAR g_s_sfk.
* --- name of key figure
g_s_sfk-kyfnm = '0AMOUNT'.
* --- name of corresponding column in g_s_ZPY_P01
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.
* The reading module is called:
* --- 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 = 'ZPY_P01'
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_rollup_only = ' '
i_packagesize = 1000000
* i_authority_check = rsdrc_c_authchk-read
i_authority_check = rsdrc_c_authchk-none
IMPORTING
e_t_data = g_t_ZPY_P01
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.
EXIT.
ENDIF.
ENDWHILE.
ENDFORM. " GET_ALL_DATA_FROM_INFOCUBE " format_BPS_text
Hi Sofie,
We face the exact same issue. Did you manage to get a fix for this by way of using an internal table and then running the query twice?
We require to query a BW-IP cube and wish to get both the compressed and uncompressed data, seemingly we can just get one or the other at the moment.
@Gregor Dieckmann - Very interesting suggestion on the request ID's. This is something we may explore. Do you have any suggestions or updates since your last post on the feasibility of this?
Many thanks,
Nick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nick,
I used internal tables as suggested, since the compressed and non-compressed are in different calls... something like this:
FORM get_all_data_from_infocube CHANGING g_t_ZPY_P01.
TYPE-POOLS: rs, rsdrc.
DATA:
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 TYPE rsdri_s_range,
g_t_range TYPE rsdri_t_range.
DATA: g_end_of_data TYPE rs_bool,
g_first_call TYPE rs_bool.
DATA: l_t_zpy_p01 TYPE STANDARD TABLE OF /BIC/VZPY_P012.
* For the following characteristics / navigational attributes values
* should be returned:
CLEAR g_th_sfc.
* VERSION
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0VERSION'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0VERSION'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0EMPLOYEE
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0EMPLOYEE'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0EMPLOYEE'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0COSTCENTER
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0COSTCENTER'.
* --- name of corresponding column in g_s_ZPY_P01
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.
* 0FISCPER3
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0FISCPER3'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0FISCPER3'.
* --- no ORDER-BY
g_s_sfc-orderby = 0.
* --- include into list of characteristics
INSERT g_s_sfc INTO TABLE g_th_sfc.
* 0FISCYEAR
CLEAR g_s_sfc.
* --- name of characteristic
g_s_sfc-chanm = '0FISCYEAR'.
* --- name of corresponding column in g_s_ZPY_P01
g_s_sfc-chaalias = '0FISCYEAR'.
* --- 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:
CLEAR g_th_sfk.
* 0AMOUNT / Beløb
CLEAR g_s_sfk.
* --- name of key figure
g_s_sfk-kyfnm = '0AMOUNT'.
* --- name of corresponding column in g_s_ZPY_P01
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.
* The reading module is called:
* --- this variable will be set to TRUE when the last data
* package is read
g_end_of_data = ' '.
* --- 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.
* Read data from infoprovider
WHILE g_end_of_data = ' '.
CALL FUNCTION 'RSDRI_INFOPROV_READ'
EXPORTING
i_infoprov = 'ZPY_P01'
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_rollup_only = ' '
i_packagesize = 1000000
* i_authority_check = rsdrc_c_authchk-read
i_authority_check = 'R' "READ
IMPORTING
e_t_data = l_t_zpy_p01
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.
MESSAGE e398(00) WITH 'Problem on FM RSDRI_INFOPROV_READ - Subrc = '
sy-subrc
' - TREATMENT STOPPED'.
ENDIF.
APPEND LINES OF l_t_zpy_p01 TO g_t_ZPY_P01.
CLEAR : l_t_zpy_p01.
ENDWHILE.
ENDFORM. " GET_ALL_DATA_FROM_INFOCUBE " format_BPS_text
Hi Sofie,
With a i_rollup_only at space, you should have all your data but you have a pb in your code.
After each call of the RSDRI_INFOPROV_READ, the content of the internal table g_t_ZPY_P01 is overwritten. So at the end of your form, you only have the data returned by the last call.
You have to append the returned data in a backup table before a new call of the function module (just after the call function).
Regards,
Frederic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Finally! Thanks Frederic 🙂 But how do I declare an internal table and append the g_t_ZPY_P01 to it? My ABAP skills are quite moderate...
I noted that there is another mistake in the code aswell, but I don't think it makes any difference to my issue.
FORM get_all_data_from_infocube CHANGING g_s_ZPY_P01 should be ...CHANGING g_t_ZPY_P01.
Hi Sofie,
the function module RSDRI_INFOPROV_READ and its parameters are documented in transaction SE37. In addition you are confusing 'roll up' and 'compression'. The function module documentation explains what I_ROLLUP_ONLY does. Comression is a different thing. If you want to read data for uncompressed requests you have to know the last compressed request id and you have to use the I_T_REQUID parameter. I don't know whether there is an 'official' API to get the last compressed request, but at your own risk you may use function module RSM_DATASTATE_GET to get this information. To read only the not yet compressed request configure I_T_REQUID something like this:
OPT = 'GT'.
REQLOW = ... the last compressed request id ...
Remark:
Check the demo report RSDRI_INFOPROV_READ_DEMO how to call RSDRI_INFOPROV_READ in a WHILE loop. Use a local table l_t_data to retrive the data inside the loop and use something like
append lines of l_t_data to g_t_data.
to collect all data. Read the ABAP documentation about internal tables; in general the ABAP documention is really good.
Regards,
Gregor
HI,
The Parameter : I_ROLLUP_ONLY is define with a default value RS_C_TRUE. The data object of default value is constants. The value of a constant cannot be changed during the execution of the program. If you try to change the value of a constant, a syntax error or runtime error occurs.
That is why you are getting same results.
Please go through the following links.
https://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3041358411d1829f0000e829fbfe/content.htm
Regards,
Anand Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.