Child pages
  • Changing the Relevance of Data in the Web Templates or Reports
Skip to end of metadata
Go to start of metadata

Purpose

The 'Relevance of Data (Date)' in the technical information of the query shows a date of the request which is oldest among the cubes in the multi-provider.

Overview

The relevance of data (date) comes from the table RSMDATASTATE  If the ROLLUP field is zero i.e. when there is no aggregate rollup then the date is taken from the field tmstmp_qualok.
If the ROLLUP field is not equal to zero i.e. when there are aggregates, then the date is taken from the field tmstmp_rollup. 
                                           

Problem 

The loading of the cubes may be monthly weekly or daily.  Let's say a cube is loaded every Monday (when new data is loaded). A user executing a report on Friday of the same week will see the relevance of data (date) as Monday's date. This might cause confusion. 

Solution 

First of all we will maintain a Ztable- zcubetype, which will hold the list of cubes, which are loaded on a weekly basis (TYPE = W) , and list of cubes which are loaded on a yearly basis, or which are never loaded (TYPE = H).     
We will write an ABAP code which will manipulate the table timestamp fields of RSMDATASTATE table. 

****Start of definition
 DATA: t_it        TYPE STANDARD TABLE OF rsmdatastate,
      t_it_hist   TYPE STANDARD TABLE OF rsmdatastate,
      t_zcubetype TYPE STANDARD TABLE OF zcubetype.
 DATA: w_it LIKE LINE OF t_it,
      w_it_hist LIKE LINE OF t_it_hist.
 CONSTANTS: c_zdate_const      TYPE rsmtmstmplastchange VALUE '20991231235959',
           c_h(1)             TYPE c VALUE 'H',
           c_w(1)             TYPE c VALUE 'W',
           c_0                TYPE rsmrollup VALUE 0.
 DATA: g_znewdate      TYPE rsmtmstmplastchange,
      g_date_time(14) TYPE c.
 *****end of definition
 INITIALIZATION.
  CONCATENATE sy-datum sy-uzeit INTO g_date_time.
  g_znewdate = g_date_time.
 START-OF-SELECTION.
SELECT infocube
         cube_type
         FROM zcubetype
         INTO TABLE t_zcubetype
         WHERE cube_type = c_h.
   IF NOT t_zcubetype[] IS INITIAL.
    SELECT * FROM rsmdatastate
                  INTO TABLE t_it_hist
                  FOR ALL ENTRIES IN t_zcubetype
                  WHERE infocube = t_zcubetype-infocube.
  ENDIF.
 LOOP AT t_it_hist INTO w_it_hist.
     IF w_it_hist-rollup = c_0.
      MOVE c_zdate_const TO w_it_hist-tmstmp_qualok.
    ELSE.
      MOVE c_zdate_const TO w_it_hist-tmstmp_rollup.
    ENDIF.
    MODIFY rsmdatastate FROM w_it_hist.
   ENDLOOP.
 REFRESH t_zcubetype.
   SELECT infocube
         cube_type
         FROM zcubetype
         INTO TABLE t_zcubetype
         WHERE cube_type = c_w.
   IF NOT t_zcubetype[] IS INITIAL.
    SELECT * FROM rsmdatastate
                  INTO TABLE t_it
                  FOR ALL ENTRIES IN t_zcubetype
                  WHERE infocube = t_zcubetype-infocube.
  ENDIF.
 LOOP AT t_it INTO w_it.
      IF w_it-rollup = c_0.
      MOVE g_znewdate TO w_it-tmstmp_qualok.
    ELSE.
      MOVE g_znewdate TO w_it-tmstmp_rollup.
    ENDIF.
    MODIFY rsmdatastate FROM w_it.
   ENDLOOP.
  
We can include this program at the end of the process which runs every day, so that the Relevance of Data (Date) is updated daily, for all the reports.

Assumptions: for cubes which are classified as TYPE = H the timestamp fields are filled with '20991231235959'. 

Related Content:

Related Documents:

Insert SAP Help links or other WIKI content

Related Notes:

Insert links to any related notes/KBA that support your topic or are related

  • No labels