Guide me write Start Routine

Dear One's -
I have a scenario to be implements in my ODS update rules,
The code has to check if all available LEAD PROGRAM DEFINITION of particular LEAD NUMBER (as available in ODS) are also present in the corresponding data_package or not.
If it does not find particular LEAD PROGRAM DEFINITION  in the data_package (but it is there is ODS) then it has to creat one record in data_package for that LEAD NUMBER and LEAD PROGRAM DEFINITION making all Key figures as "zero". It then overwrite existing value in ODs with zero value.
This start routine has to written because the deleted record in source system is not transfered to BW system.
Can any one kindly take a moment in writing the code.
Thank you so much in advance,
Raj

Dear Edwin,
We are using Generic Data Source and the situation is we must write the start routine because there was already a routine written under other Invoice Moment ODS that is happening successfully. But this is new requirement for Resource ODS.
I have written a similar routine to Resource ODS like Invoice Moment ODS but this not giving expected result.
So, can you kindly write a routine in your own logic?
We have given with Lead Number, Lead Program definition as characteristics and key fingure as Lead Estimated Resources that's all only 3 infoobjects were used.
Thanks for your concern and extend the same in writing the code.

Similar Messages

  • Update Routine & Start Routine in BI 7.0

    Hi Experts,
    We have recently upgraded from BI 7.0 , I am confused about where to write start routine & update routine in transformations of BI 7.0?
    Please mention any pointers?
    Thanks.
    Sharat.

    Hi
    When you open the start routine you will see a routines info which gives you help on this.
    A summary would be:
    Update routine in transformation.
    RESULT = source_field-material.
    Basically you can acess the value of the record by using source_field.
    Start routine.
    The data comes in the form of an internal table with name SOURCE_PACKAGE.
    You can access the values by looping into a work area.
    LOOP AT SOURCE_PACKAGE assigning <source_fields>.
    ENDLOOP.
    End routine(This is a new feature in BI 7.0 where you can modify data when transformations are complete and before data is updated to info-providers)
    The data comes in the form of an internal table with name RESULT_PACKAGE.
    You can access the values by looping into a work area.
    LOOP AT RESULT_PACKAGE assigning <result_fields>.
    ENDLOOP.
    Hope this helps you to understand the basics of the abap used in the transformations .
    Regards
    Samarpita

  • Start routine in DSO Self transformations

    Hi SCN,
    I need to write start routine to fill one of my target feild.
    Here my info object is ZCust and attribute zpur_grp
    My DSO have 0customer and zpur_grp.
    Am creating self transformations for my dso and need to fill zpur_grp from zcust if dso-zpur_grp is blank.
    condition is dso-0customer = info object-customer.
    Am new to abap code part and confused about specifying fields and tables(/bic/).
    Need suggestions to write sample format code.
    Thanks in advance.
    Chandra

    Hi Chandra,
    U need to write look-up code.
    Below s sample code. it might be help you.
    Declare Internal Table Like follow:
    TYPES: BEGIN OF TY_CUST,
                      ZCust TYPE /BIC/ ZCust ,
                      zpur_grp TYPE /BIC/ zpur_grp
                   END OF TY_CUST.
    select value for internal table.
    SELECT /BIC/ ZCust /BIC/zpur_grp
           FROM /BIC/PZCust
           INTO TABLE IT_CUST
           FOR ALL ENTRIES IN SOURCE_PACKAGE
           WHERE /BIC/ZCust = SOURCE_PACKAGE-/BIC/0customer
           AND OBJVERS = 'A'.
    Then write Lookup code in start routine.
    LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
           clear : WA_CUST_DBDIV.
    * Read internal table for customer
           READ TABLE IT_CUST
           WITH KEY ZCust = <SOURCE_FIELDS>-/BIC/0custome
           INTO WA_CUST_DBDIV
           BINARY SEARCH.
    *Populate the corresponding Customer and DB Division in RESULT_PACKAGE
           IF SY-SUBRC = 0.
             <SOURCE_FIELDS>-/BIC/0custome = WA_CUST_DBDIV-ZCust.
             <SOURCE_FIELDS>-/BIC/zpur_grp = WA_CUST_DBDIV-zpur_grp.
    ENDLOOP.
    Hope it 'll help you.
    Regards,
    Mukesh

  • BI 7 Delete in Start routine

    Hi,
    I want to write start routine in BI 7 transformation to delete records.
    Can somobody please tell me eaxct command to delete records.
    Thanks
    Shilpa

    Hi
    go to start routine and write in the global area
    delete data_package where field name equal to (=,eq) or not equal to (ne) value.
    lets say field name is X and value ab.and i want to delte records where x = ab
    then the delete statement will be
    delete data_package where x = 'ab'.
    but if asked to delte x = ab, zb,cv and so on
    delete data_package where x = 'ab',
                        and   x = 'zb',
                        and   x = 'cv'.  
    only if the value is alphanumeric or jst alphabets it comes betwnn single quotes ' '.
    else if its number value it comes directly widut single quotes
    equal to can be wrten in two ways = and eq and
    not equal is ne.
    there will be a fullstop at the end of the delete statement
    hope it helps asign points if aplicable
    thanks
    puneet
    Message was edited by:
            Puneet Chawla

  • Start routine at update rules.

    Hi all,
    I am working with Sales schedule line data.
    Data flow is R/3 -
    DSO----CUbe.
    I have to load all the data for all sales organizations till DSO.
    From DSO to CUbe I have to load the data only for 4 sales organizations.
    I am planning to write Start routine in the update rules.
    Could any body Please help me with code..
    REgards,
    MAdhu

    Place this code in your start routine:
    *remove sales organization, assume this is a standard infoobject
    this deletes all data except for the 4 sales orgs
    DELETE DATA_PACKAGE WHERE NOT ( /BI0/0SALES_ORG = 1 OR
                                                                   /BI0/0SALES_ORG = 2 OR
                                                                   /BI0/SALES_ORG = 3 OR
                                                                   /BI0/SALES_ORG = 4 ) .
    Also put restrictions in your infopackage, even though its redundant.

  • How to write a start routine in the trasnformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi,
                Yopu can write the below lines of code adn try
        SORT source_package BY Receive nr  Type ASCENDING.
        DELETE ADJACENT DUPLICATES FROM source_package COMPARING Receive nr  Type.
    But you should make sure which record of the either rows need to deleted
    i.e in
    F9001;LU;J001;662;
    F9001;LU;J002;662
    You need to decide to eliminate 1st or 2nd one.(depends on your requirement)

  • How to write the start routine in the transformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

  • What to write to filter in start-routine.

    Hi Experts.
    What do I write in the Start-routine (in version 7) to filter out lines where a certain field is empty ( initial).
    Thanks !

    Dear Ingrid,
    Please refer to the following help.sap.com link:
    http://help.sap.com/saphelp_nw70/helpdata/en/43/c3963dfbde4dede10000000a422035/content.htm
    and below is the example from the link:
      METHOD start_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <SOURCE_FIELDS>    TYPE tys_SC_1.
    $$ begin of routine - insert your code only below this line        -
      DELETE SOURCE_PACKAGE where UMHAB = 0 and UMSOL = 0
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "start_routine
    Hope it help you, assign points if helpful.
    Best Regards,
    Ankit Agrawal

  • Start routine to check for BUDAT in 2LIS_02_SCL

    HI,
    I'm pulling data from 2lis_02_scl and 2lis_02_acc datasources into an ODS. I want to write a start routine that will check if there is any value for BUDAT field (posting date) in the 2lis_02_scl datasource. I want to get data into the ODS only if this field is filled.
    I want to write a start routine for it, but don't have any experience in ABAP.
    Would anyone guide me in writing this routine?
    Regards,
    Sam

    Hi,
    After looking around, i found that the solution is pretty simple.
    All I had to do was to write a single line in the start routine.
    DELETE DATA_PACKAGE WHERE PSTNG_DATE = 0.
    0PSTNG_DATE is the object that is linked to BUDAT in the transfer rules.
    Sam

  • Need help in ABAP coding in start routine

    Hi,
    I have a requriement like
    -To take the value of month which is an attribute of category(info Object) for which category value is 1. I need to apply the month obtained as the filter to another info object. I have opted to write this ABAP code in start routine. Can anyone guide me on this code.
    Thanks in advance.

    do you not have an abap-er at your disposal? i don't imagine this to be quick & dirty that can be written without access to your system! some analysis work may also be required before the actual coding can be done...so I wouldn't post the entire functional spec (business requirement) here hoping for a solution; that would be too weird.
    Regards.

  • How to debug start routine for the custom code?

    Hi Experts,
    Can anybody tell me how to debug the start routine? Also could you please guide me where to write the custom code in the start routine.
    Thanks in advance.
    Sharat.

    Rajkumar,
    Thank you for your help. but the blog link that you send it to me does not mention anything about ABAP debugger screen.
    What should I do once I get in to the ABAP debugger? the link only tells how to get to the ABAP debugger that I know.
    Also it say that I have to use the infinite loop to debugg the start routine.
    Can anybody tell me how to debugg start routine with the scren shots please. I don't know how to use infinite loop in the start routine. Is their any easy process step by step to see my particular record behavior in the start routine?
    I will assing you the points. again thank you.

  • Start routine and update rules

    Hi,
    What is accessed first:-
    Start Routines or Update Rules?
    What is the use of global variables in start routine?
    Please reply.
    Thanks.

    Hi......
    You have different types of Routines in BW .
    1) Start Routine in Transfer Rules
    2) Transfer Routine in Transfer Rules.
    3)Start Routine in Update Rules
    4)Update Routine in Update Rules.
    The routines that you write in transfer rules are applicable to all the Data targets that get the data from that particular Infosource, when you are going to write some code in Transfer rules, you have to understand that you are going to manupilate the data that is going to get into BW .
    If you are going to write in Update Rules , then that logic is going to apply only for that particular Data target .
    Eg : Let suppose I have a Flat file that gets data from 3 countries, US, Canada and Mexico.
    Now I have prepared the data source for the same . But I dont want to have the data of Mexico in to BW itself.
    So I will write a Start routine at TR to eliminate the data of Mexico.
    My Next step is I want the data of US into one ODS and Canada data in to another ODS.
    For this I handle the dataflow at Start routine in Update rules, to eliminate Canada data for US ODS and Vice Versa.
    Global variables in Start routine
    You can have global variables, internal tables populated by the
    startup routine. This data will be available to the field
    routines. Create yourself a start routine, declare some
    variables in the global section, and then create a field
    routine. You will be able to use the globally declared objects
    in the field routine
    Please check below help link for routines in sap netweaver 2004s
    http://help.sap.com/saphelp_sem60/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
    How to guide "How to transformations routines".Please check the below link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/dc1d9990-0201-0010-16aa-db3c4eb8b642
    start routine in transfer rules
    Look up to load master data
    excluding
    Start Routine in Transfer Rules
    Sample code in Update Rule to restrict data selection?
    Append Datapak - transfer start routine
    Excluding Blank field in Infopackage Filter
    Trans Routine ABAP help ..
    transfer routine
    Date key figure: Convert DATS format to DEC format
    Date Conversion in Flat File
    Transfer Routine ABAP
    conversion exit
    Date Conversion
    Problem with  conversion char to numc in transference rules
    conversion routine..?
    update routine
    How to call a function in Update Rules to reverse a key figure sign
    Need Sample Code for Update Rules
    Date calculation
    Difference between data in PSA and Data in Infocube
    No RETURNCODE <> 0 allowed in update routines in transfer mode
    the diffrerece between DEC and (yyyymmdd) 8 char in Time defination
    Access master data in update rules
    Date key figure: Convert DATS format to DEC format
    start routine in update rules
    Is it possible to read a third ODS in update rules between two ODS?
    update rule coding while loading data from ODS to CUBE
    Start Routine in Update Rules to populate additional fields from ODS
    Coding in Update Rules accessing a Z-Table
    Start routine
    Hope this helps you..........
    Regards,
    Debjani.........
    Edited by: Debjani  Mukherjee on Oct 1, 2008 4:58 PM

  • Start routine..where RECORDMODE=blank i the psa.

    Hi Friends,
    while loading data from PSA to DSO,i am getting an error in the dso, saying that got duplicate records in the psa, but we don't have any duplicate records.
    my question is to load the data in to the DSO, i need to write a start routine where it should pick from PSA only the records whcih RECORDMODE=blank.
    could u guide me how to write it pls.
    Thanks in advance.

    Hi follow this code
    this will work surely.
    Loop at DATA_PACKAGE.
    If DATA_PACKAGE-RECORDMODE NE ' '.
    DELETE DATA_PACKAGE WHERE RECORDMODE NE ' '.
    ENDIF.
      ENDLOOP.
    Regards
    Ram

  • Start Routine in Transformations

    Hi,
    For my reporting purpose i need to Transfer data from Cube to DSO
    I need a start routine for the following requirment when transfering data from Cube to DSO
    The Key fields in DSO are Location & Emp_ID and Date fields are ZAP_DTE (DATS)
    CUBE-->DSO
    While doing the transfer...i need to compare Emp and his ZAP_DTE AND need to transfer only if AP_DTE for that EMP is greater than the exisisting one else ignore the record
    As i new to BW please update with the routine
    Thanks

    Hi Shambhu
    We usually write out code in the section:
    $$ begin of routine - insert your code only below this line        -
    What is the difference between writing the code in
    $$ begin of 2nd part global - insert your code only below this line  *
    and
    $$ begin of routine - insert your code only below this line        - ?
    Kind regards
    Erik

  • Can we use Perform statement in start routine ,Form and endform.

    Hi,
    Can we use Perform statement in start routine ? Then write the ABAP code between Form and Endform.
    Example : Can I use Perform ABC in start routine. Then define ABC at the end of start routine.
          Form ABC,
          ......<ABAP> code .....
          Endform.

    Hi,
    In BI 7.0 we have start routines defined using Class where you might be able to create your own performs, but in case of BW3.5 Start routines are defined using Form so there I don't think it will allow you to create one more form.
    But you can surely try both the approaches.
    Reards,
    Durgesh.

Maybe you are looking for