cancel
Showing results for 
Search instead for 
Did you mean: 

Read buffer from planning function type exit

Former Member
0 Kudos

Hi Experts,

I have created a planification function type exit.

when I execute this function based on an aggregation level which is based on a real time cube , I managed to get back the data on the buffer; but when I execute this function based on an aggregation level which is based on a multiprovider ( contain 1 real time cube and 1 basis cube ) : the method doesn't work, the buffer is always empty.

Here the ABAP ( found on note 1101726 ) :

i_infoprov is my aggregation level

i_t_charsel contain info objet 0INFOPROV = basis cube from whitch i want the data )

l_r_plan_buffer = cl_rsplfa_plan_buffer=>if_rsplfa_plan_buffer~get_instance( i_infoprov ).

l_r_plan_buffer->get_data( EXPORTING i_t_charsel = i_t_charsel

i_include_zero_records = rs_c_false

i_r_msg = l_r_msg

IMPORTING e_r_th_data = l_r_th_data

EXCEPTIONS OTHERS = 2 ).

l_r_th_data is still empty !

Is somebody has already had to make it and could help me?

thanks a lot by advance

Ingrid.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Matthias,

Thanks a lot for your answer.

I want to use buffer because I have create a generic planning function type which is supposed to work with every aggregation level . But i think there is a method which permit to get data from buffer with an infoprovider ( an not an aggregation level ), so i will try to use it and define the infoprovider to use with a filter as you suggest in your reponse, if its works, i will give you points and thanks so much. See the response tomorrow...

Ingrid.

Former Member
0 Kudos

Hi Matthias,

My idea does not work because i don't give the rigth parameters.

Do you have an example of coding to get data from IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~GET_REF_DATA_SEL as you explain in your answer ?

I try :

l_infoprov = P_SOURCE->get_infoprov('ZCCAN03_1' ). " data are in cube ZCCAN03_1

but it's not OK because P_SOURCE is not a reference variable .

Thank you,

Ingrid.

Former Member
0 Kudos

Hi Ingrid,

IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~GET_REF_DATA_SEL sets the filter to read the reference data.

The most simple example is to read the same data as for the "transactional" filter. In this you can write the following:

e_t_ref_charsel = i_t_data_charsel.

Copying the filter is usually one of the first statements in your code. Now you have your reference filter in table e_t_ref_charsel and can enhance it. That means change some entries, delete or add some entries according to your needs.

Take a look at the standard copy planning function:

  • copying the filter

e_t_ref_charsel = i_t_data_charsel.

  • ... doing some stuff here ..

  • getting parameter values and adding it to e_t_ref_charsel

l_t_param_tab = i_r_param_set->get_tab_param_struc( 'FROMTAB' ).

LOOP AT l_t_param_tab INTO l_r_param_tab_wa.

l_r_param_sel = l_r_param_tab_wa->get_comp_data_sel( 'FROMSEL' ).

l_t_charsel = l_r_param_sel->get_t_sel( ).

LOOP AT l_t_charsel INTO l_s_charsel.

APPEND l_s_charsel TO e_t_ref_charsel.

ENDLOOP.

Another example can be found in the standard currency conversion (implemented in class CL_RSPLFC_CURR_CONV).

This seems to me a bit more simple. So you may take a look at it first.

The important point is to fill e_t_ref_charsel according to your needs.

Hope this helps ...

Regards Matthias

Former Member
0 Kudos

Thank you Matthias,

It's OK , i have good selection but now , how and where do i obtain data from my selection ?

Thanks,

Ingrid.

Former Member
0 Kudos

Hi Ingrid,

are you asking how to fill the reference data selection from variables? Well to do this you need to create parameters and read them here. Filling the parameters with variables in the planning modeler is possible.

You can see your reference data in method IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~EXECUTE in table i_th_ref_data.

Regards Matthias

Former Member
0 Kudos

Thank you very much Matthias, you are the best !

I am junior in class, method and planning function type exit, but you help me a lot, thanks.

Ingrid.

Former Member
0 Kudos

Hi Matthias,

I have finally a problem .... I use the same planning function type for 2 aggregatiion level and I use the instruction 'CASE' to execute the good treatment.

The 2 aggregation level are based on multiproviders, but I have data in I_TH_REF_DATA only with one of the multiprovider.

In both case, multiprovider are based on same cube but the only difference is on the caracteristics and ratios used in the aggregation level.

Do you have an idea ?

Thanks by advance,

Ingrid.

Former Member
0 Kudos

Hi Ingrid,

did you include both infoproviders in the reference data filter? Is you agglevel on the multiprovider?

Regards Matthias

Former Member
0 Kudos

Matthias,

Thanks you for your answer,

- The 2 aggregation level are based on 2 different multiprovider

- Yes, i include the 2 infoproviders in reference data filter using 0INFOPROV.

Ingrid.

Former Member
0 Kudos

Hi,

check the contents of e_t_ref_charsel and try to use listcube to see if you are getting data with the selection found in e_t_ref_charsel.

Regards Matthias

Former Member
0 Kudos

Matthias,

e_t_ref_charsel contains our filters, e_t_ref_charsel is OK in IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~GET_REF_DATA_SEL.

But I_TH_REF_DATA is empty in IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~EXECUTE.

WE have control in LISTCUBE that the cube contains data with our filters criteria.

Ingrid.

Former Member
0 Kudos

Hi,

good. Could it be that this is a block building error? You need to know that your execute method is called for each block. The tables with the reference and transaction data are filled according the the current block for which the execute method is called.

How are your characteristics set up for the planning function. Are they all marked as "to be changed"? How did you set the flag "Without blocks" of your planning function type?

Regards Matthias

Former Member
0 Kudos

Matthias,

The characteristics are all marked as "to be changed" and i have set the flag "Without blocks" in my planning function type exit.

Ingrid.

Former Member
0 Kudos

Hi,

ok. mmhh its hard to tell without having access to the system. Can you check the multiprovider? Are you getting the correct data in c_th_data in the execute method?

You have set up the planning function for each agglevel, correct? So you have two planning function which refer to your exit planning function type, correct?

Regards Matthias

Former Member
0 Kudos

Matthias,

c_th_data is empty too.

Yes, you are right : I have 2 planning function which refer to my exit planning function type.

Thank you,

Ingrid

Former Member
0 Kudos

Matthias,

I can give you more informations :

I execute my function in debugging mode after method IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~GET_REF_DATA_SEL :

I am in the class CL_RSPLFR_CONTROLLER, method EXECUTE_SERVICE and when i am in function 'module read_data_from_buffer' : the parameters are the same in both case ... unfortunally, in 1 case i get the data and in the other, l_r_th_data is empty.

I don't understand.

Ingrid.

Former Member
0 Kudos

Hi,

Could you check your multiprovider mappings?

Regards Matthias

Former Member
0 Kudos

Hi Matthias,

I verify the mapping, in debug I found that the problem was on the parameter P_handle .... ?

So, we decide to recreate the multi-provider ( and AL, function, filters , sequence, layout ) and it seems to be OK.

Next time, i will do it fist ( I did but 'in model' and the result was KO ... ).

thanks for your answer and for the time you accord to my post.

Ingrid.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ingrid,

why don't you read the data you need as reference data? Create an exit with reference data and change the filter for the reference data. This should be easier. Changing the filter for the reference data can be done in method GET_REF_DATA_SEL of your exit class. You may also need to implement IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~ADD_NEW_BLOCKS. A good starting point for this method is to copy it from class CL_RSPLFC_COPY.

Regards Matthias