Skip to Content
Many times during the course of our development we need to refer/access data in other data targets in the Update/Transfer rules. It is primarily in the Update rules where we might need to refer to the Data Target’s data to frame our Business logic. It is quite simple to refer to the ODS data as the active data of the ODS resides in a Transparent data table. The real problem arises when we need to refer to the InfoCube data as the Cube data does not reside in 1 table/view. Though we can write ABAP code and fetch the data but imagine the no. of joins if we need to fetch data from more than 5 dimensions + Fact table.  This Weblog would talk about 3 procedures using which you can access the InfoCube data in the Update rules: RSDRI_INFOPROV_READ:  This function module can be used to fetch the Cube data as an Internal table which can then be used in the Update rules. The function module involves lots of input parameters and it is not easy to use at the first time. Though SAP provides a program RSDRI_INFOPROV_READ_DEMO to explain the parameters I have not found the program much useful.   I shall discuss the common input and the output parameters of the function module. Input Parameters: 1.     I_INFOPROV – This will hold the Name of the Info Cube from where we need the pull the data. 2.     I_T_SFC – This parameter is in the format of Internal Table which holds the Character Info Objects we need to pull from the Source Cube. 3.     I_T_SFK – This parameter is also in the format of Internal Table which holds the Key Figure Info Objects which we need to pull from the Source Cube. 4.     I_T_RANGE – This is also in the format of Internal Table which holds the Selection criteria for which we need to pull from the Source Cube – For example the Company Code – 001 and Fiscal Year Period – 001/2006. 5.     I_T_REQUID – Selection of cube data based on Request Id. 6.     I_SAVE_IN_TABLE – In case you need to save the data in DB table 7.     I_REFERENCE_DATE – This holds the current date. 8.     I_AUTHORITY_CHECK – This will hold the value ‘R’, which is meant for READ. 9.     I_DEBUG – This is for Debugging mode and holds the default value ‘Y’. Output Parameters: 1.     E_T_DATA – This Output Parameter is of internal table format, in which we can mention the output fields (For all the fields mentioned in the Input Parameter, this output parameter will hold the values). 2.     E_END_OF_DATA – Once the FM is executed successfully, this output parameter will hold the value ‘X’, means extraction completed successfully. USING INFO-HUB: This is the simplest of the method as you don’t need to use any function module or code. You can use an Info-hub on an Info-Cube and the Cube data can be stored in a DB table. Now you can use the DB table in the Update rules to refer to the Cube Data. Using the Info-hub has many advantages like No Coding required, Selections can be defined in the Info-hub (i.e. the fields and the values that you want) but the major disadvantage being that each time the cube is updated the Info-hub needs to extract data from the Cube.  USING QUERY DATA IN ROUTINES: There are cases where we would like to refer to the Calculated key figures or Restricted key figures in the Update rules or Transfer rules. In such cases both the above options (Info-hub or RSDRI_INFOPROV_READ) would not help as they refer to the base data in the cube and not the query data. For such cases you can use the ABAP program “WRITEQUERY” in your routine. The WRITEQUERY takes the Query Id as the selection criteria and gives the output in the form of Query report. We take the output of the program into an internal table and then use the internal data for manipulations/transformations in the routines. Though this method is little complex experienced ABAPper should be able to accomplish this.  
To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

    1. Dinesh Kumar Post author
      Hi Dirk,

      I guess you meant create an export datasource on the Cube and create an ODS to load the data from the cube to the ODS. And then use the active table of the ODS. Effortwise it would involve the same effort to create an Infospoke and use the table of the Info-spoke only that it would occupy the system resources by means of changelog and PSA tables.

      -Dinesh

      (0) 
  1. Hi Dinesh,
    Nice blog.
    Just wanted to comment on the third part of your solution, where i would like to add another complecated situation where we dealt the sitiation in the following way.In this case we wanted to get the data from three different cubes and the result should be stored in another cube with few calculations. The method we followed was to create three different reports on the three cubes and getting the data from them through an extractor program and get the result stored in another external table and using the datasource created on this table to get the required calculated data to be loaded in the new cube xxx which has all the required data from all the three cubes to report on. Please do let me know if any other simple way could have been implemented other than this.

    Thanks Vishwa

    (0) 
  2. Ivi Torres
    Hey, thanks for this blog because I was very helpful, but I have the following problem.

    I’m loading data from an ODS to a CUBE, and the routine start looking for data in the same bucket to make some calculations and generate new records. The function “RSDRI_INFOPROV_READ” brings me full and correct data or DATA_PAGKAGE with these and other data that come from the ODS.
    The problem is that these records fetched from the function I have no updates in the bucket and the others do.

    Much appreciate if you could help me.

    Greetings.

    (0) 
  3. BW Basis Support
    Hi Dinesh,

    Thank you for your informative Web Blog.

    I am not an ABAPer, but am most interested in finding out if there is a sample solution where a function module calls the WRITEQUERY Abap program.

    What i would then want to do is pass through
    the query name, and the variable values for variable
    ZP_FPER for InfoObject 0FISCPER and Variable ZN_MRU01 for InfOObject ZREP_UNIT.

    I would then want simply get the query results and manipulate them into a a customer exit Variable. 

    A requirement has come up to create a master data list of equipment from the transactional data that exists in the cube.

    Do you have a Web Blog, or documentation that would show how to do this.

    Thank you.

    Simon

    (0) 

Leave a Reply