cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in using FM RSDRI_INFOPROV_READ in UJ_CUSTOM_LOGIC

Former Member
0 Kudos

Dear Experts,

Need your help in resolving this issue of mine.

I was writing a logic for balance sheet calculation using BADI UJ_CUSTOM_LOGIC. The data that is transferred into CT_DATA in this BADI is the data from a specific cube that has already filtered by the input parameters from the data package manager run from the EPM.

The cube consist of several dimension such as CATEGORY and TIME. These dimensions are also put as the user input parameters for the data package manager in EPM. When the user inputs TIME parameter as "2013.01" to "2013.12", CT_DATA will only consists the data within this period also.

In this logic I need to get the data from the previous month (in the case above, "2012.12") in this same cube for my calculation. This is why I use this FM (RSDRI_INFOPROV_READ) to get the data. However when I use this function module to get the previous month data, the new records that I have appended in the CT_DATA in this BADI is not updating the cube after the BADI is executed. When commented out this FM and put the data of "2012.12" in hardcode, the new records in the CT_DATA is updating the cube.

Have anyone ever experienced this behavior? I wonder how to fix so the new records in the CT_DATA is updating the cube even though I use this FM. Or is there any other methods or FMs we can use to get the data in the cube?

Thanks,

Siswono

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Siswono,

Are you sure that the reason you cannot update new records of current period when you use the FM is not because the update comes back with an error such as duplicate records?

I find this behavior strange, but I've never used this FM in BADI UJ_CUSTOM_LOGIC myself. The FM I use to read data from the cube (in case I want more data) is UJQ_RUN_RSDRI_QUERY. I know this FM, in fact, further calls FM RSDRI_INFOPROV_READ, but it always works for me in BPC 7.x version. So below is sample logic of this FM call.

************************************************************************

* Create a Table <lt_source> to receive the Selected Data

************************************************************************

  TRY.

      lo_model->create_tx_data_ref( EXPORTING i_appl_name = pi_appl_id

                                              i_type      = if_uj_model=>gc_type_table

                                   IMPORTING er_data     = lr_data ).

      ASSIGN lr_data->* TO <lt_source>.

      CREATE DATA lr_data LIKE <lt_source>.

    CATCH cx_uj_static_check INTO lo_exp.

      RAISE EXCEPTION TYPE cx_uj_no_check

        EXPORTING textid = lo_exp->if_t100_message~t100key.

  ENDTRY.

************************************************************************

* Fetch the Data into <lt_source>

************************************************************************

  TRY.

      CALL FUNCTION 'UJQ_RUN_RSDRI_QUERY'

        EXPORTING

          i_appset_id       = pi_appset_id

          i_appl_id         = pi_appl_id

          it_dim_name       = lt_dim_list

          it_sel            = pr_filter

          if_check_security = space

        IMPORTING

          et_data           = <lt_source>

          e_end_of_data     = pe_end_of_data.

    CATCH cx_ujq_exception INTO lo_exp2.

*      RAISE EXCEPTION TYPE cx_ujq_exception

*        EXPORTING textid = lo_exp2->if_t100_message~t100key.

  ENDTRY.

-----------------------------------------------------------------------------------

For BPC 10.0, I use below logic to read data from the cube.

