Child pages
  • To delete the Data load request except the latest data load in SAP BW
Skip to end of metadata
Go to start of metadata

I would like to share a interesting scenario where we are having full data loads (Planning Data) in the infocube on daily basis and our requirement was that the cube should have the latest data load request only and rest should be deleted.

In the standard BI7.0 Package, we have the functionality to delete the overlapping requests in the process chain. 

The above functionality does not work because in our scenario we were populating  cal/month dynamically in DTP. In the start of a month, month gets populated in the DTP which is different from the last day month/year. For Example Take a case today the date is 31st Jan 2010 so the calmonth/year which gets populated in the DTP would be 012010 and the very next day it would be 022010 as the month gets changed from Jan to Feb and the same problem will come when there would be change in the year then both the month and year would be changed.

This was the problem which we were facing due to this the selection conditions does not remains overlapping and we were getting two requests instead of one which needs to deleted manually.

The second constraint was that they dont want older data in the cube, so we can not keep the older data and we just require current month data in the cube (Data related to planning).

To overcome the above problem we have written the following code in which we are taking all the requests from the cube with reference to the DTP. We are passing the request number and Infocube technical name to the function module RRSM_DELETE_REQUEST and catching all the exceptions for the process chain.

*Selection Screen**

parameters: InfoCube(30) TYPE C OBLIGATORY,

TYPES t_rsicount like rsiccont.
data  : i_rsicount TYPE STANDARD TABLE OF t_rsicount,
      : wa_rsicount like LINE OF i_rsicount,
      : req type rsiccont-rnr,
      : cnt type i.

       request type rsiccont-rnr,
       end of tab.

DATA: i_tab type STANDARD TABLE OF tab,
    :  wa_tab like LINE OF i_tab.

*****All requests for the Cube into internal Table.****

select *
into table i_rsicount
where ICUBE = Infocube

*****Filter on all the request as per the DTP on the selection screen.******

loop at i_rsicount INTO wa_rsicount.

  select rnr into wa_tab
  rnr = wa_rsicount-rnr and


  if sy-subrc eq 0.

    wa_tab-request = wa_rsicount-rnr.

    APPEND wa_tab-request to i_tab.



DESCRIBE table i_tab lines cnt.

if cnt > 1.

clear wa_tab.

*****Request Deletion leaving latest request.******

Loop at i_tab INTO wa_tab.

If sy-tabix ne 1.

    if sy-subrc = 0.

      req = wa_tab-request.

          REQUEST                    = req
          INFOCUBE                   = InfoCube
          REQUEST_NOT_IN_CUBE        = 1
          INFOCUBE_NOT_FOUND         = 2
          NO_ENQUEUE_POSSIBLE        = 5
          CUBE_IN_PLANNING_MODE      = 6.

*****Reading the exceptions from the function module.************


        WHEN 0.
        MESSAGE s051(rsar) WITH 'Successfully Done'.

        WHEN 1.
        MESSAGE e051(rsar) WITH 'REQUEST_NOT_IN_CUBE'.

        WHEN 2.

        WHEN 3.

        WHEN 4.

        WHEN 5.

        WHEN 6.






MESSAGE s051(rsar) WITH 'No Request Available for Deletion'.


Thanks & Regards

Arun Manocha

You can check the code in the wiki also at following link.....



  1. Unknown User (102kva0cz)

    If you just need the data from most recent request, why don't you delete the InfoCube contents before loading the recent request?

  2. Anonymous

    Hi Srinivas,

    I can not delete the cube as data is getting loaded from other sources/DTPs also.