Delete Request using a Routine in the Scheduler

Hi all,
I have an infocube. Data are loaded into this cube on a <b>weekly basis</b> according to the following requirements.
Example:
Let's assume <b>we are in April</b>and <b>April has 4 weeks</b>:
<b>Week 1 of April</b> - Data for week 1 are loaded
<b>Week 2 of April</b> - Data for week 1 and 2 are loaded
(request for week 1 is deleted)
<b>Week 3 of April</b> - Data for week 1, 2 and 3 are loaded
(request for week 2 is deleted which were the data for week 1 and 2)
On the <b>2nd day of the following Month (in our example this would be May 2nd) Data for week 1, 2, 3, and 4 of April are loaded.</b>(request for week 3 is deleted which were the data for week 1, 2 and 3).
<b>These April data</b> (loaded on the second day of the following month) <b>should stay in the cube then and not be deleted any more.</b>
The procedure for the following Months (i.e. for May etc) should be the same.
This means
<b>Week 1 of May</b> - Data for week 1 are loaded
<b>Week 2 of May</b> - Data for week 1 and 2 are loaded
(request for week 1 is deleted)
etc.
On the <b>2nd day of the following Month (in our example this would be June 2nd) Data for week 1, 2, 3, and 4 of May are loaded.</b>(request for week 3 is deleted which were the data for week 1, 2 and 3).
<b>These May data</b> (loaded on the second day of the following month) <b>should stay in the cube then and not be deleted any more.</b>
CAN ANYBODY HELP ME WITH THIS REQUIREMENT AND TELL ME HOW I CAN DO THAT?
CAN I DO THAT USING A ROUTINE IN THE SCHEDULER ON TAB DATA TARGETS TO DELETE THE REQUEST BASED ON THE LOGIC DESCRIBED ABOVE? DOES ANYONE HAVE  SAMPLE CODE FOR THAT?

hi Christian,
from service.sap.com/bi
hope this helps.
User Exit after Data loading
(a)     Delete old request
REPORT Z_RSSM_START_SECOND_PROCESS_1 .
TABLES: RSREQDONE,   " Request-Data
        RSSELDONE,   " Selection for current Request
        RSICCONT.    " Request posted to which InfoCube
DATA: L_T_SELDONE LIKE RSSELDONE OCCURS 0 WITH HEADER LINE.
DATA: L_T_ICUBE LIKE RSICCONT OCCURS 0 WITH HEADER LINE.
DATA: L_LOGSYS LIKE RSSELDONE-LOGSYS.
DATA: L_SOURCE LIKE RSSELDONE-SOURCE.
DATA: L_SELDATE LIKE RSSELDONE-SELDATE.
DATA: L_SELTIME LIKE RSSELDONE-SELTIME.
DATA: BEGIN OF L_T_RNR_DEL OCCURS 0,
        ICUBE LIKE RSICCONT-ICUBE,
        RNR   LIKE RSSELDONE-RNR,
      END OF L_T_RNR_DEL.
PARAMETER I_RNR LIKE RSREQDONE-RNR.
SELECT SINGLE * FROM RSSELDONE WHERE
       RNR = I_RNR.
IF SY-SUBRC <> 0. "new rquest does not exist, wrong rnr !!!
  EXIT.
ENDIF.
SELECT * FROM RSICCONT INTO TABLE L_T_ICUBE WHERE
       RNR = I_RNR.
IF SY-SUBRC <> 0.     "New request is not posted to any IC
  EXIT.               "nothing will be deleted
ENDIF.
L_SOURCE  = RSSELDONE-SOURCE.
L_LOGSYS  = RSSELDONE-LOGSYS.
L_SELDATE = RSSELDONE-SELDATE.
L_SELTIME = RSSELDONE-SELTIME.
SELECT * FROM RSSELDONE INTO TABLE L_T_SELDONE WHERE
       SOURCE  = L_SOURCE AND
       LOGSYS  = L_LOGSYS.
DELETE L_T_SELDONE WHERE
       RNR = I_RNR.            "new request will be deleted
DELETE L_T_SELDONE WHERE     "delete younger requests
         SELDATE > L_SELDATE OR
       ( SELTIME > L_SELTIME AND
         SELDATE = L_SELDATE ).
