What is the logic behind the start routine

Dear One's,
Kindly take a moment and explain the logic behind this start routine written in update rules of ODS.
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line  -
$$ end of global - insert your declaration only before this line   -
The follow definition is new in the BW3.x
TYPES:
  BEGIN OF DATA_PACKAGE_STRUCTURE.
     INCLUDE STRUCTURE /BIC/CST_T07_O006.
TYPES:
     RECNO   LIKE sy-tabix,
  END OF DATA_PACKAGE_STRUCTURE.
DATA:
  DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
       WITH HEADER LINE
       WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
FORM startup
  TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
           MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
           DATA_PACKAGE STRUCTURE DATA_PACKAGE
  USING    RECORD_ALL LIKE SY-TABIX
           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
  CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line        -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries.
DATA: ITAB_/BIC/AT07_O00600 TYPE SORTED TABLE OF /BIC/AT07_O00600
      WITH HEADER LINE
      WITH UNIQUE DEFAULT KEY INITIAL SIZE 0,
      DATA_PACKAGE_NEW TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
      WITH HEADER LINE
      WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
sort the datapackage based on lead number and lead program definition
SORT DATA_PACKAGE BY /BIC/TLDNR /BIC/TLDPRGFTE.
from the resources ODS read all lead values based on the values those
SELECT * FROM /BIC/AT07_O00600 INTO TABLE
         ITAB_/BIC/AT07_O00600
         FOR ALL ENTRIES IN DATA_PACKAGE
         WHERE /BIC/TLDNR = DATA_PACKAGE-/BIC/TLDNR.
FIELD-SYMBOLS: <LS_DATA_PACKAGE> TYPE DATA_PACKAGE_STRUCTURE.
FIELD-SYMBOLS: <LS_/BIC/AT07_O00600> TYPE /BIC/AT07_O00600.
loop at internal table of ODS to check if there are lead program defin
from the source which mean the values of lead program definition in OD
values of lead program definition in datapackage.
   LOOP AT ITAB_/BIC/AT07_O00600 ASSIGNING <LS_/bic/at07_o00600>.
     READ TABLE DATA_PACKAGE
      TRANSPORTING NO FIELDS
      WITH KEY
      /BIC/TLDNR = <LS_/bic/at07_o00600>-/BIC/TLDNR
      /BIC/TLDPRGFTE = <LS_/bic/at07_o00600>-/BIC/TLDPRGFTE
      BINARY SEARCH.
      IF SY-SUBRC <> 0.
new lines with zero values are inserted because there are no correspon
DATA_PACKAGE_NEW-/BIC/TLDNR = <LS_/BIC/AT07_O00600>-/BIC/TLDNR.
DATA_PACKAGE_NEW-/BIC/TLDPRGFTE = <LS_/BIC/AT07_O00600>-/BIC/TLDPRGFTE.
  DATA_PACKAGE_NEW-/BIC/TLDFTE = 0.
  APPEND DATA_PACKAGE_NEW.
     ENDIF.
  ENDLOOP.
append the new records which are created for the leads in the datapack
  APPEND LINES OF DATA_PACKAGE_NEW TO DATA_PACKAGE.
reset the sorting of the datapackage back to its original state
  SORT DATA_PACKAGE.
if abort is not equal zero, the update process will be canceled
  ABORT = 0.
$$ end of routine - insert your code only before this line         -
ENDFORM.
Thanks in advance

hi,
it's retrieve data from table /BIC/AT07_O00600
and add to data package, so your records will be more than from source
hope this helps.