Yes, method RUN_RSDRI_QUERY has a call to FM RSDRI_INFOPROV_READ, too.

  TRY.

      lo_appl_mgr->create_data_ref(

        EXPORTING

          i_data_type   = 'T'

          it_dim_name   = lt_dim_list

          if_tech_name  = abap_false

          if_signeddata = abap_true

        IMPORTING

          er_data       = lo_data ).

    CATCH cx_uja_admin_error.

  ENDTRY.

  ASSIGN lo_data->* TO <lt_query_result>.

  TRY.

      lo_query = cl_ujo_query_factory=>get_query_adapter(

        i_appset_id = pi_appset_id

        i_appl_id   = pi_appl_id

      ).

      lo_query->run_rsdri_query(

        EXPORTING

          it_dim_name       =  lt_dim_list   " BPC: Dimension List

          it_range          = pr_filter    " BPC: Selection condition

          if_check_security = abap_false    " BPC: Generic indicator

*        i_packagesize     =     " BPC: Size of Returned Data Package

*        i_call_badi       = ABAP_TRUE

*        if_db_aggregate   = ABAP_TRUE    " BPC: Generic indicator

        IMPORTING

          et_data           = pt_result_tab "<lt_query_result>

          e_end_of_data     =  pe_end_of_data   " BPC: Last Data Package Yes/No

*        e_split_occurred  =     " Result may not be completely aggregated

          et_message        = lt_message    " BPC: Messages

*        e_stats_guid      =     " BPC: Statistics Session

*        e_cell_filted     =

*      CHANGING

*        c_first_call      =     " BPC: First Call Yes/No

      ).

    CATCH cx_ujo_read.  " Exception of common read

  ENDTRY.

Hope this helps. Let me know how you go.

Former Member
0 Kudos

Hi Anirut,

At first I also thought it is the issue of the duplicate records in the CT_DATA to be updated to the cube. But then I have refreshed the CT_DATA and put into new records but still failed.

Former Member
0 Kudos

Hi Siswono,

So when it you have the FM call in your program and it does NOT work, do you get any errors (of any kinds) at all in your data manager package log?

Or it just shows it was successful, but it doesn't update the cube?

Answers (2)

Answers (2)

Former Member
0 Kudos

I have found the solution for this issue. I use class object CL_RSDRI_INFOPROV and use the method READ to get the data from the cube instead of FM RSDRI_INFOPROV_READ.

I heard from one of my colleagues that this FM can only be used to its full features in EPM 7.5. In my case I use EPM 10 which SAP has developed a specific class for this functionality. Using this I can update the cube even though I accessed the same cube in the BADI UJ_CUSTOM_LOGIC.

Thanks.

Former Member
0 Kudos

Hi Siswono,

Yeah, that's why I also gave some sample code for BPC 10 as I wasn't sure what version you were on.

If you dig into FM UJQ_RUN_RSDRI_QUERY on your BPC 10 system, you'll see that in method RSDRI_QUERY of class CL_UJQ_QUERY_ENGINE has all of its logic, part of which is an FM RSDRI_INFOPROV_READ call, commented out;

So FM UJQ_RUN_RSDRI_QUERY doesn't work on BPC 10 and is the reason why I have different code for BPC 10.

Anyway, good to hear you've found a solution.

0 Kudos

Hi Siswono, I have the version of BPC 810, I'm trying to use FM RSDRI_INFOPROV_READ and the class CL_RSDRI_INFOPROV method READ that you mentioned and is not updating the data in the cube, do you have any hint about this?  I also deleted the duplicates and still not working.

Regards.

Gibram Habib.

Former Member
0 Kudos

Hi Siswono,

Are you trying to post some data in the previous period also?

Former Member
0 Kudos

Hi Nilan,

Nope, I just want to post some data in the current period where the selection parameter of the data package is running. However I need the previous month data for the calculation of the current period.

For example in my case, I need to calculate the settlement amount of the period 2013.01. To calculate this I need to get the closing balance from the period 2012.12 as the opening balance for the period 2013.01. Since the data from the data package from front end EPM does not contain the data before 2012.12, I need to use this FM to get the closing balance of 2012.12.

Former Member
0 Kudos

Hi Nilan,

Nope, I just want to post some data in the current period where the selection parameter of the data package is running. However I need the previous month data for the calculation of the current period.

For example in my case, I need to calculate the settlement amount of the period 2013.01. To calculate this I need to get the closing balance from the period 2012.12 as the opening balance for the period 2013.01. Since the data from the data package from front end EPM does not contain the data before 2013.01, I need to use this FM to get the closing balance of 2012.12.

Sorry I meant the data before 2013.01 just like I have written in the bold.