*Sort
SORT L_T_SELDONE BY SELDATE DESCENDING SELTIME DESCENDING.
REFRESH L_T_RNR_DEL.
LOOP AT L_T_SELDONE.   " Requests to be deleted
  LOOP AT L_T_ICUBE.   " Request existing in InfoCubes
    SELECT SINGLE * FROM RSICCONT WHERE
           ICUBE = L_T_ICUBE-ICUBE AND
           RNR   = L_T_SELDONE-RNR.            "check if posted to IC's
    IF SY-SUBRC = 0.
      L_T_RNR_DEL-ICUBE = L_T_ICUBE-ICUBE.
      L_T_RNR_DEL-RNR   = L_T_SELDONE-RNR.
      APPEND L_T_RNR_DEL.
    ENDIF.
  ENDLOOP.
  IF NOT L_T_RNR_DEL[] IS INITIAL. " something found for rnr
    EXIT.
  ENDIF.
ENDLOOP.
LOOP AT L_T_RNR_DEL.
  CALL FUNCTION 'RSSM_DELETE_REQUEST'
       EXPORTING
            REQUEST                    = L_T_RNR_DEL-RNR
            INFOCUBE                   = L_T_RNR_DEL-ICUBE
       EXCEPTIONS
            REQUEST_NOT_IN_CUBE        = 1
            INFOCUBE_NOT_FOUND         = 2
            REQUEST_ALREADY_AGGREGATED = 3
            REQUEST_ALREADY_COMDENSED  = 4
            OTHERS                     = 5.
  IF SY-SUBRC <> 0.
open for error-handling
  ENDIF.
ENDLOOP.

