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

Similar Messages

  • 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

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

  • 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

  • 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

  • BI end routine at transformation to populate info object by vlookup attribu

    Hi ,
    I am APO consultant working in Bi routines and I have the follwoing situation and need some guidance in ABAP code (routine) .
    We sales info from markets as flat filea snd lod them into cubes. One of the filed is file is External sales Group: ZEXSGRP. This is an attribute or Sales Group info object ZSLSGRP.
    We get external sales group populated in file when we upload the file into cube -  I  want to use end routine to vlook up the  info infoobject table ZSLSGRP - all the external sales groups and use the matching value to write Sales Group (ZSLSGRP).Example  if ZSLSGRP  is NAM and it attribute is  ZEXSGRP  and has value N0000032. The file gets value N0000032 so the end routine should look all attribute of all infoobject ZSLSGRP and match the value and populate in example above it populates NAM.
    Hope i am clear - can any help with this.
    thaks
    Varma

    Replace your select statement ,
    SELECT *
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    instead of selecting all the fields , pick only the fields which are required.(one good performance improvement)
    SELECT    /BIC/PZF31SALOFF  comp_code
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    Remove the line below , this is not required
    MODIFY it_tab4 FROM wa_tab4.

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

  • End routine Works fine but missing some records while updating to cube.

    Hi All
    I have an issue here... My End routine works fine and I even debugged by putting the breakpoint and It fetches data from dso. strangely when I run my DTP the load is successful but I can see some of the records are missing. but there is data in dso and also when i debug the code it fetches the values for particular fields.
    My requirement is I have a cube 'A' and under it DSO1 and  I need six more fields from dso2. Now I made a look up for these six fields in End routine. My routine works fine and so the DTP Is Green. My issue is I cant see these six fields updated for some of the records.
    PLZ put some light on it!!!!!!!!!!!!!!!!!

    Hi Naveen & Jaya
    Thanks for your quick response. Below is my code logic in end routine.
    METHOD end_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <RESULT_FIELDS>    TYPE tys_TG_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    $$ begin of routine - insert your code only below this line        -
    ... "insert your code here
    data: lv_result_package like line of RESULT_PACKAGE,
          l_tabix type sy-tabix.
    loop at RESULT_PACKAGE into lv_RESULT_PACKAGE.
       l_tabix = sy-tabix.
    Update lot/decision attributes Lot/Decision ( ZQM_O04 ) DSO
       read table itab_qm_o04 into itab_qm_o04_wa
           with key insp_lot = lv_result_package-insp_lot.
       if sy-subrc = 0.
         lv_result_package-ivaluation = itab_qm_o04_wa-ivaluation.
         lv_result_package-catcode_ud = itab_qm_o04_wa-catcode_ud.
         lv_result_package-catgrp_ud = itab_qm_o04_wa-catgrp_ud.
         lv_result_package-/bic/zcattp_ud = itab_qm_o04_wa-/bic/zcattp_ud.
         lv_result_package-/b41/s_usuddate = itab_qm_o04_wa-/bic/gqmuddat.
         lv_result_package-/b41/s_usudcdate = itab_qm_o04_wa-/bic/gqmudcdt.
       endif.
       modify RESULT_PACKAGE FROM lv_RESULT_PACKAGE INDEX l_tabix.
    endloop.
    Well based on the insp_lot in ZQM_O03( DSO1) the logic above gets the six fields from ZQM_O04(DSO2) and feeds the cube.
    The Insp_lot has multiple records in DSO1 based on specific characteristic and so the cube. This Logic gets all these six fields
    from DSO2 which has single record per insp_lot and feeds the cube which has multiple records on insp_lot based on a specific characteristic. For some reason some of the records are not been updated to cube.
    waiting for your valuable response.....
    Thank You,
    Abhishek Yeachni

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

  • 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

  • Check if a DSO has been lookup by other DSO/cube in start/end routine

    I have to support on of the client system which I am not part of the development.
    I found one DSO has been schedule to load data in daily process chain but it is not update to any target.
    Is it possible to check if this DSO has been using in the staging  i.e look up the reference field by other cube/DSO in start or end routine ?

    Hi,
    Possible by invoking respective field into code part.
    I think not much stuff required in this regard.
    Thanks - RK

  • How the data is stored in Info cube...in the back end what will happen???

    Hi Experts,
    How the data is stored in Info cube and DSO...in the back end what will happen???
    I mean  Cube contain Fact table and Dimension tables How the data will store and what will happen in the backend???
    Regards,
    Swetha.

    Hi,
    Please check :
    How is data stored in DSO and Infocube
    InfoCubes are made up of a number of InfoObjects. All InfoObjects (characteristics and key figures) are available independent of the InfoCube. Characteristics refer to master data with their attributes and text descriptions.
    An InfoCube consists of several InfoObjects and is structured according to the star schema. This means there is a (large) fact table that contains the key figures for the InfoCube, as well as several (smaller) dimension tables which surround it. The characteristics of the InfoCube are stored in these dimensions.
    An InfoCube fact table only contains key figures, in contrast to a DataStore object, whose data part can also contain characteristics. The characteristics of an InfoCube are stored in its dimensions.
    The dimensions and the fact table are linked to one another using abstract identification numbers (dimension IDs) which are contained in the key part of the particular database table. As a result, the key figures of the InfoCube relate to the characteristics of the dimension. The characteristics determine the granularity (the degree of detail) at which the key figures are stored in the InfoCube.
    Characteristics that logically belong together (for example, district and area belong to the regional dimension) are grouped together in a dimension. By adhering to this design criterion, dimensions are to a large extent independent of each other, and dimension tables remain small with regards to data volume. This is beneficial in terms of performance. This InfoCube structure is optimized for data analysis.
    The fact table and dimension tables are both relational database tables.
    Characteristics refer to the master data with their attributes and text descriptions. All InfoObjects (characteristics with their master data as well as key figures) are available for all InfoCubes, unlike dimensions, which represent the specific organizational form of characteristics in one InfoCube.
    http://help.sap.com/saphelp_nw04s/helpdata/en/4c/89dc37c7f2d67ae10000009b38f889/frameset.htm
    Check the threads below:
    Re: about Star Schema
    Differences between Star Schema and extended Star Schem
    What is the difference between Fact tables F & E?
    Invalid characters erros
    -Vikram

