Delete Existing request in Cube of two years before data using ABAP

Hi,
I want to automize the process of deleting cube data which is Two years old in the process chain.
I know this could be done in process type of delete overlapping request . There we  Should write ABAP code to acheive the same.
I have seen the editor screen but could do nothing as i am writing the code for the first time.
In the code i see the following:
{form compute_XX
  tables l_t_request_to_delete structure rsreqdelstruc
  using l_request like rsreqdone-rnr
  changing p_subrc like sy-subrc.
*Insert Source Code to decide if requests should be deleted.
*All Requests in table l_t_request_to_delete will be deleted
*from Infocube XX.
*Add new requests if you want to delete more (from this cube).
*Remove requests you did not want to be deleted.
$$ begin of routine - insert your code only below this line        -
     loop at l_t_request_to_delete.
     endloop.
     clear p_subrc.
ENDFORM.}
Any clue of how to procede?

You will need code similar than bellow in the routine that you mentioned:
*Defined the ccupeaka data types as the timestamp calculation module
*requires this data types
  DATA i_date LIKE  ccupeaka-timestamp.
  DATA i_request_date LIKE  ccupeaka-timestamp.
  DATA i_diff_sec TYPE i.
  DATA i_diff_day TYPE i.
  DATA i_request_tm LIKE rsreqdelstruc-timestamp.
*Define here the retention period in days
  DATA c_retention_day TYPE i VALUE 70.
  i_date+0(8) = sy-datum.
  i_date+8(6) = '000000'.
  LOOP AT l_t_request_to_delete.
    i_request_tm = l_t_request_to_delete-timestamp.
    i_request_date = i_request_tm.
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'
      EXPORTING
        timestamp1 = i_date
        timestamp2 = i_request_date
      IMPORTING
        difference = i_diff_sec.
*Get the day difference:
    i_diff_day = i_diff_sec / 24 / 3600.
*Exclude all request that are within the retention
*time
    IF i_diff_day LE c_retention_day.
      DELETE l_t_request_to_delete.
    ENDIF.
  ENDLOOP.
However, it is bad practice to keep a lot of request in a cube (e.g. all request of 12 month) without doing compression.
Normally you would use request compression (lets say for all requests older 7 days) to have best cube query performance. As after compression you can no longer do request deletion you would then use the selective deletion as descibed in the document in the post above to control the data volume in the cube.
Best regards,
Axel

