Filter data in transfer rules using start routine

Hi all!
I am an absolute newbie here, but I have a question regarding start routines and I noticed many questions get solved around here. My situation is the following: I have to create a start routine where the data to be transferred is filtered on an attribute "DESTINAT" in info object "0BILL_TYPE". DESTINAT can be 'M' or 'D' and depending on that letter, data must flow to a separate ODS.
Well,I came up with the following:
somewhere in my start routing I guess I'll have to put:
loop at data_pak.
DELETE DATAPAK Where DESTINAT = 'D'
endloop.
When I place this in my start routine of my transfer rules leading to the ODS where data must be of DESTINAT type 'M', will this do the trick?
I want to put the following code in the transfer rules leading to my other ODS, where data must be of type DESTINAT = 'D':
loop at data_pak.
DELETE DATAPAK Where DESTINAT = 'M'
endloop.
I'm sorry that this is a very basic question, but like I said: I'm a newbie in SAP...

hi Joris,
have a lok at the foll  help docs.:
http://help.sap.com/saphelp_nw04/helpdata/en/b3/0ef3e8396111d5b2e80050da4c74dc/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/21/894eeee0b911d4b2d90050da4c74dc/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/80/1a62bfe07211d2acb80000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/content.htm
cheers
shameem

Similar Messages

  • How to set request number of info package using start routine

    Hi All,
    I have a specific requirement in which I need to upload only selective request nos from PSA to DSO.
    Any one can suggest how to set request number of info package using start routine or any other mode so that only selective request should proceed using DTP?
    Thanks
    Sangita

    You'll probably want to do this in a start routine.  It is probably not advisable to hard-code the technical name of the InfoPak.  They seem to remain the same upon transport, unlike DTP technical names which are locally generated.
    I would do a SQL select like this in a start routine, and then filter based on the results of the SQL.  You'll probably want to sort the results by date and time, both descending.  Or do a MAX in the SQL.
    Please let me know if this isn't clear.
    select q~rnr q~logdpid q~tdatum q~tuzeit
    from rsreqdone as q
      inner join rsldpio as p
        on p~logdpid = q~logdpid
    where p~objvers = 'A'
    and p~logdpid like 'ZPAK%'
    and p~source = 'your data source'

  • Restricting data in cube using start routine

    Hi,
    Can anyone help me with my scenariou2026.I am trying to restrict the absence data being loaded into the cube where the absence is less than or equal to twenty.
    Firstly I put in a start routine in the update rules against actual time.
    DELETER DATA_PACKAGE WHERE  DUR_ACTUAL GT 20
    But this didnu2019t work.
    Secondly I put this code in the change routine for the key figure actual time
    IF RESULT GT 20.
      RETURNCODE = 1.
    ELSE.
      RETURNCODE = 0.
    ENDIF.
    But all the actual time fields were set to 0.
    Can anyone please help with the correct code.
    Thanks
    Forhad

    It is hard to say without debugging your code, and inspecting the input package.  Maybe you just need quotes around your values, or something simple like that.
    But did you know that it is faster to put a filter in a DTP?  Using a filter, you're pushing the criteria down to the SQL WHERE clause, and limiting the amount of data.
    And, you're eliminating the need for ABAP.
    Sorry, if you're not on BI7, disregard, because you don't have DTPs.
    Edited by: Jerry Coleman on Jan 29, 2009 10:05 AM

  • Index used or not for selecting data from ODS in a start routine

    Dear friends,
    In the start routine of the update rules to a cube, I am reading some data of an ODS in to an internal table .
    The ODS is indexed. But, I am not sure if the index is at all used in the Select statement (that gets the data from ODS to the internal table in the start routine) while loading data to the cube.
    Any help is highly appreciated.
    regards,
    atlaj

    Hi Atlaj
    You can findout this is display execution plan for SQL statement in DB02.
    Goto DB02. and under diagnostic, you find explain. Select that and enter your query. Make sure that everything here is in capital format. Below is a sample query which I have entered.
    SELECT "CRM_SALORG" "SALESORG" FROM "/BI0/QORGUNIT"
    WHERE "SALESORG" = ? AND "OBJVERS" = ? AND "DATETO" >= ?
    AND "DATEFROM" <= ?
    The select parameters should be inside qoutes and in caps and even the from table. Once you enter your query in this format, click on explain. It will show the index scan if the index is present. the output for my query will be something like
    0 SELECT STATEMENT ( Estimated Costs =  1,348E+01 [timerons] )
            1 (COOR) RETURN
                2 (    0) TQ
                    3 (    0) FETCH /BI0/QORGUNIT
                        4 (    0) IXSCAN /BI0/QORGUNIT~Z1
    Where my last statement (line 4) is showing index scan and the name of index read is Z1.
    Hope this helps.
    Please let me know if you have any problems entering the query in the specified format and u get any error.
    Regards
    Sriram

  • How to delete data from a DSO using start or end routine

    Is it possible to delete records from a DSO in the start or end routine.
    My example:  I have order 123, item 10, sched line 1.  This gets loaded into the DSO.
    Next day I have order 123, item 10, sched line 2 coming in.
    I want to delete the first one (with sched line 1) from the DSO and load the second one (with sched line 2).
    Can code be put in the start or end routine to do this?

    unless I can do it within the start routine I don't want to have to create new records.
    In the start routine I am comparing records coming in with what are already in the DSO.  If there is a match on order and item and the sched line is different, then I want to delete the record from the DSO and load the new one.  Is there code that I can put in a start routine to accomplish this?

  • How to use Start Routine for this requirement

    Hello,
    I am having data in 2 ods and should load that data into cube, but there isn't any common object in both the ods's. I need to analyze based on these ods objects. so I thought of pulling some objects into 1ods which are used for analysis and added some objects to ods and cube. Now I have to write a start routine in update rules to fetch the data from the info objects which are present in another ods. Can any one help me in this?
    Rajesh.

    Hi Surya,
    Extract all info from table BKPF
    select * into it_bkpf
    from bkpf
    where gjahr = p_fisyr.
    Select record based on internal table it_BKPF
    The reason why FOR ALL ENTRIES syntax is used because of its cluster table.
    select * into it_bseg
    from bseg
    for all entries in it_bkpf
    where bukrs = it_bkpf-bukrs
    and belnr = it_bkpf-belnr.
    Delete duplicate record based on Company Code and GL No.
    delete adjacent duplicates from it_bseg
         comparing bukrs belnr.

  • Current Date in Transfer Rules Formula Editor

    Hi!
    Anyone aware how to get todays' date in the Transfer Rules Formula Editor?
    Aim is to calculate ones actual age based on a given birthday-month-year using the dateDifference function.
    Cheers

    Hi,
    The summary of both posts:
    Use a formula
    DATE_DIFF( SYST-DATUM, BDAY)
    As you understand, the difference will be in days.
    Best regards,
    Eugene

  • Update two ODS using Start routine

    Hi Experts,
    I have two DSOs, One for 0MATERIAL_ATTR and another for 0MAT_SALES_ATTR. My requirement is to write a start routine while updating to YMAT_SALES_ATTR DSO which has a reference of Material from the YMAT_ATTR DSO. The material DSO is already loaded.
    I have a written the Start routine for it. Now I have to Load the Materials to another Error DSO(YSALES_ERR) when the reference is not found. I have to rewirite the same start routine to update another DSO with the above condition.
    I would appreciate some help.
    Thanks,
    Seema

    Hi Brian,
    The Data is already in the first DSO layer where it just acts as a Passthrough. The scenario here is the Material master data and  Materials with sales master data are loaded to the first layer . Then the Materials are loaded to the second layer. We must load the Material sales to the second layer only when it has reference  to  Material(2nd layer) . I have written the Start routine. But still the start routine misses to catch the bad ones.
    Please help me with the code..
    Thanks,
    Seema

  • M or P master data table  to be used in routine read statement

    Hi
      I update of a DSO i had a requirment for a routine to get the Attribute of a Infoobject.
      So which master data table  M or P table i need to use in my read statement and why
    Thanks

    Use M table as it it the view on time dependent(P table) and time independent(Q table) tables.
    M table is view on time dependent and time independent attributes, you can see characteristic values and all the attributes for the Characteristic.
    The tables that go in the view are the Master Data Table and the Time-Dependent Master Data Table. If the characteristic only has time-dependent attributes, only the time-dependent master data table goes in. If the characteristic has only non-time-dependent attributes, only the master data table goes in.

  • Date Format conversion in the Start routine

    Folks,
    i have a simple requirement and just wondering how to acheive this?
    We have a DSO object, feeded by a flat file. File contains Contract date and End date. In the target DSO we have an object called Status, which is dependant on both the date fields but the problem here is dates are coming in different format from the flat file.
    The format is 01-Jan-2010 ( Standard format is 20100101 ).
    I need to convert them to the standard format before calculating the status.
    any simple method to achieve the above?
    appreciate your timely help.
    Thanks.
    ST.

    Hi Satish,
    Use the SDATE Conversion Routine. Please go through the below link:
    http://help.sap.com/saphelp_nw04/helpdata/en/07/d63a68db9110459d63c495b16f522e/frameset.htm
    Hope it Helps,
    Thanks,
    Amit Kr.

  • Splitting formula in transfer rules using sub string

    Hi Friends,
    I used function module in formula using posting date but again I need to split this to get appropriate answer using substring.
    Now I am getting result as 20084. here 4 is fiscal quater.
    But I need only 4.For that I have to use substring.
    Anyone please help me to get output.
    Thanks,
    Devi

    Reddy,
        Try dividing the number several times.
    i.e divide the number by 10000 and store it in a result variable and then divide the result with 10000 again. Thsi should effectively divide the number by 100000000.
       Hope this helps....

  • Remove Blanks by using start routine

    InfoObject A: lengh 12 char  Conversion routine = blank
    InfoObject B: Lengh 15 char Conversion routine = blank
    The source file Item.csv contain 10 blanks for InfoObject A, for example "          02"
    and 12 blanks for InfoObject B. "            898"
    Is any way to remove those blanks? Thanks!

    How about this...
    Global Declarations
    CONSTANTS: c_gbp(3)  TYPE c VALUE 'GBP',
               c_rub(3)  TYPE c VALUE 'RUB',
               c_teru(4) TYPE c VALUE 'TERU'.
    DATA: t_tcurr        TYPE HASHED TABLE OF tcurr
                         WITH UNIQUE KEY mandt kurst fcurr tcurr gdatu,
          wa_tcurr       TYPE tcurr,
          l_datc(8)      TYPE c.
    Routine
    LOOP AT source_package
      ASSIGNING <source_fields>.
      CONVERT DATE <source_fields>-posting_date
        INTO INVERTED-DATE l_datc.                                 "Converts Posting Date into 9s Complement Date
      SELECT SINGLE
      FROM
        tcurr
      INTO
        wa_tcurr
      WHERE
        kurst EQ c_teru
        AND fcurr EQ c_gbp
        AND tcurr EQ c_rub
        AND gdatu GE l_datc.
      IF sy-subrc EQ 0.
        <source_fields>-amount_b = <source_fields>-amount_a * wa_tcurr-ukurs.
      ENDIF.
    ENDLOOP.

  • RSUPDINFO does not contain transfer rules CODEID's

    I did the following:
    1)  Go into table RSAABAP and got all the CODEID's for my search string.  
    2)  Take those CODEID values and use them as a filter for table RSUPDROUT.  No entries came back which tells me that these CODEID's are NOT for update rules.
    3) Tables RSUPDROUT and  RSUPDINFO only contain update rule code and not transfer rule and not start routine code.
    Where can I get the same info as table RSUPDINFO for transfer rule and start routine CODEID?  Any input would be very much appreciated. 
    I am trying to come up with a list of transfer routines, update rules and start routines that contains a certain search string. I can get the list of CODEID from RSAABAP table but based on the CODEID alone, I can't locate the name of the cube, infosource, etc. if the CODEID is not an update rule.

    A.H.P.,
    Thanks - almost there because of your help! I executed SE16 for table RSRSRULES and entered CONVROUT_L = 10 CODEID's and got back only 4 CODEID's back.  Why didn't it show me  records for all the 10 CODEID's I entered?
    This table holds transfer rule info, do you know what table holds start routine code?  Maybe the 6 missing CODEID's are start routines and are held in a different table.
    (I switched company so that why was I had to create another SDN user ID).
    Thanks,
    Thao

  • Start Routine for transfer rules

    Hello experts,
    I want to use the SQL DISTINCT keyword to return non-duplicate results from a table in a DataSource (data base) in a the start routine for the transfer rules.
    How do I address that table in the start routine of the TR?
    I thought about something like that.
    TABLES: mytable
    DATA: itab_mytable type table of mytable
    SELECT DISTINCT CUSTID, etc.
    FROM mytable into table i_tab.
    I am new to ABAP so I would be happy to get some suggestions!
    thanx in advance
    Axel

    Hello Oscar,
    as fa as I understood the entire data package in the transfer structure format is used as parameter (DATAPAK) for the routine.
    so I want to perform a SQL statement on DATAPAK!
    But it sais it can't find DATAPAK in ABAP-Dictionary as a table!
    can I actually perform SQL statements on DATAPAK?
    Thanx
    Axel

  • Debugging: start routine in transfer rules

    Hi !
    can you please tell me how to debug start routines  and field routines in transfer rules?
    If possible please tell me too debugging of update rules.

    Hi Rajib,
    Go to the monitor -> Details tab -> Processing -> Choose the datapackage you want to debug -> Right click -> Simulate update -> Choose eather activate debugging in transfer rules (to debug in transfer rules) or debugging in update rules(for start routine and update rules).
    You can mention the number records you want to debug also, if you have an idea of which records you want to debug you can give the number of that record.
    Once the debug screen comes up, press F8...the control stops at first break point...from there you can do a step by step debugging (F5).
    Hope this helps...
    Regards,
    Kalyan

