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

Similar Messages

  • Convert ABAP code in start routine/update rule to transform. start routine

    Dear BW ABAPers,
    I have created a custom purchasing info cube (YCP_PURC1) based on 0CP_PURC1 standard cube. I would like to convert this new data flow to BI7 (from 3.x), and convert the standard update rule to transformation. I would need to rewrite the below start routine from the standard update rule to a start routine ABAP code in the newly created  transformation / start routine. My ABAP knowledge is limited. Will you please help?
    *this is the start routine from the update rule. As a side note, the data source is 2LIS_02_SCL.
    LOOP AT SOURCE_PACKAGE.
        IF (     SOURCE_PACKAGE-cppvlc  EQ 0
             AND SOURCE_PACKAGE-cppvoc  EQ 0
             AND SOURCE_PACKAGE-cpquaou EQ 0 ).
          DELETE SOURCE_PACKAGE.
          CONTINUE.
        ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
        IF SOURCE_PACKAGE-no_scl IS INITIAL.
          IF SOURCE_PACKAGE-storno = 'X'.
            SOURCE_PACKAGE-no_scl = -1.
          ELSE.
            SOURCE_PACKAGE-no_scl = 1.
          ENDIF.
          MODIFY SOURCE_PACKAGE.
        ENDIF.
      ENDLOOP.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    Many thanks and look forward to your kind feedback.
    Kind regards,
    Csaba

    Dear All, Durgesh,
    thanks to you all for your valuable input. Mainly the ABAP part was more interesting for me.
    Durgesh, thanks for your input, it was useful. I just had to change the info objects to data source fields and add the lines before the loop:
    DATA: I_PACKAGE TYPE TYT_SC_1.
        FIELD-SYMBOLS <i_package> TYPE tys_sc_1.
        I_PACKAGE[] = SOURCE_PACKAGE[].
        LOOP AT SOURCE_PACKAGE assigning <i_package>.
          IF ( <i_package>-BWGEO EQ 0
          AND <i_package>-BWGEOO EQ 0
          AND <i_package>-BWMNG EQ 0 ).
            DELETE SOURCE_PACKAGE index sy-tabix.
            CONTINUE.
          ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
          IF <i_package>-NOSCL IS INITIAL.
            IF <i_package>-ROCANCEL = 'X'.
              <i_package>-NOSCL = -1.
            ELSE.
              <i_package>-NOSCL = 1.
            ENDIF.
          ENDIF.
        ENDLOOP.
    Points have been assigned accordingly.
    Thanks,
    Csaba

  • 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'

  • 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.

  • Creating a view on two ODS using the most actual value of Timestamp

    Hi All,
    I am creating a view on two ODS. I have made an internal join of the field timestamp from both the tables. But the timestamp in bot ODS do not match, which is why there is no data visible in the view.
    There is a requirement that the value of timestamp to be used has to be the most actual value of timestamp from the two ODS.
    I would be grateful if some pointers regarding the same could be provided.
    Thanks and regards,
    Shruti Kulkarni

    Hi Shruti,
    ODS should not be linked on Timestamp basis, there must be some other alternatives like document number, date etc etc...
    In other case if its possible to include addtional key figure in to ODS then
    create a dummy key figure , in the aggregation tab page Select Exception aggregate as "Last Value" and in the "agg.ref char" Select time stamp as info object. This setting will make sure that in the ODS you have only last updated data.
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • 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

  • 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

  • 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.

  • 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.

  • How to update two tables in a single call using JDBC Sender adapter

    Hello All,
    The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
    We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
    Update Statemtent: We can only update one table using this statement.
    Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Let me know.
    Regards,
    Sreenivas.

    Hi Sreenivas,
    > Is it possible to update two tables using the Update Statement without using Stored Procedures.
    Yes its possible through join statement
    Check this links
    Update in JDBC Sender adapter for more than one table
    data from 2 tables for jdbc sender adapter
    Regards
    Ramesh

  • Convert BW3.x Start routine coding into BW 7.0

    The reversal load Update Rules (ICS  IC_TR) Start Routine
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ZCHAR_SUBST.
    DATA: sy_tabix like sy-tabix .
    $$ 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/CS8ICS.
    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        -
      loop at DATA_PACKAGE .
        sy_tabix = sy-tabix .
        select single *
          from ZCHAR_SUBST
          where OLD_CHAR = DATA_PACKAGE-/BIC/CURR_CHAR .
        if sy-subrc is initial . " Candidate for a treatment
          DATA_PACKAGE-/BIC/KF1 = DATA_PACKAGE-/BIC/KF1 * ( -1 ) .
          DATA_PACKAGE-/BIC/KF2 = DATA_PACKAGE-/BIC/KF2 * ( -1 ) .
          modify DATA_PACKAGE index sy_tabix.
        else .
          delete DATA_PACKAGE index sy_tabix.
        endif .
      endloop .
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Start Routine for reversal load
    Pls tell me how to write code for this.
    Thanks
    Gaurav Sekhri
    We are not here to do your job. Please search SDN how to convert a 3.X code to BI7
    Edited by: Pravender on Jul 27, 2010 1:29 PM

    Hi
    There are 2 approached for migration
    1) Top down appraoch: here we start from top ( update rules) to bottom ( datasource) . In this approach Infosource is mandatory and all the routines will be taken care by the system no need to do anything manually.
    2) bottom up approach : here we start from bottom ( datasource) to top ( update rules) . here Infosource is optional and once you migrate 3.x datasource all the transfer rules will get deleted so we need to record the transfer some where before mirgration. here we have to write maually the code invlolved in the transformation in BI 7.0 terminology.
    Note: In bottom up approach it is better to use migration with export so that you can restore the datasource back to 3.x whenever any unexpected problem occurs.
    You can do this By using the T code RSDS
    Santosh

  • Problem in Generating the Infoset report(two ODS joining)

    I am facing the problem in ODS infoset report.
    Consider the two ODS (ie ODS1,ODS2)
    <b>ODS A</b>
    <b>A     B     Sal1(KF1)</b>
    1     10    10,000
    2     10     20,000
    Here A is the Keyfield of ODS A (all A,B, Sal1 are infoobjects).
    <b>ODS B</b>
    <b>B    Sal2(KF2)</b>
    10 4000
    Here B is the Keyfield of ODS B.
    I have  joined two ODS using Infoset.
    Joining condition: OSD A(charactersitics B ie value 10) joined with Keyfield of ODS B(ie B value 10)
    While exectuing the Report i am getting the following output.
    B   Sal1   <b>Sal2</b>
    10 30,000  8000(wrong data)
    Sal2 is summed twice since in ODS A it is having 2 records.
    My requirement is i wnat O/P as
    <b>B   Sal1   Sal2</b>
    10 30,000  4000
    With regards,
    Hari.
    +919323839017

    If you create a multiprovider with the two ODS you won’t have this problem.
    Hope it helps.
    Regards.

  • FM : to call collective Search help and update two fields in SSCR

    Hi Experts,
         I have problem while using collective serach help.
        My scenario is using Collective Search help thru that i want to update 2 fields in my selection screen.
    Thru this function module F4IF_INT_TABLE_VALUE_REQUEST  i can mapping and update two fields using DYNP_VALUE_UPDATE but using this function module i can't able to call my Collective Search help
    in other way
    Thru F4IF_FIELD_VALUE_REQUEST  i can able to call the collective search help but _i can't mapping field and can't updated the
    selection screen field_
    Is any otherway to do it, Please help me ASAP.
    Regards,
    Florian.

    Hi Friends,
    I have the similar kind of requirement. Upon click on a Button on screen i need to call a search help, and collect one or more selected material numbers.
    The search help is working fine and i am getting the entries with the following code.
    The problem is i am finding extra popup on screen.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
    tabname         =  space
    fieldname       =  space
    SEARCHHELP      =  'MAT1'
    MULTIPLE_CHOICE =  'X'
    STEPL           =  0
    value           = 'MATNR'
    *dynpprog        =  progname
    *dynpnr          =  dynnum
    *dynprofield     = 'CARRIER'
    CALLBACK_PROGRAM          = 'ZTEST_1_PRA'
    CALLBACK_FORM             = 'F4CALLBACK'
    TABLES
    RETURN_TAB                = RETURN_TAB
    EXCEPTIONS
    FIELD_NOT_FOUND           = 1
    NO_HELP_FOR_FIELD         = 2
    INCONSISTENT_HELP         = 3
    NO_VALUES_FOUND           = 4
    OTHERS                    = 5.

  • How-to retrieve deleted start routine

    Hi!
    I have written a start routine in an update rule for a data mart. This update rule was overwritten while the export data source of the related info cube was created again (during this the system automatically creates and activates a new update rule). My start routine within this update rule is lost.
    Since this was happening in the development system I found the name (D8FOPYTRYTBF836EXIMLM2MGA) of the routine in the related transport order.
    Does anyone know how to show this routine/object/program in an editor or how to rescue the code of the routine? Is there a possibility by any means (SE38 dont work)?
    Any help highly appreciated and rewarded.
    Best Regards,
    Volker

    try to search in  RSAABAP , RSAROUT and RSUPDROUT tables..
    If you don't find.. you can transport that request to quality system(retrive the code and delete this request from transport buffer.. no need to transport prod!) and again create another request with new changes and transport to Q and then to Prod

  • How to debug start routines of update rules from ODS to InfoCube

    Dear gurus,
      I have an update rule from ODS to InfoCube. I wrote a start routine in the update rule. Now I want to debug it. I went to monitor and simulate update the data package and only got the prompt "No data exists in the corresponding PSA table". So how can I debug this start routine?
      Thanks in advance.
    Jin Ming

    Jin,
    In order to use PSA between ODS and InfoCube, you may have to use an exclusive InfoPackage and load separately. In that InfoPackage, choose the radio button to use a PSA.
    I think you are currently updating the InfoCube directly without using a separate InfoPackage.
    Look for an InfoSource under DataMarts (search for 8<ODS Technical name>) and create your InfoPackage there.
    Good luck.

Maybe you are looking for

  • Activation of DSO failed

    Hi Team,               After loading the data to DSO and Activating i find the following error.The DSO is activated.There is data in New table and error occurs while activating. The Errors are: 1.DSO ZPF_O07 is inconsistent; request DTPR_4IA4N9BCL2EN

  • Cash forecasting - customer payment profiles

    Hello Gurus, I am trying to understand customer payment profile concept. My requirement is to perform cash forecasting using customer payment profiles. Anything on this topic would be of great help. Thanks.

  • Removing LUNs from Solaris 10

    Hi all, I have a 2-node Solaris 10 11/06 cluster running Sun Cluster 3.2. It's shared storage is supplied from an EMC Clariion SAN. Some of the LUNs used by the cluster have recently been replaced. I now have multiple LUNs on this cluster that are no

  • Server Timeout

    Could anyone tell me why the WebLogic Server timeout after idle for few days? I cannot access the admin console after idle for few days. Thanks. Kammau

  • Why does my click wheel not advance but it does scroll

    my click wheel works, but not completely. see it turns, so i can lower the volume, rate the song or even advance the song. but when i want to skip, replay or use the menu, it's not working right. i have to use my fingernail (and it's hard on the nail