Update rule logic

I am looking at an update rule to a DSO which also consists of start routine logic.
In the update rule a status object is derived using logic.
In the start routine there is some logic specific to the status object the details are as follows
Start Routine Logic (have not included definition of variables)
ls_c-status     = <ls_c>-/bic/zstatus.
Logic in info object in the start routine
DATA:
l_status   TYPE  /bic/zstatus.
SELECT /BIC/Zstatus
  INTO l_status
    FROM /BIC/AZDSOLookup
    WHERE
      /BIC/ZKey_Field = COMM_STRUCTURE-/bic/zkey_field.
ENDSELECT.
RESULT = l_status.
CLEAR l_status.
The routine in the info object is making no reference to the variables defined in the start routine.  Is that correct?
Thanks

Hi Edwin,
I think you are right I need to place in Global area/start routine I will post another question with details of requirements
Thanks

Similar Messages

  • Need to create a transformation based on Update Rules Logic

    Hi,
    I have an existing complex Update Rule. I need to manually create a Transformation based on this Update Rule logic. The Start Routine of the Update Rule comprises of:
    1) All data declarations in the Global Area
    2) The local coding area consists of various select statements from various r/3 tables used later for mapping. It also calculates and stores values in the Data Package final internal table for few infoobjects that are not present in the Source object but and are used to populated data in the target.
    3) then we have the various one to one individual Infoobject mappings/constants and many individual infoobject routines that pick result from the comm_structure
    I am not very clear as to where each of the above coding logic should be put in the transformation coding area...... I can see four main coding areas in the transformation....global area, 2nd Global Area, Method Start_Routine and Method Inverse_Start_Routine........... I think the global data declarations(point 1 above) should be put in the Global declaration area of the start routine. The local area of the update rule logic (point 2 above) that contains select statements should be put in 2nd Global part or should it be put in Method Start_routine????? Point 3 above for individual filed mappings will be done through Rule groups. Also can anyone let me know what is the methos inverse_start_routine used for?????
    Thanks.

    Hi,
    Point 1 you mentioned should be put under2nd Global declaration part of start routine.
    Point 2 should be put under Method Start_routine.
    Point 3 as you only mentioned can be done by individual field rule mappings.
    Method inverse_start_routine
          This subroutine needs to be implemented only for direct access
          (for better performance) and for the Report/Report Interface
          (drill through)
    Not very clear though about Inverse routine. But definetly not being used for the case you mentioned.
    Hope it helps.

  • Feasibility of update rule logic

    I have the following scenario:
    I have a DSO which stores a number of records and stores a value for a revenue KPI.  This DSO mainly stores item data and we now would like to include the records which are in the header DSO but not the item DSO and give them a zero revenue.
    Is it best that I select all the data from the header DSO as part of the start routine logic or is there a better way in which I can collect the missing records?
    Thanks

    Hi,
    Looking up the item DSO will be too much performance oriented and may result in long time for loading.
    Do a look up on header DSO while loading the item DSO and select the records from the header which are not equal to the records in the delta package...and then populate them in the item DSO with the flag.
    But this may require you to reload the whole data in the item DSO again...may be you can do this by creating a self update rule to the item DSO and run it for once to maintain the history
    schedule the delta daily from the data source to manage the changes.
    Thanks
    Ajeet

  • Update Rule - Logic to lookup

    The daily Inventory Cube stores the values (populate via a routine in the Update Rules) of some key figures
    I want to use those key figure values in another ODS.  Can I carry out a lookup in the UR for these values if so how? Thanks

    hi Niten,
    take a look sample codes
    Is it possible to read a third ODS in update rules between two ODS?
    Restriction of data selection in update rule start routine.
    Start Routine in Update Rules to populate additional fields from ODS
    hope this helps.

  • ABAP assistance - start routine logic in update rule

    I have used an existing update rule and have based my logic around the same.  The purpose of the rule is to look up customer master data and get a subset of customer numbers from the transaction records so that the values for customer number from the transactional data will not be updated if it does not match with existing master data customer numbers.
    The loads are full and we drop the data before we load.
    I have listed the logic below (the number at the front is to be considered as the line number) and a list of open questions that I have thereafter:
    Start routine logic:
    1  DATA: l_index LIKE sy-tabix.
    2  DATA: BEGIN OF ls_customer,
    3        customer TYPE /BI0/OICUSTOMER,
    4        objver TYPE RSOBJVERS,
    5     END OF ls_customer,
    6      lt_customer LIKE TABLE OF ls_customer.
    7  REFRESH: lt_customer.
    8  LOOP AT DATA_PACKAGE.
    all customers from data package
    9    ls_customer-custno = DATA_PACKAGE-custid.
    10  ls_customer-objver = 'A'
    11    APPEND ls_customer TO lt_customer.
    12   ENDLOOP.
    12  SORT lt_customer.
    13  DELETE ADJACENT DUPLICATES FROM lt_customer.
    14   IF NOT lt_customer[] IS INITIAL.
    15    SELECT /BI0/OICUSTOMER RSOBJVERS
    16      FROM /BI0/PCUSTOMER
    17      INTO CORRESPONDING FIELDS OF TABLE lt_customer
    18      FOR ALL ENTRIES IN lt_customer
    19      WHERE ls_customer-custno = DATA_PACKAGE-custid
    20      AND ls_customer-objver = 'A'
    21    SORT lt_customer BY customer ASCENDING                    
    22  ENDIF.
    Questions
    Line
    1 - what is the purpose of this line? What is it that is being declared
    2 - in some code I have seen this line with OCCURS 0 at the end what does this mean with and without the term?
    4 - I am using the Data Element name is this correct or should I use the field name?
    3 - 5 here I declare an internal structure/table is that correct?
    6 - here I declare a work area based on the internal table is that correct?
    7 - What would happen if I avoided using the REFRESH statement?
    8 - 12 - Is this syntactically correct, I am trying to get a set of data which is the customer numbers which match the master data customers and the master data record is án active version and than appendíng to the work area?
    13 - My understanding is this will reduce the number of records in the work area is this correct and needed?
    14 - 22 I am trying to identify my required set of data but feel I am repeating myself, could someone advise?
    Finally what logic would I actually need to write in the key figure object, could I use something like:
    Result = lt_customer.
    Thanks
    Edited by: Niten Shah on Jun 30, 2008 8:06 PM

    1. This line is not required
    2. OCCURS 0 is the OLD way of defining an internal table with that structure.  As it is, it just defines a flat structure.
    3. Data element is usually best
    3-5 Yes
    6. No.  Here you are declaring a table of the type of the flat structure.  Just as the ABAP says!
    7. Nothing.  But by putting this in, you ensure that you know the state of the table (empty) before you start looping through the data package
    8-12. You can tell if it is syntactically correct by pressing Ctrl-F2 when in the editor.  Looks ok.
    13. Ensures your list of customers contains no duplicated.  The code up to this point is building a list of all the unique customers in the data package.
    14-22. Goes to the database and brings back ONLY those customers which are found in the master data.  Looks ok.
    This is a start routine (that's why you've got a data package).  You don't use result.  You should update the datapackage.  But this you haven't done.  Double click on the table name /BIC/PCUSTOMER to get the correct field names.
    So you have to loop through the data package again, and check if the customer in the datapackage is lt_customer.  If it is, fine, otherwise you blank it and report an error, or set an error message or whatever.
    I wouldn't do it like this.  I'd do something like this:
    STATICS: st_customer TYPE HASHED TABLE OF TYPE /bi0/oicustomer
                                  WITH UNIQUE KEY TABLE_LINE.
    * st_customer retains its value between calls, so only populate if empty
    * In one run of the infopackage, this will mean you do only one read of
    * the master data, so very efficient.
    IF st_customer IS INITIAL.
      SELECT customer FROM /BI0/PCUSTOMER
                              INTO TABLE st_customer
                              WHERE objvers EQ 'A'. " Only active values
    ENDIF.
    * Go through data package
    LOOP AT DATA_PACKAGE.
    * Check whether the customer exists.
      READ TABLE st_customer TRANSPORTING NO FIELDS
                  WITH TABLE KEY table_line = DATA_PACKAGE-custid.
      CHECK sy-subrc IS NOT INITIAL.
    * If you get here, the customer isn't valid.  So I'm just setting it blank
      CLEAR DATA_PACKAGE-custid.
      MODIFY DATA_PACKAGE. " Updates the datapackage record
    ENDLOOP.
    Even this is not fully optimised, but it's not bad.
    I strongly suggest that you get yourself sent on the basic ABAP programming course if you're going to do a lot of this.  Otherwise, read the ABAP documentation in the help.sap.com, and, from the editor, get the cursor on each ABAP keyword and press F1 to read the ABAP help.
    matt

  • How to Code "AND" logic in Update Rule?

    Hi:
    I have minimal ABAP knowledge and need some help....
    I have to use the Query logic and code in my Update rule... (i.e. multiple conditions have to be met)
    IF (COMM_STRUCTURE-Sales_Org = '100' AND  COMM_Structure-Division = 'LA' AND COMM_STRUCTURE-Acct_Grp = '0120')
          RESULT = COMM_STRUCTURE-Credit_Amoutn (I want to assign a specific KF)
    ELSE
         RESULT = 0 (I want to assign Zero)
    ENDIF
    I attempted this logic, but I keep getting an error with 'AND' statement.  I am not sure what is the syntax.
    Can someone please help me out with the  logic/sytax
    Thanks..... Lee

    Hi:
    I responded without checking the logic.... assuming it would work...!~
    Unfortunately it gives me error:
    QUOTE
    E:Incorrect logical expression: ")" must be followed by "AND" or "OR" . .
    UNQUOTE
    Can anyone help me resolving this please....!!!!
    Thanks... lee

  • To refer logical source in update rules

    Hi,
    I wanted to find the logical source system using abap into my update rule, is it possible.
    Help would be appreciated.
    Thanks,
    SD

    Hi,
    you have only to write something like this:
    case sy-sysid.
    * development system
        when 'dev1'.
            result = 'r3_dev'.
    * test system
        when 'test1'
            result = 'r3_test'.
    endcase.
    dev1 and test 1 are your bi systems. When data comming from one source system you can use this code in each transformation.
    Regards
    Andreas

  • Update Rule Routine Problem

    Hi
    i have wriiten a update rule routine.
    in that routine i am fetching comp code ,GL Acct. from SKB1 table and match those records wth Data Package records.
    Data Package has both Open and Closed items. so i need to match the Comp Code and GL Account which i have fetched from SKB1 with Data Package Comp Code and GL account which records will be matched they will go to Target ODS otherwise Delete from Data Package.
    But data is not coming properly in Target ODS.
    i have debug the routine and found , there are 10 records(Comp Code + GL Acct.) has been fetched from SKB1
    and Data Package has Total 416 Records. Only 20 Records has been gone to Target ODS while I have seen the 216 Comp Code and GL Account combination has been successfully matched with 10 Records of SKB1
    Below is the code in Start routine.
    Note: Data Package has Multiple Records for a Combination of Company Code and GL Account which is present in SKB1.
    How can i resolve this problem.
    ********Logic to Fetch Open items GL Account**************
    *Fetch data from SKB1*********
    SELECT /BIC/ZMCFBUKRS
           /BIC/ZMCFSAKNR
           FROM /BIC/AZOCFSKB100
           INTO TABLE TB_ZOCFSKB1
           FOR ALL ENTRIES IN DATA_PACKAGE
           WHERE /BIC/ZMCFBUKRS = DATA_PACKAGE-COMP_CODE
           AND  /BIC/ZMCFSAKNR = DATA_PACKAGE-GL_ACCOUNT
           AND /BIC/ZMCFXOPVW = 'X'.
    ***Fetch records from FI GL Data Package which match with
    ***internal table TB_ZOCFSKB1
    LOOP AT DATA_PACKAGE INTO WA_DATA_PACKAGE.
    READ TABLE TB_ZOCFSKB1 INTO WA_TB_ZOCFSKB1 WITH KEY
    /BIC/ZMCFBUKRS = WA_DATA_PACKAGE-COMP_CODE
    /BIC/ZMCFSAKNR = WA_DATA_PACKAGE-GL_ACCOUNT
    binary search.
          IF sy-subrc ne 0.
            DELETE TABLE DATA_PACKAGE FROM WA_DATA_PACKAGE.
          ENDIF.
    ***Clear Work Area****************
          CLEAR WA_TB_ZOCFSKB1.
          CLEAR WA_DATA_PACKAGE.
        ENDLOOP.
    ***Refresh internal table*********
       REFRESH TB_ZOCFSKB1.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    Edited by: AtulMohan Mishra on Feb 9, 2011 11:22 AM

    Hi,
    It is very important that you SORT the internal table before you do a READ with Binary Search.
    SORT TB_ZOCFSKB1 BY /BIC/ZMCFBUKRS /BIC/ZMCFSAKNR.
    You are sure to miss results unless you do.

  • BW 3.5 Update rule routine and start routine convert to BI 7.0 Endroutine.

    I have bw 3.5 update routine and update rules start routine( r/3 to ODS). i need to replicate that routine into BI 7.0 endroutine with the same logic with some minor changes(DSO to DSO).
    IN BW 3.5 the data is getting from r/3 where as in BI7.0 the data fetching from DSO itself but the logic is same as bw 3.5.
    following is the start routine:
    DATA: G_FISCPER_TO TYPE /BI0/OIFISCPER,
          G_CALMONTH   LIKE /BI0/PCALMONTH-CALMONTH,
          G_MONAT      TYPE /BIC/OIYRDFMONAT.
    ABORT = 0.
    ------ Globale Variable füllen --------------------------------------*
      CALL FUNCTION 'Y_RDF_FISCPER_FOR_INFOPACKAGE'
        EXPORTING
          I_ISOURCE    = '0FI_AA_001' (*** this is infosurce getting from r/3, in 7.0 this one is DSO 'B")
        IMPORTING
          E_FISCPER_TO = G_FISCPER_TO
          E_MONAT      = G_MONAT
        EXCEPTIONS
          OTHERS       = 1.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'Y_RDE_FISCPER_TO_CALMONTH'
          EXPORTING
            I_PERIV    = 'K4'
            I_BDATJ    = G_FISCPER_TO(4)
            I_POPER    = G_FISCPER_TO+4(3)
          IMPORTING
            E_CALMONTH = G_CALMONTH
          EXCEPTIONS
            OTHERS     = 1.
        IF SY-SUBRC NE 0 OR G_CALMONTH IS INITIAL.
          CALL FUNCTION 'Y_RDN_MONITOR_SET'
            EXPORTING
              I_MSGID   = 'YRDFBW'
              I_MSGNO   = '027'
              I_MSGV1   = '0FI_AA_001'
              I_MSGV2   = 'YRDF_FIAA_PERIOD'
            TABLES
              T_MONITOR = MONITOR.
          ABORT = 1.
        ENDIF.
      ELSE.
        CALL FUNCTION 'Y_RDN_MONITOR_SET'
          EXPORTING
            I_MSGID   = 'YRDFBW'
            I_MSGNO   = '027'
            I_MSGV1   = '0FI_AA_001'
            I_MSGV2   = 'YRDF_FIAA_PERIOD'
          TABLES
            T_MONITOR = MONITOR.
        ABORT = 1.
      ENDIF.
    Update routine:
    RETURNCODE = 0.
      ABORT = 0.
      CLEAR RESULT.
      IF NOT COMM_STRUCTURE-ASSET_MAIN BETWEEN '000000200000' AND
                                               '000000299999'.
        CALL FUNCTION 'Y_RDF_GET_CCTR_0ASSET'
          EXPORTING
            I_COMP_CODE  = COMM_STRUCTURE-COMP_CODE
            I_ASSET      = COMM_STRUCTURE-ASSET
            I_ASSET_MAIN = COMM_STRUCTURE-ASSET_MAIN
          IMPORTING
            E_COSTCENTER = RESULT
          EXCEPTIONS
            OTHERS       = 1.
        IF SY-SUBRC NE 0 OR RESULT IS INITIAL.
          CALL FUNCTION 'Y_RDN_MONITOR_SET'
            EXPORTING
              I_MSGID   = 'YRDFBW'
              I_MSGTY   = 'E'
              I_MSGNO   = '061'
              I_MSGV1   = COMM_STRUCTURE-COMP_CODE
              I_MSGV2   = COMM_STRUCTURE-ASSET
              I_MSGV3   = COMM_STRUCTURE-ASSET_MAIN
            TABLES
              T_MONITOR = MONITOR.
          RETURNCODE = 1.
        ENDIF.
      ENDIF.
    How can i write this in BI7.0?
    Thanks

    Hi ,
    solved on my own. Thankyou very much..
    thanks & regards,
    M.S
    Edited by: M.S on Oct 27, 2009 6:57 AM
    Edited by: M.S on Oct 27, 2009 6:59 AM

  • How to calculate the runntime of a routine in an update rule

    I'm facing a performance problem with the loading of an ODS.  After some analysis I'm almost sure that the problem is due two routines (in the update rule) that are looking into master data tables 200.000 times ( quantity of records loaded every day).  But before moving that logic back into the extractor I need to be sure that the runntime will be reduced.  Is there any way to obtain the amount of time spent by those routines?.  I have been checking into the transactions ST03N and STAD but I'm not able to find this information.
    Thank you very much in advance.
    My best regards.
    Pablo Mazzucchi

    Hi,
    For performance problem you can try to get the look data in an internal table at start routine and use them and read for the fields you need which will help you in decreasing the run time vs hitting the database direclty for getting the look up information.
    This will bring you a noticable change in run time of data load.
    Lets wait if some other has routines to get run time of the routine
    Thanks,
    Arun.

  • Inserting code in final steps of Update Rule transformation

    Hi,
    I am extracting data into a cube from an ODS and doing some aggregation in the process. E.g 3 records in the ODS might become 1 in the cube.
    This is fine for some things like Quantity, but not ideal for things like unit price. One work around is for the ODS to have a counter.
    e.g
    MATERIAL QUANITITY  UNIT_PRICE   COUNTER
    1234     13         $1.50         1
    1234     21         $1.50         1
    1234     45         $1.50         1
    This comes across into  a cube like
    MATERIAL QUANITITY  UNIT_PRICE   COUNTER
    1234     79         $4.50         3
    - unit price can then be calculated by dividing unit price by counter - however it needs to be done within the query.
    I thought perhaps we could perform this calculation when populating the cube, if the items were firstly collected within an interim table before being passed to the return_table.
    i.e
    1. Define key figure using ABAP routine and return table.
    2. Append INTERIM_TABLE within update rules for each read of the ODS
    3. Once all ODS records have been read and inserted at an aggregate level within INTERIM_TABLE, loop through INTERIM_TABLE, perform calculation and append RETURN_TABLE.
    My question is: Is there a simple way to determine that all ODS items have been read (like an "at last" statement) and if so, where can this code be inserted? Can it be simply placed in the update rules routine if I have the appropriate logic to determine that all items have been read?
    Thanks
    Adrian

    Hi Adrian,
       Why cant you use Addition, minimum or maximum in update rules...?? Here you can use Maximum option for Unit Price.
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/0e503c3c0d563de10000000a114084/content.htm
    Hope it Helps
    Srini

  • Update rule on master data attribute

    Hi
    In my cube, I have a master data object  0COMP_CODE, which has attribute 0COMPANY.
    Additionally, in the same cube, there's:
    Master data object 0CUST_GROUP, which has attribute ZBUSPART
    Master data object 0CO_AREA, which also has attribute ZBUSPART
    I need to fill a characteristic ZTAXCODE (not a master data object) in the cube, with the following logic:
    If 0COMPANY is between 1 and 30, populate ZTAXCODE with value of ZBUSPART from 0CUST_GROUP
    If 0COMPANY is between 31-9999999, populate ZTAXCODE with value of ZBUS_PART from 0CO_AREA
    I guess this will have to be done in the update rule.  Right now I have 0COMP_CODE in the communication structure. How should the code be written to populate ZTAXCODE, with value of ZBUSPART, based on the value of the attribute of 0COMP_CODE - 0COMPANY?
    Any help with getting me started here would be appreciated...
    Thanks
    Marty

    In the start routine.
    First, for all data package select company code, cust_group and zbuspart from cust_group and store it in the internal table.
    Second for all data package select company code, co_area and zbuspart  from co_area and store it in the second internal table.
    Third for all data package select company and company code from comp_code and store it in the third internal table.
    Now in the update rule routine.
    read the third table and get the company for the company code and if the value which comes from this company is between 31 and 9999999 then read from second internal table otherwise read from the first internal table and update the result.
    hope that is clear.
    thanks.
    Wond

  • Update rule from one Cube to another

    Hello Gurus!
    Here is the situation :-
    We have a IC ZCube1. This cube contains order data at schedule line level. It contians an IO  for each Hold Status (in all 10 ) . IO has value 'X' if it is active else blank. 1 order line item can have multiple holds.
    We need a aging report that should show how long particular line is on a Hold .
    Date of change of hold status is not in the cube ZCube1, it is in another ODS. We have created new cube(ZCube2) that will have Orderitem, Line#, DOC#...etc(as key field) and an IO for Hold status (here we have only one IO to hold all status code) and data of change of hold status (we will populate it from ODS ) .
    We have create start routine in ZCube2 that filter out order lines with no active Hold status. Also in this start routine we have logic to create 1 row for each hold status and store it in internal table(ITAB1). 
    Problem :
    Not able to understand how to proceed in update rule to insert multiple rows from  ITAB1 into ZCube2.
    We can  copy ITAB1  to ITAB2 and read it with Key fields. After this we have ITAB2 with multiple Hold status codes with same order item.
    Problem here is how do I assing multiple rows from ITAB2 in update rule to get multiple line item in ZCube2.
    Any thought or input to above said will be very helpful.
    Thanks,
    Murtuza.

    Hi Srinivas,
    I did some change , till earlier post I was trying to figure out how to Move source DP values to internal table.
    Eventually what I need is to Break each order line from source pacakge which contians multiple holds on same line into 1 orderline with only 1 hold status .
    e.g for a orderline if there are 3 hold Source DP will return 1 row . After I execute below code is start routine Source DP will have 3 order line everything same but hold status . I have done changes to the code in previous post and I am able to achieve what I need , but not sure this is efficient way to do ...
    Please advice .
    LOOP AT SOURCE_PACKAGE  ASSIGNING <SOURCE_FIELDS>.
    MOVE-CORRESPONDING <SOURCE_FIELDS> TO wa_ITAB_DP.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATDM EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATFH EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATCC EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATSC EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATSP EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATFA EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATFV EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
          IF <SOURCE_FIELDS>-/BIC/ZCSTATNF EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
         ENDIF.
         IF <SOURCE_FIELDS>-/BIC/ZCSTATPV EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = 'X'.
            wa_ITAB_DP-/BIC/ZCSTATIP = ''.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
        IF <SOURCE_FIELDS>-/BIC/ZCSTATIP EQ 'X'.
            wa_ITAB_DP-/BIC/ZCSTATDM = ''.
            wa_ITAB_DP-/BIC/ZCSTATFH = ''.
            wa_ITAB_DP-/BIC/ZCSTATCC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSC = ''.
            wa_ITAB_DP-/BIC/ZCSTATSP = ''.
            wa_ITAB_DP-/BIC/ZCSTATFA = ''.
            wa_ITAB_DP-/BIC/ZCSTATFV = ''.
            wa_ITAB_DP-/BIC/ZCSTATNF = ''.
            wa_ITAB_DP-/BIC/ZCSTATPV = ''.
            wa_ITAB_DP-/BIC/ZCSTATIP = 'X'.
            APPEND wa_ITAB_DP to ITAB_DP.
          ENDIF.
         CLEAR  wa_ITAB_DP.
    ENDLOOP.
    SOURCE_PACKAGE[] = ITAB_DP[] .

  • Calculation in update rule/routine in order to modify DATA_PACKAGE

    Hello all,
    I want to load some finance data from two ODS objects into an InfoCube. In the update rule I have build a start routine in order to compare two values of  two internal tables (itab1 and itab2) which gets loaded with data from the both ODS.
    When the value of the itab1 is higher of itab2 then I want to subtract the value from itab2 from itab1.
    After that I want to MODIFY the DATA_PACKAGE in order to update later the cube with an new lower value.
    The DATA_PACKAGE is defined as standard table as well as itab1 and itab 2 but I get the error message that the line type is not compatible.
    How I have to build the MODIFY statement in order to calculate and update values in the DATA_PACKAGE?
    Any helps would be great.
    Best regards from Munich/Germany,
    Stefan Leontiadis

    Hi Stefanos,
    My thought is probably not the best in terms of performance, but it should work.  The problem you'll hit is not having the entire data set from both ODS Object loads in memory at the same time.
    To cover this, you can declare a table in the global section of the start routine, let's call it GT_REF_DATA.  Next, perform a SELECT ffrom <other ODS Object> FOR ALL ENTRIES IN DATA_PACKAGE WHERE <selection> into GT_REF_DATA in the local section of the start routine.
    In the individual update routine, you can do a READ TABLE GT_REF_DATA INTO LS_REF_DATA WITH KEY <selection> to get the record you want to compare.
    Here's where you have to be careful.  If I understand your logic right, you can do:
    IF LS_REF_DATA-field < COMM_STRUCTURE-field.
      RESULT = COMM_STRUCTURE-field - LS_REF_DATA-field.
    ELSE.
    RESULT = COMM_STRUCTURE-field.
    ENDIF.
    That avoids processing everything in the start routine and your MODIFY problem.  If you prefer the start routine, you can work with the DATA_PACKAGE directly.  Just remember that DATA_PACKAGE has a header line, so you can simply LOOP AT DATA_PACKAGE, change the value in DATA_PACKAGE, then MODIFY DATA_PACKAGE.
    The way I prefer to do things is to create a separate internal table that is the same type as DATA_PACKAGE.  I fill the internal table with all values to store to the InfoCube (even those you don't change from DATA_PACKAGE).  At the end of the routine, CLEAR DATA_PACKAGE then APPEND LINES OF itab TO DATA_PACKAGE.
    I know there's lots of options above.  Let me know if I got your logic wrong or you have questions.
    Cheers,
    Adam

  • Routine in update rule

    hi,
    i am writing some logic in the start routine of the update rule to a cube from ODS.inside the logic i am using 3 diff. custom function modules which fetch data from 3 diff. queries and populate data in 3 internal tables. But my problem is when i use these 3 function modules, only the first function module populates the data in the first internal table and the rest 2 are not populating data in internal tables but when executed individually, they are working fine.I have to obtain all the data before looping at data package , so i used these 3 function modules serially outside the loop and trying to fetch data and store in internal tables for further processing.
    But, only one fm is working .
    Any help is appreciated.
    Thanks in advance.

    hi,
      I have no short dumps and the return code of the function module is equal to zero.i am passing correct parameters only .In my custom fm , i am using standard bapis to generate session id's for the fms.
    For the first fm the session id is 0001 and the result is correct and for the second and third fm, the session id is 0002 and 0003 , so the fms are not returning correct result.Inside my custom fm , when i tried to forcefully put 0001 in session id , then the fms are not giving results saying that Session id 0001 unknown.Any help or analysis is really appreciated.
    Thanks in advance.

Maybe you are looking for