Using the end routine to populate the Cubes

Hi BI Gurus,
I am having following requirement:
DSO: ZODS1  -
> This DSO gets all the raw data from Source system.
DSO:ZODS4   -
>  Updates ZCUBE4
       ,ZODS5    -
> Updates ZCUBE5
there is no data flow between ZODS1 and  ZODS4
                                                 ZODS1  and  ZODS5
I have added same new fields to ZODS1,ZCUBE4,ZCUBE5.
So i want to populate fields of ZCUBE4,ZCUBE5.What is best possible way to do that without chaning ZODS4,ZODS5 structure?
I am thinking to write an end routine ?Any idea if its possible?
Also if possible can somebody sample code .
Please help.

Hi,
  U can populate ur new fields easily thorugh end routine in transformation ds04 to cube 4 ....
Provided u can sufficient key in ds04 and which is the same key in ds01 to get the information of newly added fields in cube....
please give ur fields and some sample data then it will be more clear ....
but it can be achieved if u have necessary key fields in both dso's.
Regards
vamsi

Similar Messages

  • End routine to populate Info-cube.

    Hi ,
    Is it possible to load fileds of a Info-cube using End routines in the following scenairos.
    1.Loading fields of info-cube by referencing/using a master data table in End routine.
    2.Loading fields of info-cube by referencing/using a DSO fields  in End routine.
    3.Loading fields of info-cube by referencing/using a fields of another info-cube in End routine.
    Please advise.

    Hi Stalin,
    Before answering your question you need to understand something about "End routine" and "Expert routine".
    End Routine:
    - Result_fields and Result_package are available
    - End routine contains only those fields available in Data target.
    Start Routine:
    - Source_fields and Source_package are available
    - Start routine contains only those fields coming from source.
    Expert Routine:
    -  Source_fields, Source_package, Result_fields and Result_package are available
    So Now if you want write code to look up into some other cube, in look up you may need to test condition using source fields, in that case " Expert Routine" is only the option.
    For Ex
    my data target contains : x,y and z fields (it becomes result_field)
    source contains : a field ( it becomes source_field)
    now if i want to write look up code like this " select x,y and z fields from other cube where my a field value = other cube a field value. here u r accessing both S_F as well as R_F. So only the option is "EXPERT ROUTINE"
    or else u want to write code only with R_F then "End routine " is enough.
    Thanks,
    Gowd

  • What is the use of end routine in bi 7.0

    hi friends,
    what is the use of end routine in bi 7.0. what scenerio we use end routine.
    Thanking u
    suneel.

    hi Suneel,
    check
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
    End Routine
    An end routine is a routine with a table in the target structure format as input and output parameters. You can use an end routine to postprocess data after transformation on a package-by-package basis. For example, you can delete records that are not to be updated, or perform data checks.
    If the target of the transformation is a DataStore object, key figures are updated by default with the aggregation behavior Overwrite (MOVE). You have to use a dummy rule to override this.
    hope this helps.

  • End Routine to populate custom AFS field for Billing Item extractor

    I have the following scenario for Billing 2LIS_13_VDITM datasource
    Doc_No   Item  Material    Item_Categ   AFS_field
    2000        11     XYZ          123
    2000        12     XYZ          123                  US1
    3000        11     PQR          456                 
    3000        12     PQR          456                  CA1
    I need to populate the AFS_field in the first row also for all Doc Nos for certain Item categories (eg 123 & 456). I need to do this on the first transformation from PSA to DSO. I was planning to write a SELECT statement in the Start Routine with the PSA table as the reference as seen below and then write an End Routine calling this reference table. But the PSA table name is different in Dev, QA and Prod so I cannot use this.
    TYPES: BEGIN OF S_AFS,
    VBELN TYPE C LENGTH 10,
    PSTYV TYPE C LENGTH 4,
    MATNR TYPE C LENGTH 18,
    J_4KRCAT TYPE C LENGTH 16,
    J_4KSCAT TYPE C LENGTH 16,
    END OF S_AFS.
    DATA: LT_AFS TYPE STANDARD TABLE OF S_AFS,
          LS_AFS TYPE S_AFS.
    DATA: LT_DATA TYPE tyt_SC_1.
    LT_DATA[] = SOURCE_PACKAGE[].
    SORT LT_DATA DESCENDING BY VBELN MATNR J_4KRCAT.
    DELETE ADJACENT DUPLICATES FROM LT_DATA COMPARING VBELN MATNR.
    SELECT VBELN MATNR J_4KRCAT J_4KSCAT
    INTO CORRESPONDING FIELDS OF TABLE LT_AFS
    FROM /BIC/B0000777001
    FOR ALL ENTRIES IN LT_DATA WHERE VBELN = LT_DATA-VBELN AND MATNR =
    LT_DATA-MATNR.
    SORT LT_AFS BY VBELN MATNR.
    I am not an expert in writing ABAP code. Any suggestions are greatly appreciated and points will be assigned. Thank you.

    Hi
    why do want to select the data from PSA table ?Already your trying to load data from PSA to DSO.
    you want to populate the AFS field value in DSO right?
    1. First you have to add AFS field in ur DSO
    2. Write the Start routine based on ur scenario(select the data based on ur scenario and put into internal table).
    3. wirte AFS field leval  transfer routine(Read the corresponding record based on docu num,item num) pass into RESULT.
    Regards,
    GR

  • No data in Active table of DSO for fields populated by End Routine

    Hi,
    I have a Standard DSO where we are populating few fields by using End Routine.
    Last week we added 5 more fields to DSO and wrote a logic in End ROutine to populate the DSO. These new fields dont have any mapping and these are just populated by end routine only.
    When I loaded the data from Data Source TO DSO, Data is loaded correctly into NEW DATA Table of DSO for all the fields. I could see correct data as per the logic in NEW Table including old and new fields.
    However, when I activate the DSO, I could not find the data for new fields which I added last week. Remaining fields are getting data as per the logic. Only these five fields are not having any data.
    Can you please let me know if any one had similar issue. I was under impression that all the data in the new table will go to Active table when we activate the DSO.
    Your inputs are highly appreciated.
    Thanks
    Krishna

    What version of BW are you using?  When editing your end-routine, a pop-up should display saying which fields you want populated/transferred from the end routine.  This pop-up will not display if you are using a lower version of BW 7.x.  To get around this, make sure that your newly added fields have a transformation rule type set to constant.  This will make sure that the fields get populated when transferring from new to active tables.

  • End routine not updating all records

    Hi,
    I have an end routine to update a cube from another cube.
    The routine has two loops, one child loop inside the main loop. Result Package was sorted before the loops.
    Now, not all records were updated in the target infocube as per expectation. Also, when I pick one such record (that did not get updated) and debug, interestingly it shows that expected value has been assigned to the relevant field. And if I upload only that specific record to the cube, the record does get updated with expected value.
    The problem seem to appear only when the whole set of data is loaded.
    Any suggestion about the coding or further debugging will be greatly appreciated.
    Thanks,
    Pranab

    HI,
    check if u r using any internal tables, make this itab refresh at correct point.i tmight be sumtimes create problem.
    else paste ur code here...
    thnks.

  • Poor performance of transformation end routine

    Hi Folks,
    I have written a transformation end routine to update a Cube for WBS Elements reading the Master Data and Hierarchy tables.  The code seems to be working but with a lot of time spent on reading the endroutine.  Could someone take a look and advice the efficient way to write this?
    Purpose: 
    Read WBS Element master data for the WBS Element delivered in the datapackage (comm. Structure).  Read the WBS Element hierarchy table for the WBS Element to determine what its level is. If the record is found, level is 4 and approval year is not empty, we use that. Otherwise if the record is found but it turns out to be a level 3, use the WBS element as well. If all fails (eg the level is 4 but there is no approval year), determine the parent WBS element, see code after else statement.
    Finally, if the WBS element above is the same as the one in the comm. Structure (for which we read already the master data in table t_h_wbs_elemt), fetch approval year from the table t_h_wbs_elemt (this increases performance because there is no need to read the master data for every new record), otherwise read the new WBS element master data in the header of t_h_wbs_elemt.
    Edited by: ramesh ramaraju on Jan 7, 2010 4:50 PM

    Hi,
    Try like this
    DATA: lv_nodename type RSSHNODENAME.
    DATA: lt_mwbs_elemt type table of /bi0/mwbs_elemt,
    lw_mwbs_elemt type /bi0/mwbs_elemt.
    DATA: lt_hwbs_elemt type table of /bi0/hwbs_elemt,
          lw_hwbs_elemt type /bi0/hwbs_elemt.
    ***instead of using select * try to specidfy the fields other wise it will fetch fiull records
    ***or if you are using select * specking a where condition avodi into corresponding fields instead use the field name
    select * from /bi0/mwbs_elemt
    into corresponding fields of table lt_mwbs_elemt.
    IF SY-SUBRC = 4.
    RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
    ENDIF.
    ***instead of using select * try to specidfy the fields other wise it will fetch fiull records
    ***or if you are using select * specking a where condition avodi into corresponding fields instead use the field name
    select * from /bi0/hwbs_elemt
    into corresponding fields of table lt_hwbs_elemt.
    sort lt_hwbs_elemt by nodename.
    sort lt_mwbs_elemt by wbs_elemt.
    clear E_S_RESULT.
    loop at RESULT_PACKAGE into E_S_RESULT.
    clear lw_mwbs_elemt.
    loop at lt_mwbs_elemt into lw_mwbs_elemt
    where wbs_elemt = e_s_result-wbs_elemt.
    endloop.
    ***instead of looping again use a read statement
    read table lt_mwbs_elemt where where wbs_elemt = e_s_result-wbs_elemt binary search.
    clear lw_hwbs_elemt.
    loop at lt_hwbs_elemt into lw_hwbs_elemt
    where nodename = e_s_result-wbs_elemt.
    endloop.
    ***instead of looping again use a read statement
    read table lt_hwbs_elemt where where wbs_elemt = e_s_result-wbs_elemt binary search.
    clear lv_nodename.
    IF sy-subrc EQ 0 AND lw_hwbs_elemt-tlevel EQ 4
    and lw_mwbs_elemt-appr_year ne 0.
    lv_nodename = e_s_result-wbs_elemt.
    ELSEIF sy-subrc EQ 0 AND lw_hwbs_elemt-tlevel EQ 4
    and lw_mwbs_elemt-prog_def_s ne ' '.
    lv_nodename = e_s_result-wbs_elemt.
    ELSEIF sy-subrc EQ 0 AND lw_hwbs_elemt-tlevel EQ 3.
    lv_nodename = e_s_result-wbs_elemt.
    ENDIF.
    IF lw_mwbs_elemt-wbs_elemt ne lv_nodename.
    clear lw_mwbs_elemt.
    LOOP at lt_mwbs_elemt into lw_mwbs_elemt
    where wbs_elemt = lv_nodename.
    ENDLOOP.
    ENDIF.
    IF lw_mwbs_elemt-wbs_elemt EQ lv_nodename.
    E_S_RESULT-PROG_DEF_S = lw_mwbs_elemt-prog_def_s.
    E_S_RESULT-APPR_YEAR = lw_mwbs_elemt-APPR_YEAR.
    ENDIF.
    APPEND E_S_RESULT TO E_T_RESULT.
    ENDLOOP.
    REFRESH RESULT_PACKAGE[].
    MOVE E_T_RESULT] TO RESULT_PACKAGE.
    Regards,
    Ravi

  • End Routine Data updation Issue

    Hi all,
    We are trying to do some look ups in the end routine to populate some fields.
    We can see the data selected in the debugging but  in the actual DSO the fields are not populating.
    we suspect that the modify statement
    MODIFY RESULT_PACKAGE from e_s_result.
    might be having some issues.
    If anybody have any suggestions please help us out.
    Appreciate it.
    Thanks,
    HM

    No it is not the issue with modify statement.
    Whatever fields you are updating in modify statement , you need to have rule type assigned as constant with no value..
    As in BI 7.0 the individual rule needs to be defined to enable it to get populated otherwise it doesnt think that the field needs to be updated.

  • End-Routine in BI 7.0 :

    I implemented an end-routine to populate a field in a DSO.
    After a load, when I check the New Data table of DSO, I can see the field populated.
    But when I activate the request, I dont see the same field populated in DSO contents.
    What could I be missing?
    Below is the End-Routine I wrote with the help of SDN:
    DATA: WA_result_package LIKE LINE OF RESULT_PACKAGE.
    DATA: GI_ZSD_O01 TYPE TABLE OF /BIC/AZSD_O0100.
    DATA: WA_ZSD_O01 LIKE LINE OF GI_ZSD_O01.
    SELECT * FROM /BIC/AZSD_O0100 INTO CORRESPONDING FIELDS OF TABLE
    GI_ZSD_O01.
    LOOP AT RESULT_PACKAGE INTO WA_RESULT_PACKAGE.
    read table GI_ZSD_O01 with key DOC_NUMBER =
    WA_result_package-DOC_NUMBER
    into WA_ZSD_O01.
    WA_result_package-DOC_TYPE = WA_ZSD_O01-DOC_TYPE.
    MODIFY RESULT_PACKAGE FROM WA_RESULT_PACKAGE.
    ENDLOOP.

    Hi,
    Check this .
    http://help.sap.com/saphelp_nw70/helpdata/EN/f8/7913426e48db2ce10000000a1550b0/frameset.htm
    http://sapbwinfo.blogspot.com/search/label/BI%20Creating%20Routines
    http://www.apentia-online.at/UP/Apentia/files/Article/SAP_BW_User_Exits_and_BAdIs.pdf
    Thanks .
    Hema

  • What are start and end routines in BI 7.0..

    Hi,
    Can you please explain and give me a sample code ?
    thanks

    Hi,
    depending on your data flow you have to use the routines .
    Start routines - start routines:
    It is used to perform preliminary calculations.if you have any modifications required before the actual transformation is done, then you must write those routines in the start routine of 7.0.
    End routines - new:
    You can use an end routine to postprocess data after transformation on a package-by-package basis.
    Expert routine - update routine :
    You can use the expert routine if there are not sufficient functions to perform a transformation. The expert routine should be used as an interim solution until the necessary functions are available in the standard routine. You can use this to program the transformation yourself without using the available rule types. If you have already created transformation rules, the system deletes them once you have created an expert routine.
    Also Check the below link for detail info.
    Routine in Transformation.
    Reg
    Pra

  • End Routine - Modify a record in the cube

    Hello Guys,
    In the end routine I have to update a field . The transformation is the same cube to the cube. I want the record to be modified like add a value to a field in the end routine. Since it is a cube it creates a new record instead of overwriting the existing record. Is there anyway I can modify the record. I know I can make the existing record 0.00 and then create a new record with the new value.Is there any other solution.
    For example:This is the existing record in the cube
    sales order           Item No                      Backlog Amount                      Indicator
    1000                     10                              1000.00
    After applying the end routine it has 2 records ( I modify the record with the indicator value)
    sales order           Item No                      Backlog Amount                      Indicator
    1000                     10                              1000.00                                  
    1000                     10                              1000.00                                    REV
    After applying the end routine I need the record to be like overwrite(similar to DSO)
    sales order           Item No                      Backlog Amount                      Indicator
    1000                     10                              1000.00                                   REV
    How to achieve the above result in end routine.
    Thanks
    Senthil

    Hi there,
    Since you create new records in end routine in the InfoCube, why not delete the old ones?
    You can use the
    delete RESULT_PACKAGE where ...
    Therefore deleting the old records after inserting the new ones.
    Diogo.

  • Updating Cube in the End Routine based on the incoming Valid From Date

    Hello Experts
    Here is my scenario.
    We are using BW 7.x.  There is DSO and from DSO it goes to the Cube, the promotions information.  These data targets will have Material (Article), Plant (Site), Promotions Number, Valid from and Valid to dates.  The Valid To date will come in as 12/31/9999 all the time.
    If I receive a new record from ECC with same Material, Plat and Promotion combination again, I need to get the Valid From Date from the new record and Update the existing record' Valid To date in DSO/Cube as Valid From of the new record - 1.
    So Valid To date of the existing record = New Record's Valid From date minus - 1.
    I would like to do the update in "End Routine" of the Cube.
    Would you please suggest if this can be done and if so would you please provide the sample code.
    THANK YOU in Advance.
    Nag.

    yes, you can do this...
    just use a RESULT_PACKAGE in end routine.
    and using RESULT_PACKAGE fatch the existing records from DSO and append that into RESULT_PACKAGE after your desired changes,
    just try to create a code using this l;ogic. if you can't then i will provide you a code.
    Regards,
    Ashish

  • End Routine is NOT modifying the DSO with new data after load into that DSO

    Hi all,
      I am creating an End Routine for DSO to populate a field ZFCMP_FLG (to store 'Y' ) with lookup from another DSO ZMDS_D01. This new field shows blank instead of 'Y', after activating the DSO. The RESULT_PACKAGE record is populated with 'Y' for ZFCMP_FLG  while debugging that End Routine and why it is NOT writing the modified records into DSO, please ? It is a Characteristic InfoObject with length 1 to store 'Y'. The following is some part of the code:
    DATA: wa_fcmp_flag   TYPE c VALUE 'Y'.
    LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
        READ TABLE it_zmds_d01 INTO wa_zmds_d01 WITH KEY
                    /BIC/ZAUFNR    = <RESULT_FIELDS>-CS_ORDER
                    NOTIFICATN     = <RESULT_FIELDS>-NOTIFICATN  BINARY SEARCH.
         IF sy-subrc = 0.
           <RESULT_FIELDS>-/BIC/ZFCMP_FLG = wa_fcmp_flg.
        ENDIF.
    ENDLOOP.
    Thanks,
    Venkat.

    hi...
    Since you are using Field symbol to loop the internal Table there is no need to use the MODIFY Statement in the loop.
    So your code is correct only.
    But here you have to check the status of READ TABLE command in the debug mode.
    it may be failing that's why the RESULT_PACKAGE is not getting modified.
    Plz check it.
    Note: You may need to SORT the Int Table since you are using BINARY SEARCH. check below.
    DATA: wa_fcmp_flag   TYPE c VALUE 'Y'.
    Sort it_zmds_d01 by  /BIC/ZAUFNR    NOTIFICATN  .
    LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
        READ TABLE it_zmds_d01 INTO wa_zmds_d01 WITH KEY
                    /BIC/ZAUFNR    = <RESULT_FIELDS>-CS_ORDER
                    NOTIFICATN     = <RESULT_FIELDS>-NOTIFICATN  BINARY SEARCH.
         IF sy-subrc = 0.
           <RESULT_FIELDS>-/BIC/ZFCMP_FLG = wa_fcmp_flg.
        ENDIF.
    ENDLOOP.

  • Start Routine to populate the Logical Source System

    Hi Friends please help me with the below
    1. <b>Requirement</b> : to Populate The system Date , Source System
    in BI for Each load request.
    <b>
    1 Solution:</b> I thought of writing the Start Routine for this but it is giving me error
    syntax Error: END METHOD MISSING?????
    2. Also I have requirement to populate 0sourcsys source system id, can any body help how to populate that.
    Thanks
    Poonam Roy
    <b>ABAP Code.</b>
    I have the End Method. what more to do.
      METHOD start_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <SOURCE_FIELDS>    TYPE tys_SC_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    <b>
    $$ begin of routine - insert your code only below this line        -</b>
    ... "insert your code here
    <b>
    FORM STARTROUTINE
    USING G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING DATAPAK type TRANSTRU
    ABORT LIKE SY-SUBRC.
    DATA: ZLOAD_DAT LIKE SY-DATUM
    ZZSOURSYS TYPE RSLOGSYS
    IF G_S_MINFO-DATAPAKID=1
    SOURCE_FIELDS-ZLOAD_DAT = SY-DATE.
    SOURCE_FIELDS-ZZSOURSYS = G_S_MINFO-LOGSYS.
    ENDIF.
    ABORT = 0.
    ENDFORM.
    ENDMETHOD.
    ENDCLASS</b>.
    *--  fill table "MONITOR" with values of structure "MONITOR_REC"
    *-   to make monitor entries
    ... "to cancel the update process
       raise exception type CX_RSROUT_ABORT.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.

    Hi,
    Check whether the formula is useful here than Routine. Because you can see the Sy-datum , source system( I Guess) fields as avaialable formula elements .
    With rgds,
    Anil Kumar Sharma .P

  • To populate data using end routine

    Hello,
    In the end routine I need to populate the org unit with data from 0hrposition object which gets populated from the source field assigment.
    Could anyone help me in writing the code in BW 7 END Routine
    InfoObject: 0ORGUNIT Organizational Unit.
            ORGUNIT           TYPE /BI0/OIORGUNIT,
    InfoObject: 0HRPOSITION Position.
            HRPOSITION           TYPE /BI0/OIHRPOSITION,
    Thank you
    Anima

    HI Anima,
                            Check here.....
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
    Regards,
    Vijay.

Maybe you are looking for

  • Can we send an Asset From BD64?

    HI All, In BD64 I have created a model view for assets using Add BAPI CREATEFROMDATA And saved it. Does any one know from there how to create an Asset IDOC type FIXEDASSET_CREATE01 and send it to a different SAP system. Please let me know if any one

  • How I know if my computer have a virus?

    My computer is slow and the itunes show up by his self? is a virus?

  • Excel calculations with variables

    Hi everyone The following is Possible?? I have this value in three rows in excel 0.007 0.1975 0.0159 i want the user to input a number how can i do this? number*0.007 + number *0.1975 + number*0.0159 so this give me a value... all this done in excel

  • Accessing BAPI

    While going throught the documentaion i found different  ways to Call BAPI.Those are  Adaptive RFC with WebDynpro, SAP Java Resource Adapter, SAP Enterprise Connector,SAP Java Connector. We have SSO setup for portal and Backend R/3 using logon ticket

  • Java.sql.Wrapper Interface in Java6. Why?

    Can anybody tell me why is there Wrapper interface in Java6? (I mean java.sql package) I would be glad if you can provide me with some sample source code.