Similar Messages

  • Date of Last Payment two years before Date of First Deliquency?

    Hey guys,   I was curious if I should do anything about this, or leave it alone since it should fall off in 09/2016.  (or maybe I can have Transunion do an EE in 03/2016) The funny thing is that Equifax removed this from their report the other day, and I thought it would fall off my other reports too until I actually took a look at my Transunion credit report this morning since I was going to ask them to do an EE. Transunion has the Date of last payment as 08/2008 (Equifax did too.) - BUT, it has my first deliquency around 09/2009 according to the payment history...  I think?  I'll let you guys look at this and be the judge.  I can't look at Equifax for the date of first deliquency since they no longer have it on my report. What would you guys do with this?  I actually have a new account with Capital One now - two cards in very good standing with a perfect payment history, both were recently given CLI and both will get another increase via Credit Steps at the end of this month.  I want to keep this good relationship, and wonder if that would help with getting this old (and confusing) C/O removed.  At the same time, I'm scared of this updating to a more recent date and looking like a new C/O on my report if I "poke the bear". I have no collections on my report for this either, btw - and it is also past the SOL for my state. Thanks! Edit:  After looking at this further, it *appears* that I ran up the card and was making payments, then defaulted on those payments?  I really can't remember.  Seems like a best case scenario though.  Maybe I should leave it alone and be happy that Equifax maybe  made a mistake!  Still doesn't explain that 2008 date of last payment, however.         

    Hey guys,   I was curious if I should do anything about this, or leave it alone since it should fall off in 09/2016.  (or maybe I can have Transunion do an EE in 03/2016) The funny thing is that Equifax removed this from their report the other day, and I thought it would fall off my other reports too until I actually took a look at my Transunion credit report this morning since I was going to ask them to do an EE. Transunion has the Date of last payment as 08/2008 (Equifax did too.) - BUT, it has my first deliquency around 09/2009 according to the payment history...  I think?  I'll let you guys look at this and be the judge.  I can't look at Equifax for the date of first deliquency since they no longer have it on my report. What would you guys do with this?  I actually have a new account with Capital One now - two cards in very good standing with a perfect payment history, both were recently given CLI and both will get another increase via Credit Steps at the end of this month.  I want to keep this good relationship, and wonder if that would help with getting this old (and confusing) C/O removed.  At the same time, I'm scared of this updating to a more recent date and looking like a new C/O on my report if I "poke the bear". I have no collections on my report for this either, btw - and it is also past the SOL for my state. Thanks! Edit:  After looking at this further, it *appears* that I ran up the card and was making payments, then defaulted on those payments?  I really can't remember.  Seems like a best case scenario though.  Maybe I should leave it alone and be happy that Equifax maybe  made a mistake!  Still doesn't explain that 2008 date of last payment, however.         

  • Delete overlapping requests from cube not working in processchain.

    In a process chain, 'deletion of overlapping requests from the cube ' step is used.
    Before this step a DTP step runs with a full update to load the cube. This process chain is scheduled every day.
    Issue is, the process chain failed at the DTP step and after correcting and repeating, the step got executed.
    However, the next step after the DTP,'delete overlapping requests from the cube'
    gets executed but without deleting the previous day's request.
    In the step details a message that 'No request for deletion were found' can be seen.
    Then next day when the DTPstep is executed without any problem the 'delete overlapping requests from cube' step is successful
    and the previous requests from cube are deleted.
    the deletion selections in the step ' delete overlapping request from infocube' is
    Delete existing requests
    Conditions:
    only delete requests from same DTP
    Selections
    Same or more comprehensive
    Because of this issue on a particular day because of the presence of 2 days requests the data is getting aggregated and shown as double in the reports.
    Please help.

    Hi Archana,
    When you delete the bad request from target and before repeating your DTP in PC, make sure the bad request deleted from table RSBKREQUEST also.
    If you find the same request in table, first delete the request from table and repeat the DTP in PC.
    Now Delete overlapping step should work.
    As this is not the permanent solution, please raise an OSS for SAP
    Regards,
    Venkatesh

  • Problem while deleting overlaping request from cube

    Hi experts,
    I have one process chain in which i have one step where i am executing one DTP to load one cube and in next step deleing overlapping requests from same cube.
    i am getting error at that step "Error when deleting requests for comparison request DTPR_4CCDXZLK1OIGCVGGE1PP31Z3Y"
    what could be reason?
    plz help

    Hello,
    I guess you have not defined the overlapping variant properly.
    Please goto the definition of the variant and check for the right DTP input.
    Then at the bottom, select second option "Edit all Infocubes with Following Delete Selections"
    Click on deletion selections -> select delete existing requests.
    Also select if same datasource and source system. and importantly select the radio button as overlapping.
    Then save the variant. and try to use it.
    Regards,
    Shashank

  • DTP and "Deleting Existing Request"

    Hello Gurus
    I have a Doubt whith DTP
    In 3.X i used Infopackage (in full update) , and sometimes i used the OPtion "deleting request after update" which have the same Infosource, the same datasource and the same system source.
    In DTP i don't find any option. Do you you think FULL UPADTE will have the same proprieties ?
    Thank for your help

    With DTP. there are two ways to achieve this.
    you can include "DELETE EXISTING REQUEST" process type in the process chain.
    delete PSA
    execute infopack
    drop index
    Execute DTP
    Delete existing request
    generate index
    other way
    delete PSA
    execute infopack
    delete data target contents (if its loading from only one source)
    schedule DTP
    generate index

  • Synchronizing Two Custom Z Tables Using Abap Program

    Hi,
        My requirement is Synchronizing two custom z tables using abap program me.
    I have vendors in two tables, i have to select the common vendors from first which are existing in second  table also.
    In first table each vendor can have more than one supplier types in one field only. In second table these supplier types are divided into
    different fields.
         My requirement is I have to check supplier types in first table and i have to pass X to corresponding supplier types in second table vendor.
    I have to pass X value for each depending in Second table depending upon supplier type in first table.
    . How to do it can any one suggest with code.
    Thanks in Advance,
    Vivek
    <subject edited by moderator>
    Message was edited by: Manish Kumar

    Hi,
    Imho, you need to get (meaning, extract into separate fields) the different supplier types from Table1 first. Your key for Table1 is the vendor no, which is also the key in Table2 (or the key for Table2 is Vendor no & Type).
    For better performance, better select multiple/all required entries from Table1 instead of doing a select endselect.
    Depending on the format of the vendortypes in Table1, put them in a new itab (for our purpose named Table1New where vendor no & type are the only 2 fields. For example, if the type length is fixed to 2 chars, or divided by space,... use your coding accordingly.
    Next step is to select all vendor no's in Table2 which you have selected in Table1. If in Table2, the vendor no is the only key (and the all vendor types are filled in a single record), then loop check the vendor types from Table1New against the types in Table2.
    If the key of Table2 is vendor no & vendor type, then do a read table for the key.
    The logic in pseudo-code:
    Select from Table1 into table. If you'd like to limit the selection size, add package size statement.
         extract the vendor types in to itab Table1New.
         Select the vendor & types from Table2 by using the for all entries option (better performance).
         loop at Table1New
              check in Table2:
                   if the unique key is vendor no: check all fields for the vendor type from Table1New
                   if the unique key combo is vendor no & type: check by using a read table.
              If not found => add entry to Table2
         endloop.
    endselect Table1 (when using package size)
    I guess the most difficult step is to extract the types from Table1 into separate fields, all the rest seems straight forward. Please keep in mind the itab type definitions for a better performance.
    Good luck!
    Best regards,
    Zhou

  • Delete overlapping requests in Cube

    Dear all,
    I need delete the requests uploaded in the previous day when transferring new request into Cube,and the system is BW 7.0,but I use 3.5 data source and infoSource.
    The issue is that when I

    Tianli,
    You can delete the overlapping request in the infocube.
    In the infopackage -
    > Data Targets -
    > Automatic loading of similar/identical requests
    You can set the parameter for deleting the overlapping request here.
    If you are using process chains, there is a process type available
    Load process and post processing-----> Delete overlapping request from infocube.
    Can you post your question again as I see it is incomplete..
    Sasi

  • Process type "Delete overlapping request in cube " in process chain

    Hi
    can somebody suggest me where i need to place the process type "Delete overlapping request" for an infocube.
    Regards,

    Hi,
    When you use the corresponding process in the process
    chain maintenance screens to specify the conditions for
    automatic deletion, these conditions are applied to all
    the InfoCubes for the selected InfoPackages
    Overlapping: If you set this indicator, existing requests are also
    delete from the InfoCube if the selection criteria of the new request partially or wholly overlap the selection criteria of the request to be deleted
    Same or Comprehensive: If you set this indicator,
    requests are only deleted from the InfoCube if
    the selection conditions of the new request are
    the same as or more comprehensive than the selection
    conditions of the request to be deleted.
    Thanks
    Bhagesh

  • Year to Date using SAP variables

    I've run into a sticking point when trying to create a year to date calculation that works without user entry. The infocube is updated by finance each month (for the previous month) after the final adjustments are made. For this reason, when the query pulls YTD information, it should be cumulating from January 20XX to Current Month - 1.
    The first way that I tried was to use overlapping restrictions: Fiscal Year/Period < Current Fiscal Year/Period AND Fiscal Year = Current Fiscal Year. This worked very well until we reached January. Now the overlapping restrictions return no results since all previous months are not in the current fiscal year.
    I've also attempted using the SAP exit variable 0FYTLFP (Cumulated to Last Fiscal year Period) on Fiscal Year/Period. It is not working, and I assume it is because the last fiscal year period is falling into a different fiscal year. Using it today, the value I get is equal to the value for Jan 2007. The variable seems to first look up the first day of the current fiscal year, saves that as one end of the range, then goes to the previous month to get the other end of the range. I tried offsetting this variable by -1 and the value returned was equal to Dec 2006, but not YTD.
    I'm assuming it must be possible to use the standard SAP delivered objects to create a working YTD calculation that does not require manual entry and cumulates correctly through current period - 1. Does anyone have any suggestions?
    Thanks!

    Dear Adam,
    For Year to Date , We have created a Customer Exit , For working , Create a Variable for 0calday and populate that with from and to value ...to value would be Sy-datum and From value is year starting date. Hope it helps..
    Thanks,
    Krish

  • Requirement wherein I want to call two queries in parallel using ABAP Prg

    We are using RSCRM_BAPI to run a query in background and write the results to a table. We later read this table and create a file. I have a requirement u2013 wherein I want to call two queries in parallel using an ABAP program.
    For our discussion assume:
    1) Program : ZCALL_RCRMBAPI  is a program that calls RSCRM_BAPI in background and takes the query name as input
    2) Program: ZMAIN_PROGRAM  this is the main program
    The requirement is to call the ZCALL_RCRMBAPI in a loop. Also within the loop call it in parallel. Basically we have an ODS that stores ; FISCPER. So I call the two queries for a list of FISCPER.
    ZMAIN_PROGRAM - A program that reads a table (ODS ) in our case and call the two programs in a loop and both should run in parallel .
    Now if it was sequential u2013 it was easy u2013 I would just say
    Loop at L_T_FISCPER .
    Update Z_FISCPER with L_T_FISCPER-FISCPER u201C Assume Z_FISCPER is a Z table . The VARIABLE in the query Q1 and Q2 use a customer exit to read this table.
    A)       SUBMIT ZCALL_RCRMBAPI with P_QUERy = Q1 and return .
    B)      SUBMIT ZCALL_RCRMBAPI with P_QUERy = Q2 and return .
    Endloop .
    Question: How do I make these calls in parallel u2013 yet retain control in the main program?
    A)       SUBMIT ZCALL_RCRMBAPI with P_QUERy = Q1 and return .
    B)      SUBMIT ZCALL_RCRMBAPI with P_QUERy = Q2 and return .

    Instead of RSCRM BAPI you can use the RRW3_QUERY_VIEW_DATA function module for greater control over program execution...
    /people/arun.varadarajan/blog/2009/07/29/make-the-most-out-of-query-execution--part-1
    will give you pointers as to how this can be done...

  • Year-to-Date using mdx

    Hi,
    I am new to mdx and struggling with the syntax.
    I have made the below (simple) query wich works fine.
    select {(EJV1, Dec, [RUBRIEK 5] )} on Columns,
    Descendants([109]) on rows
    From Resultat
    where (FY10, Prognose, [geen klant], [Geen omzet])
    Now i would like to have a year to date value.
    When i use the query below i see all the separate months.
    How can I adjust this query so the period values are aggregated?
    select { (YTD([Dec]))} on Columns,
    Descendants([109]) on rows
    From Resultat
    where (FY10, Prognose, [geen klant], [Geen omzet])
    Thanks.

    We use a VALUE dimension to dynamically calculate YTD/QTD/Thousands/Millions...
    Our ASO database has P&L and B/S data so this YTD Member Formula handles them differently:
    IIF(IsLevel([TIME].Currentmember, 0),
         IIF(IsAncestor([Balance_Sheet_Accounts ], [ACCOUNTS].Dimension.CurrentMember),
              [TIME].CurrentMember,
         Sum(PeriodsToDate ([TIME].Generations(2), [TIME].Currentmember))
    0
    This lets us query with Excel as if we had the Dynamic Time Series functionality of BSO.
    Edited by: baboland on May 20, 2010 1:53 PM
    Edited by: baboland on May 20, 2010 1:54 PM

  • Partitioning two Years Of Data From One Cube Yo Another

    Hi Experts,
    Can any one please help me on the following issue.
    I got the requirement where I need to copy the data from one cube to another having unequal number of dimensions.
    I have achieved this using Transparent partitioning, But I could be able to copy only one year data.
    In cube1 I have the months like Jan, Feb...Dec and in cube2 I have the structure like Jan-11..Dec-11, Jan-12...Dec-12.
    While creating the partition how can I map the Jan with Jan-11 and Jan-12.
    Thanks In Advance,
    Ram

    You can map manually. it is possible.

  • HT1384 Hi, I have an Ipod nano that I have had for about two years, but never used. I have finally got round to charging it, and whilst on charge I can turn it on and see the songs I have downloaded, but as soon as I take off charge it's dead and won't tu

    Any thoughts? I've tried the reset thing, but the ipod is hust dead as soon as I take it off charge.

    Sure does!

  • Clubbing two XMLs before display using xtags

    Hi,
    I need an approach to club two xmls one after the other and then parsing the new combined xml into xtags as the logic below to generate an html output.
    <xtags:style xml="<%=sXml%>" xsl="<%=sXsl%>">
    <xtags:param name="sSiteid"><%=sSiteid%></xtags:param>
    <xtags:param name="sLinkid"><%=sLinkid%></xtags:param>
    <xtags:param name="actionurl"><%=actionurl%></xtags:param>
    </xtags:style>I am able to show the output correctly with one xml but now I need to club two before display.
    Kindly give some inputs.
    Thanks,
    Amit

    For those who are having trouble understanding this post, "clubbing" is a regional usage of English that corresponds to the standard English words "combining" or "joining". It has nothing to do with hitting people.

  • How to get two rows of data using GUI_DOWNLOAD

    Hi i am using GUI_DOWNLOAD i am downloading data into excel succesfully.....
    i am getting data as
    Pernr Fname Lname
    1000  F1000 L1000
    2000  F2000 L2000
    requirement
    is to add one more field  on the top of text as what is the run date .
    is it possible using GUI_DOWNLOAD? or need to use oops/OLE only one ?
    RUNDATE: 15/05/2009
    Pernr Fname Lname
    1000  F1000 L1000
    2000  F2000 L2000
    Regards
    sas

    Hi,
    check the below code, it's working as per your requirement. For the second call of FM  use
    append                = 'X'.
    DATA: it_date TYPE TABLE OF char30, "For downloading Rundate
            wa_date LIKE LINE OF it_date.
      CONCATENATE 'Rundate: ' sy-datum+6(2) '.' sy-datum+4(2) '.'
                  sy-datum+0(4) INTO wa_date.
      APPEND wa_date TO it_date.
    "Download the Rundate first
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename              = 'D:\1.xls'
          filetype              = 'DAT'
          write_field_separator = 'X'
        TABLES
          data_tab              = it_date.
    "Now download your data tab with header with the append parameter as X
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename              = 'D:\1.xls'
          filetype              = 'DAT'
          append                = 'X'
          write_field_separator = 'X'
        TABLES
          data_tab              = it_tab
          fieldnames            = it_header.
    Hope this helps you.
    Regards,
    Manoj Kumar P
    Edited by: Manoj Kumar on May 15, 2009 8:46 AM

Maybe you are looking for

  • Slow performance on Mac OS X 10.5.8 - Upgrade Required

    Hi there. Sympton: Old Mac OS X 10.5.8 very slow opening files, browser, docs.... Cause: I think too much stuff there (movies / pictures / apps / docs...) Fix: I would like to clean up and upgrade to the newest OS possible my hadrware allows. Questio

  • MBP 2011 dropping wireless connection

    my wifi connection drops every 2-3 minute and reconnects in 15-20 seconds.when I connect to the internet with my neighbor's modem it works fine. Although I made a very wide research i found nothing helpful about this issue. Can you help me to solve t

  • Playbook BB world won't respond

    Hi. I have been trying to download applications on my playbook but the BB world just won't respond. I keep seeing a blue screen that shows installed. I try swiping down and I see three options; 1.content setting, 2. Payment Option 3. Help. I tried th

  • Installing your new AirPrint printer in Mac OS X 10.8 (Mountain Lion)

     This video gives clear and direct instructions on how to setup your new AirPrint enabled printer in Mac OS X 10.8 (Mountain Lion)

  • I can't access .psd file as my trial has Expied!

    I'm completely new to Photoshop. I started with a free trial and learned to create some graphics. When I saved the files it saved it as a .psd file. My trial ended so I signed up for an account and I picked the one for $9.99. I tried to access my wor