Maybe you are looking for

  • Upgraded to 10.6.8 and now can't import photos from Olympus camera

    1. Recently bought a new Olympus VR310 digital camera.  I couldn't get either Image Capture (6.0.1) or iPhoto (9.1.5) to import images from day one, onto my Mac Mini running Snow Leopard 10.6.8.  However, if I took the SDHC card out of the Olympus an

  • Weblogic Portal 9.2 LDAP user listing resulting in NullPointer

    Hi, I have configured Weblogic Portal 9.2 to use an LDAPAuthenticator, when I use the Admin Console I can see the Novel Groups and Novel Users fine. When I select "User Management" menu item in the Admin tool where you set the Entitlements etc.. I ge

  • Wishy washy

    Hi there We have a CP3505n laserjet printer and we have all HP cartridges in it and I have run diagnostics and troubleshooting tips and it will not print well, the colours are washed out and we need to print photographs and the quality is awful. Does

  • App Store problems again?

    I keep getting the 'Cannot connect to iTunes store' message.. I have a ipad2 wifi only model and have recently updated to the new iOS 6.1 update.. Is there a service outage like on the 25 of October? Any advice people??

  • How to set a timeout on the web service call

    I can use Business process or JCD wrapped as business process. I need to send a web service request and wait for 2 seconds, if the response doesnot comeback within the 2 second time frame, I need to raise the fault message and publish it to queue. We