Similar Messages

  • Using XML String in the Scheduler Adapter in the Receive port

    I have a requirement where I have to query the view in the Oracle database,and the View is like this
    EmpNumber | Name | TermDate
    E001 | ABC | (null)
    E002 | DEF | 13-DEC-14
    E003 | GHI | (null)
    E004 | JKL | 11-NOV-14
    E005 | MNO | (null)
    E005 | PQR | 10-DEC-14
    I am going to use the Scheduler adapter in the receive port.It should select the Records with the TermDate null and TermDate 7days ago from today. So here is how I want the selected records to be
    EmpNumber | Name | TermDate
    E001 | ABC | (null)
    E002 | DEF | 13-DEC-14
    E003 | GHI | (null)
    E005 | MNO | (null)
    In the other forum I found the sql command to do this is,
    select * from EMP where TERMDATE is null or TERMDATE >= trunc(sysdate) - 7;
    But I am not sure if the XML String in the Scheduler Adapter is correct
    <ns0:Select xmlns:ns0="http://Microsoft.LobServices.OracleDB/2007/03/View/EMP"><ns0:COLUMN_NAMES>*</ns0:COLUMN_NAMES><ns0:FILTER>TERMDATE IN ('null','TERMDATE >= trunc(sysdate) - 7')</ns0:FILTER></ns0:Select>
    Any help will be greatly appreciated. Thanks

    Thanks Suleiman.
    I am using the WCF-Custom Adapter to get the data from the Oracle database. And I am using the Scheduler adapter because to get data on a daily basis.In one of our other application we have used the query statement in the Scheduler adapter
    Like,
    <ns0:Select xmlns:ns0="http://Microsoft.LobServices.OracleDB/2007/03/View/VW_EMP_DEPT"><ns0:COLUMN_NAMES>*</ns0:COLUMN_NAMES><ns0:FILTER>PROCESS IN ('A','B','C')</ns0:FILTER></ns0:Select>
    and it works really fine, it just select the records with the Process A or B or C. I dont know how can I select now with respect to data that is 7 days ago from today.Help me with it.

  • Why can't I send game request using this browser as the main browser on my phone?

    Every time I try to send a life on candy crush it doesn't send .

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    The Firefox cache temporarily stores images, scripts, and other parts of websites while you are browsing. <br>
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies, do the following:
    #Tap the menu icon located at the top right corner. This is the icon with 3 bars. On older Android devices you'll have to press the hardware menu key and then tap More.
    #Tap '''Settings'''.
    #After that, you will be taken to the settings screen. In the settings screen, look under the section '''''Privacy & Security''''' and select '''Clear private data'''.
    #You will then be taken to a list of what can be cleared. Select the following 2 for deletion:
    #*Cookies & active logins
    #*Cache
    #After those have been selected, tap the '''Clear data''' button to actually clear the cache and cookies.
    Did this help you with your problems? Please let us know!

  • Deleting Request Routine

    Hello all,
    Im trying to do a routine for deleting requests from the infocube after update.  I was able to do some, but in some cases if the records that ran in the infopackage are less than the previous package, then it means that is wrong, even though it has the green light, and in that case I dont want the system to delete the previous package, I dont know how to specify that, cause the other ones were very simple and Im not an abap programmer, can anyone help me with this please?

    Hi
    Ajay,
    My scnerios is to delete request while loading data into the cube. Here i am loading data from flatfile from application server, using two variants for daily and monthly loads. The monthly request will run once on 1st of the month(at best 2nd) and the request will be retained.The daily loads requst will be deleted on daily basis while loading. Now on reaching 30th of the month the daily loads will remain. Here i again i shall load the monthly load on 1st but have to delete the daily request on 30th to avoid duplication of data. I created two infosource, one for daily loads and one for the monthly loads. I gave the settings respectively but purpose is not served. Then i rgot ur code with minor modification.
    data : zrnr like rsmonictab-rnr,
           zic_id like rsmonictab-ic_id,
           zlnr like rsmonictab-lnr,
           curr_Rec_count type i.
    *loop at l_t_request_to_delete.
    select * from rsmonictab into table rsmonictab1
    where infocube = 'ZCSCRORD'.
    sort rsmonictab1 by timestamp descending.
    read table rsmonictab1 index 1.  "get the latest req
    curr_rec_count = rsmonictab1-req_insert.
    zrnr = rsmonictab1-rnr.
    zic_id = rsmonictab-ic_id.
    zlnr =  rsmonictab-lnr.
    delete from rsmonictab where rnr = zrnr and  ic_id = zic_id and
    lnr = zlnr.
    Please help me. It will be nice if u can me the code to fulfill the above mentioned scenerios.
    Regards

  • Missing chain step name in events raised by the scheduler

    I use events raised by the scheduler (SYS.SCHEDULER$_EVENT_QUEUE) to monitor scheduler chains processing.
    For event_type = "JOB_STARTED" (chain step started in case of chains) in event message (sys.scheduler$_event_info) there is no log_id (log_id is null).
    In user_scheduler_job_log view there is column job_subname that contains chain step name but this column is missing in the event message.
    Is there any way to get chain step name for event_type = "JOB_STARTED"?
    Job configuration:
    dbms_scheduler.set_attribute(
    name => job_name,
    attribute => 'logging_level',
    value => dbms_scheduler.logging_full
    dbms_scheduler.set_attribute(
    name => job_name,
    attribute => 'raise_events',
    value => dbms_scheduler.job_all_events
    Database:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    OS:
    CentOS - redhat-4
    Regards
    Mariusz

    I want to track chain processing by dequeue messages from SCHEDULER$_EVENT_QUEUE.
    Examples of messages automatically inserted by scheduler into SCHEDULER$_EVENT_QUEUE (user_data column from SCHEDULER$_EVENT_QTAB)
    SYS.SCHEDULER$_EVENT_INFO('JOB_SUCCEEDED','CDWMAIN','JOB_NAME','2011-07-27 16:19:11.191969',0,NULL,0,340374,1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    SYS.SCHEDULER$_EVENT_INFO('JOB_STARTED','CDWMAIN','JOB_NAME','2011-07-27 16:19:10.947994',0,NULL,1,NULL,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    SYS.SCHEDULER$_EVENT_INFO('JOB_CHAIN_STALLED','CDWMAIN','JOB_NAME','2011-07-27 15:45:13.727127',0,NULL,0,NULL,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    For event JOB_SUCCEEDED there is log_id = 340374 so we can find job_subname (chain step name) in log table.
    For JOB_STARTED and JOB_CHAIN_STALLED there is no log_id so we do not know wich chain step in this case was started and wich chain was stalled.
    JOB_NAME is the same for all steps in case of chain processing

  • IPhone 6 won/t delete photos using iPhoto

    iPhone 6 won/t delete photos using iPhoto

    They are on the phone. I import them as usual, and then select to delete them off the phone. Then iPhoto says "deleting" but then the photos never come off of the phone.

  • How to delete database using sql

    I have to delete some databases from oracle 8i. I tried it using the Database Configuration Assistant and I get stuck indefinately as the message always says connecting but nothing happens.
    How can I delete databases using sql not thru the DCA?
    Thanks

    files related to the database and follow these steps:
    1.- shutdown the database
    2.- Delete all files ( Control Files, .dbf, Redo's, Archive�s, parameter file, password file )
    3.- Delete the entrance of this database from
    listener.ora and from tnsnames.ora files.
    and that's it.
    Joel P�rez

  • Use Conversion Routine in Infopackage

    Hello friends,
    I would like to know whats the purpose and function of 'Use Conversion Routine' in the Infopackage  under 'Data Selection' tab. I wasnt able to get any data as long as that box was checked.As soon as I unchecked the box, i was able to get data.Please explain in detail.
    Points will be assigned.
    Thanks.

    Hi,
    The function of "Use Conversion Routine" is to convert the data that user enter in the field (is called external format) into internal format (database format).
    example Alpha Conversion (general used): in the field ABC (assume this char is 8 characters long) you enter value '1234' and you check that box, this will look up into your data source with value ABC = '00001234' and match then data will be extracted, but if <u>in your data source</u> the value of field ABC is '1234'  the data won't be extracted.
    in your case, please check in your data source at field you selected whether the data format match or not with value that you have entered(with condition checked or unchecked).
    I hope it helps
    Cheers
    IR

  • The "Scheduler" service is not in my management panel

    I'm trying to use /sign up for the scheduler service but I can't find it in my account. Basically it doesn't show up ( http://www.windowsazure.com/en-us/services/scheduler/ ) . 

    Hi,
    Kindly follow up this thread.
    Here is a snippet of this thread.
    At the moment you can only access the scheduler through the REST API or through the Management libraries. You won't get an email when the feature is activated and you won't see it in the portal.
    More info about the API: http://msdn.microsoft.com/en-us/library/windowsazure/dn528946.aspx More info about the Management libraries:
    http://fabriccontroller.net/blog/posts/a-complete-overview-to-get-started-with-the-windows-azure-scheduler/
    Hope this helps
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Table for deleted requests information

    Hi,
    can any one please tell the table name where the information of all the deleted request get stored. we want the user name, time, the data target name, req id (LOG) for the deleted request to be displayed through a report.
    Thanks,
    Pallavi

    Dear PVP,
    Check  RSREQDONE..
    Also,,
    RSMONICDP table - there you can see requests status. Try to understand if red status means that a red request is still sitting in the data target, or it is deleted.
    RSICPROT - there is a request description in the EXTNUMBER field. Some of them may contain 'DELET' word. Maybe these are deleted requests?
    Hope this helps u..
    Best Regards,
    VVenkat..

  • Which steps we need to follow in order to IE 11 can send requests using AES 128.

    Internet Explorer 11 by default send requests to servers using AES256 algorythm instead of using AES128 bits (used for PKI Service). Which steps we need to follow in order to IE 11 can send requests using AES 128.

    Shuffling the cipher suits should do the trick.
    See Prioritizing Schannel Cipher Suites
    http://msdn.microsoft.com/en-us/library/windows/desktop/bb870930(v=vs.85).aspx
    At a command prompt, enter gpedit.msc. The Group Policy Object Editor appears.
    Expand Computer Configuration, Administrative Templates, Network, and then click SSL Configuration Settings.
    Under SSL Configuration Settings, click the SSL Cipher Suite Order setting.
    In the SSL Cipher Suite Order pane, scroll to the bottom of the pane.
    Follow the instructions labeled How to modify this setting.
    It is necessary to restart the computer after modifying this setting for the changes to take effect. The list of cipher suites is limited to 1023 characters.
    examples
    TLS_RSA_WITH_AES_128_CBC_SHA                
    TLS_RSA_WITH_AES_256_CBC_SHA                
    TLS_RSA_WITH_RC4_128_SHA                    
    TLS_RSA_WITH_3DES_EDE_CBC_SHA               
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256     
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P384     
    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P521     
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256     
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384      
    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P521
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P256   
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P384   
    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P521   
    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P256   
    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P384   
    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P521   
    TLS_DHE_DSS_WITH_AES_128_CBC_SHA            
    TLS_DHE_DSS_WITH_AES_256_CBC_SHA             
    TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
    TLS_RSA_WITH_RC4_128_MD5                                      
    SSL_CK_RC4_128_WITH_MD5                     
    SSL_CK_DES_192_EDE3_CBC_WITH_MD5            
    TLS_RSA_WITH_NULL_SHA
    TLS_RSA_WITH_NULL_MD5    
    At which point you may place AES 128 suites before AES-256 suites, which is actually the default I believe even for TLS 1.2.

  • What is the use of marking repair request in the scheduler?

    Hi !
    what is the use of the option repair full  request in the scheduler menu item?

    Hi Durai,
    You can use a request that was selected as a repair request via Scheduler ® Repair Full Request to carry out a full update in any data target. This also applies to data requests that already contain data from an initialization run or deltas for this DataSource/source system combination, and that have overlapping selection criteria.
    Nice post by Roberto:
    Bye
    Dinesh

  • InfoPackage-Request Selection Through Routine (To Delete)

    Hello,
    I have come across a situation where I don't want to delete a request from an infocube. 
    Our current process always deletes requests that have the "Same or More Comprehensive" Selections (using the standard options).  However we have one request that we do not want to delete.
    In the area of the infopackage that you can specify the details for "Deleting Request from InfoCube after update",  I would like to use the "Request Selection Through Routine" option available under "Exceptions" to implement a routine.
    I believe i could then code a way to exclude the particular request from the deletion process.
    The problem is that i cannot find any resources with examples or code samples to help me figure out how to code this.
    Any help would be great!
    Thanks,
    Nick

    Hello Nick,
    You receive a table l_t_request_to_delete with all the requests in the cube you are able to delete. Now you simply need to delete your request number from the table, e.g.
    DELETE l_t_request_to_delete WHERE sid = '12345'.
    Best regards
    Dirk
    P.S.: You could also do the same by deleting all the requests except the one you want to keep, compress the cube and then continue data loading.

  • Data deletion routine in the info package

    Hi All,
    I am writting an data deletion routine in the info package.
    it is working fine...
    but when we are transporting the info package, that routine is not getting transported.
    we have tried sending ths info package through a transport connection.
    but still it is not taking the routine to next system.
    please let me know if any one has a solution for this.
    Thanks,
    Mugdha

    Hi Mughda,
    Collect the infopackage using transport connection, While collecting the infopackage make sure that Routines are also collected in the same request.
    Else most of systems will have authorizations to create infopackages, so try to create one IP and use the routine in IP.
    Hope this helps.
    Rgs,
    I.R.K

  • Filtering records using a start routine inside the update rules for a dmart

    Hi
    I am using a start routine inside the update rules. I want to filter out all records that have 0 in all three fields. My problem is that it not only filters these records, but also filter records with negative values, which I do not want. Only 1 field has a negative value, the other 2 have 0.
    I have tried:
    DELETE DATA_PACKAGE where  /BIC/ZBILLCONS = 0 and /BIC/ZBREVPRIM = 0  and /BIC/ZBREVSUBO = 0 .
      DELETE DATA_PACKAGE where ( /BIC/ZBILLCONS = 0 and /BIC/ZBREVPRIM = 0  and /BIC/ZBREVSUBO = 0 ).
    also tried:
    delete DATA_PACKAGE where /BIC/ZBILLCONS IS INITIAL and
    /BIC/ZBREVPRIM IS INITIAL and  /BIC/ZBREVSUBO IS INITIAL.
    The records are going to 1 cube and 1 ODS, I only have the start routine in 1 update rule. I  view the filtering in the PSA.
    Has anyone ran into this before?

    Try
    delete data_package where /BIC/ZBILLCONS = '0' and /BIC/ZBREVPRIM = '0' and /BIC/ZBREVSUBO = '0' .
    OR
    delete data_package where /BIC/ZBILLCONS EQ '0' and /BIC/ZBREVPRIM EQ '0' and /BIC/ZBREVSUBO EQ '0' .
    Good luck!

Maybe you are looking for