Similar Messages

  • How do you identify the Logical system in start routine of a transformation

    My scenario is this.  I have five r3 systems that I am extracting from.   In the start routine of the transformation from the r3 data source to my data store I  am going to delete data and I need to know the source system id.    How do I identify the logical system or source system id in the transformation.  Is there a system field that contains this information.    I do not want to hard code the source system id in the routine.

    hi
    have a lool at tables rsreqdone and rsbkrequest with a join you should be able to determine the source.
    regards
    Boujema
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).
    Edited by: Boujema Bouhazama on May 9, 2008 12:04 AM

  • 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

  • The field "SOURCE_PACKAGE" is unknown IN THE START ROUTINE?

    Hi all,
    i am trying to create a start routine in the DTP FROM THE CUBE TO THE OPEN HUB.
    But when i check the syntax : it throws me an error message stating.
    The field "SOURCE_PACKAGE" is unknown IN THE START ROUTINE?
    how come the source package is unknow in the start routine can anyone pls advise  me on this!!
    DATA: l_tabix TYPE sy-tabix, wa_source_package TYPE tys_sc_1.
    LOOP AT SOURCE_PACKAGE INTO wa_source_package.
    l_tabix = sy-tabix.
    IF wa_source_package-SALES EMP EQ ' '.
    DELETE SOURCE_PACKAGE
    WHERE SALESEMP EQ ' '.
    INDEX l_tabix.
    ENDIF.
    ENDLOOP.

    Hi Pooja,
    I think that the error comes from the delete statement.
    As you already said, the SOURCE_PACKAGE is from BI7.0. That means that the LOOP AT statement cannot be wrong (although I prefer field-symbols)
    I would restate you code like below:
    DATA: l_tabix TYPE sy-tabix,
          wa_source_package TYPE _ty_s_sc_1.
    LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.     "<source_fields> is declared as line from source_package
    * l_tabix = sy-tabix.
      IF <source_fields>-SALES_EMP IS INITIAL.
        DELETE <source_fields> FROM SOURCE_PACKAGE.
    * If this line does not work, try to add TABLE after the FROM-statement
    *WHERE SALESEMP EQ ' '.
    *INDEX l_tabix.
      ENDIF.
    ENDLOOP.
    Hopefully this will help.
    Alternatively you can try a single statement, because it is not necessary to do a loop.
    DELETE SOURCE_PACKAGE WHERE sales_emp IS INITIAL.
    Good luck!
    Steven Groot
    Edited by: S. Groot on Aug 11, 2010 7:50 AM

  • BW7.3 SOURCE_PACKAGE and DATA_PACKAGE are incompatible in the Start Routine

    Hi Gurus,
    a face a strange behavior with BW7.3 and the Inventory Cube 0IC_C03:
    the standard scenario works well when I activate the cube and its transformations ..bx, bf and um. Then I have modified the InfoCube 0IC_C03 and added some field like 0customer or 0doc_number etc. I also added the fields to the InfoSource 2LIS_03_BF_TR and everything was as usual.
    Then I wanted to activate the transformation TRCS 2LIS_03_BF_TR -> CUBE 0IC_C03 when I had the error
    "E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter "SOURCE_PACKAGE" is incompatible with the formal parameter "DATA_PACKAGE".
    I already tried to copy and paste the structure of tys_SC_1 to tys_SC_1_full but whenever I activate the transformation my changes are dropped while the error remains. I assume, that the problem is due the compilation process.
    Any hints to solve the problem? Thank you in advance.

    Hi Cemal,
    When we do the modifications at times the field structures inside the start routine are not update so that updation is required to be done manually. Copy the field list of structure (inside the start routine)  tys_SC_1 (this is gryed out i.e. change disabled) and paste the same structure to tys_SC_1_full & tys_TG_1_full.
    Check the routine and save it.
    Hopefully it will solve your problem.
    Regards,
    Dipika

  • (BW) Run the Start Routine Only Once

    I understand that for every data package from ODS to Cube, the start routine is run.  But I need to run it only once.  Is there anyway to achieve this in ABAP?

    I once had that same requirement, but in a datasource in R3. I'm not sure if the same solution would work in BW, though. I used a memory id to keep the variable value between packets:
    DATA: ... n_globalvar TYPE n ...
    then I added...
    IMPORT n_globalvar FROM MEMORY ID 'ZMEMID01'.
    ...at the start of the routine to retrieve to the variable the value from the memory id.
    At the end of the code, I exported the variable back to the same memory id...
    EXPORT n_globalvar to MEMORY ID 'ZMEMID01'.

  • Poplulate key figure thru the start routine

    Hi Experts,
    I have update rules for my cube. In the start routine there, if i wrote abap code would it automatically fill the value of key figures in the cube. Can we do that with the ABAP code ?
    Or do i have to go to each key figure's routine and then refer to the internal table data in the update rules etc.
    If someone has done this before, would you pls walk me thru it.
    Thank you,
    T

    Hi Tia Ismail,
    I hope it is wrong to update the cube fields directly in the start routine.
    i,e
    <i>add DATA_PACKAGE-/bic/zslsgm to /bic/ft_mismets-/bic/Zslsgm.
    add DATA_PACKAGE-/bic/zsalesamt to /bic/ft_mismets-/bic/Zsalesamt.
    add DATA_PACKAGE-/bic/zinvlines to /bic/ft_mismets-/bic/zinvlines.</i>
    The above statements are wrong.
    Then start routing you will update the values (from blank to some value) for these fields. And also make 1 to 1 mapping Between these KF of info cube to Fields of Communication structure. i,e
    Zslsgm(Info cube KF) <---> Zslsgm(Communication structure field)
    Zsalesamt(Info cube KF) <---> Zsalesamt(Communication structure field)
    zinvlines (Info cube KF) <---> zinvlines(Communication
    structure field)
    The code you have to use in Start routine is :
    tables: /bic/pzproduct,
    /bic/ft_mismets.
    DATA ITAB like /bic/pZproduct occurs 0 with header line.
    select * from /bic/pzproduct into table itab where /bic/zproductlike 'misc%' and /bic/t_miscper is not null.
    Loop at DATA_PACKAGE.
    Loop at itab where
    /bic/zproduct <> DATA_PACKAGE-/bic/zproduct.
    DATA_PACKAGE-/bic/zslsgm = 0.
    DATA_PACKAGE--/bic/zinvlines = 0.
    DATA_PACKAGE-/bic/zsalesamt  = 0.
    Modify DATA_PACKAGE.
    endloop.
    ENDLOOP.
    With rgds,
    Anil Kumar Sharma .P
    Message was edited by: Anil Kumar Sharma

  • Diff between the Start routine and Update rules?

    Hi Gurus
    Diff between the Start routine and Update rules?
    Thanks in advance
    Raj

    Hi,
    Routines are like conditions or business rules that could be applied to filter the data while entering the BW system or could be used to apply certain conditions on the info objects itself.Update rule level you manipulate your data and  write your start routine.
    There are 4 types of routines
    1. Start routine- Could be used at two levels (transfer rule level and the Update rule level)
    This Start routine written at the transfer rule level helps filter the necessary data coming from the source system.
    For Example: If you decide to extract data that contain only quantity greater than 500 , then you could specify the Start rouitne to achieve this.
    The Start routine at the Update rule level provides similar functionality but at this point it helps direct specific data to 
    different data targets.  For Example: If there 3 data targets being fed from the Infosource, you may want to apply some condition to each data target, like send year 2000 data ti Data target1, 2001 to data target 2 and so on.  This can be achieved by using Start routine at the Update rule level
    2. Transfer Routine: This feature is available at the transfer rule levels
    While performing the transfer rules operation, there are 4 features available to the developers to create business rules on top pf the Infoobjects.
    1. You could do a one to one mappping of the Infoobject
    2. Provide a constant value
    3. Include a formula
    4. Write an ABAP routine.
    These 4 options refers to the transfer routine
    3. Update Routine:
    The limitations of just having 4 options in the transfer routine is overcome at the update rule level. There are various other 
    sophisticated features avaialable apart from the 4 options mentioned above. These business rules could be specified pertaining to each data target.
    4. Conversion Routine: It provides functionality to do Currency and unit conversion.
    Regards.

  • Not able to debug the start routine

    Dear All,
    I am facing a weired situation.
    I have a transformation(DSO -> Cube) with start routine. I am able to debug the routine in Development System.
    I transported the routine to Production System successfuly, but i am not able to debug the start routine there. I have all the necessary authorisations(SAP_ALL, SAP_NEW)
    I am perplexed. Never seen such issue before.
    Can someone help me here?
    Regards,
    Avinash.
    Edited by: Avinash Kumar on Nov 5, 2008 11:16 AM

    Dear Jerry,
    Thanks for writing.
    I followed the instruction, but it didn't work.
    Can there be any technical reason for data package to be empty, even if the source has data(Note: There is no filter in DTP)?
    Also, i just checked with other start routines...I am not able to debugg there also. System is not entering the debug mode.
    Here, the patch level is: 0010. Can this be the villain?
    Please advise.
    Regards,
    Avinash.
    Edited by: Avinash Kumar on Nov 6, 2008 4:26 AM
    Edited by: Avinash Kumar on Nov 6, 2008 4:51 AM

  • What is the start frequency for the digitizer 5142

    Dears,
    what is the start and stop frequency of the digitizer 5142 which is 100MS/s?

    Hello Ahmed.Abdulbaky,
    When you say “start” and “stop” frequencies, I assume that you are inquiring about the maximum and minimum sampling rates of the 5142 digitizer.  Is this correct?  If so, then take a look at page 13 of the NI PXI/PCI-5142 Specifications, and you will see under Real-Time Sampling that the minimum and maximum sampling rates are 1.526 kS/s and 100 MS/s, respectively.
    To answer your question from your other post, yes, you can change the sampling rate of the digitizer through the NI-SCOPE API.  If you are using LabVIEW with the device, there is a VI called “niScope Configure Horizontal Timing.vi” that you can use to set the sampling rate, by wiring the desired sampling rate to the min sample rate input.  This VI can be found in the functions palette under Measurement I/O » NI-SCOPE » niScope Sonfigure Horizontal Timing.vi. 
    Chris_G
    Sr Test Engineer
    Medtronic, Inc.

  • How to start MDM?what is the starting lession of MDM?

    how to start MDM?what is the starting lession of MDM?

    Hi,
    MDM Topics:
    MDM Course Curriculum
    1. MDM Console:
    History Of MDM
    MDM Overview
    MDM Performance
    MDM Components
    u2022Server Components
    u2022Client Components
    u2022Admin Components
    Console Introduction 
    Repository structures
    Creating Repository
    Working with different types of tables
    u2022Taxonomy
    u2022Hierarchy
    u2022Flat
    u2022Qualifier
    u2022Special tables
    u2022Object tables
    Console Settings
    u2022Creating Users & Roles
    u2022Change tracking
    u2022Remote systems
    Console Security
    u2022Repository Level
    u2022Server Level
      Repository Administration
         Duplicating Repository
    Backup and Restore
    Compacting Repository
    Working with master/slave Repository
    2    Data Manager:
         Data Manager Overview
         MDM Modes:
    u2022Record Mode
    u2022Hierarchy Mode
    u2022Taxonomy Mode
    u2022Match Mode
                Validations & Workflow
                Matching Mode
         Transformations
    Rules
    Strategies
    Match & Merge
               Working with Qualifier tables
               Browser Embedding
               Relationships
               Family Mode/Layout and Publish
      3.  MDM Import Manager:
    u2022Import Manager Overview
    u2022Configure Import Manager
    u2022Import Map File
    u2022Pre-requisites for Data Import
    u2022Monitoring Import Status
    u2022Performing Data Import
    u2022Transformations
    u2022Table Joins and Lookup
    u2022Splitting fields
    u2022Building Hierarchy
    u2022Partitioning Fields
    u2022Field Mapping/Value Mapping
    u2022Value Conversion
    u2022Pivot and Reverse pivot
    u2022Batch processing
    4.  MDM Syndicator
    u2022Syndicator Overview
    u2022Exporting into diff file formats
    u2022Record Suppression
    u2022Syndication Map
    u2022Maps and Map properties
    u2022Item Mapping
    u2022Destination Items
    u2022Custom Items
    u2022Merge Items
    u2022Syndication Records
    5. Overviews:
            Master data harmonization
            Rich Product Content Management RPCM
           Global Data Synchronization
    6. Integration Scenarios:
    u2022XI Integration
    u2022R/3 Communication
    Regards
    Mahesh

  • 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

  • SOURCE_PACKAGE and DATA_PACKAGE are incompatible in the start routine.

    Hi All,
       I have seen similar posts on the forums, but none relate to my issue. Here is what I am seeing.
       I have installed a cube, DSO and transformations b/w the cube and the DSO from the business content. The transformations cannot be activated as there is the following error in the end routine...
    E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter "SOURCE_PACKAGE" is incompatible with the formal parameter "DATA_PACKAGE".
    This is a fresh installation and I have not done any changes. The delivered version code (only the relevant portions) is as follows...
    Note: I have installed the transformations(TRFN) from the business content and have not migrated the update rules(UPDR) to transformations. So, this is an out of the box issue.
    METHODS
          start_routine
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
            EXPORTING
              monitor                  type rstr_ty_t_monitors
            CHANGING
              SOURCE_PACKAGE              type tyt_SC_1
            RAISING
              cx_rsrout_abort.
    FORM routine_9998
    TABLES DATA_PACKAGE TYPE tyt_SC_1_full
      TABLES DATA_PACKAGE TYPE tyt_SC_1
      CHANGING
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    Migrated update rule call
      Perform routine_9998
      TABLES
        SOURCE_PACKAGE
      CHANGING
        l_abort.
    Any help will be appreciated.
    Thanks.

    Hi,
    just try this code.
    METHODS
    start_routine
    IMPORTING
    request type rsrequest
    datapackid type rsdatapid
    EXPORTING
    monitor type rstr_ty_t_monitors
    CHANGING
    SOURCE_PACKAGE type tyt_SC_1
    RAISING
    cx_rsrout_abort.
    FORM routine_9998
    TABLES DATA_PACKAGE TYPE tyt_SC_1_full
    TABLES SOURCE_PACKAGE TYPE tyt_SC_1
    CHANGING
    ABORT LIKE sy-subrc
    RAISING
    cx_sy_arithmetic_error
    cx_sy_conversion_error.
    Migrated update rule call
    Perform routine_9998
    TABLES
    SOURCE_PACKAGE
    CHANGING
    l_abort.

  • How do i get at the data in the data package of the start routine

    I have some very simple code in my start routine but it says data-package is not a table but it is SAP code that defines it this way.  here is my code
    SELECT DOC_NUM S_ORD_ITM CH_ON CREATEDON INTO TABLE T_ORD_BKG_DATA
    FROM DATA_PACKAGE.

    Hi,
    The data package is not a DB table, but an internal table.
    You will have to use a LOOP statement to get at all data :
        LOOP AT SOURCE_PACKAGE INTO w_SOURCE_PACKAGE.
          IF w_SOURCE_PACKAGE-myField = '98'.
          something to do
          ENDIF.
        ENDLOOP. " SOURCE_PACKAGE
    Hope that helps.
    Dieu

  • Data Source 0HR_PA_0 Syntax Error in the start routine while activating

    Hi All,
    I have migrated the Business content for the data source 0HR_PA_0
    While activating the transformation-2 there is errors like:
    Start Routine: Syntax error in routine
    Rule (target: 0HDCNT_LAST, group: 01 Standard Group): Syntax error in routine
    Rule (target: 0AGE_KYF, group: 01 Standard Group): Syntax error in routine
    .................... etc
    I need help to resolve this issue.
    Thanks & Regards,
    Savitha

    Hello Jurgita,
    When Data Source was migrated the codes related to COMM_STRUCTURE was missing in the start routinue.
    Following codes (in bold) with regard to COMM_STRUCTURE added and then got activated
    4.     *--
    5.         COMM_STRUCTURE   type tys_sc_1__rule_25,
    6.         l_subrc          type sy-tabix,
    7.         l_abort          type sy-tabix,
    8.         ls_monitor       TYPE rsmonitor,
    9.         ls_monitor_recno TYPE rsmonitors.
    10.     
    11.       REFRESH:
    12.         MONITOR.
    13.     
    14.     * Runtime attributs
    15.         SOURCE_SYSTEM  = p_r_request->get_logsys( ).
    16.         move-corresponding SOURCE_FIELDS to COMM_STRUCTURE.
    17.     
    18.     *  Migrated update rule call
    19.       Perform routine_0011
    20.       using
    21.         COMM_STRUCTURE
    22.       CHANGING
    Regards,
    Savitha
    Edited by: Savitha  Ravi on Jun 19, 2009 6:34 AM