Maybe you are looking for

  • How to get a reference to a Project Library?

    Hello DSC 8 users, In my project I have couple project libraries ( *.lvlib) defined, containing only shared variables. I want to logg those variables to Citadel, but I need to programmatically set datalogging properties for each library, like Databas

  • GLline items &  F.01 Balance sheet / P+L Statement

    Hi Guru's, If I run F.01 transaction for a bank account at the end of October; balance XXXXXXX when I run  FBL3N transaction for the same bank account I am seeing a slight difference XXXXXYYY. Both FS10N cumalative balance at the end of October & FBL

  • Which color profile to use, if any, for web?

    Hi, For years, I've been accustomed to saving JPGs for web use by including the sRGB color profile. However, I now realize that IE either discards color profiles, or forces a new one on them (took me this long to notice because while I always proof-c

  • ME21 PO User Exit

    Hi, Can any one help me for user exit in t-code ME21N  PO. I want get the Vendor Telephone from and update it in Communicatio tab at header level when  I enter a value For Vendor field. Please help me out in this

  • I was uploading photos to iPhoto from memory card and the program froze

    I was uploading photos to iPhoto from memory card and the program froze. I can't get rid of it and it won't respond to anything. Even restarted computer and it's still there.   I can continue using computer for other things, but can't get out of iPho