Maybe you are looking for

  • How do I get firefox to open a new window when i click on a link in a webpage ?

    When I click on a link in a webpage in Firefox, generally it opens the new page in the window i am in (though some times it does not). How do I get it to open a new window (or tab) each time I click a link. For example, on www.bbc.co.uk if I click on

  • Start, stop and restart while loops

    Hi, my qustion is i have 2 example a and example b. Example b lets u start counting up in seconds when u want to. as long as the toggle switchs are in correct position. it also lets u start, stop and restart if need be. i want to be able to that with

  • Snow Leopard Freezes, Reboots, Crashes, Kernel Panics

    I have a Unibody MacBook Pro 15 inch, late 2008. I got it with Leopard, and I had absolutely no problems at all with it until I stupidly upgraded to Snow Leopard in September 2009. Since then my computer crashes a lot. Here is a list of problems I've

  • Need help unloading an .swf

    I'm using flash CS5, AS3 I'm making a huge module that has a central "Hub" (table of contents) which contains all links to the other slides which are individual .swf files. The issue is, from the main hub, i click on the link to open a swf and it sta

  • Solaris Studio 12.4 ccfe signal 11 with boost::unordered_set in C  11 mode

    Using Solaris Studio 12.4 on Solaris 10 update 10 x86, the following program crashes ccfe: #include <boost/unordered_set.hpp> #include <string> int main(int, char **)     boost::unordered_set<std::string> strSet;     std::string str("test");     strS