End Routine in Transformation

Hi Experts,
We have a scenario wherein we need to write END Routine in the transfromation between  two cubes. While doing so we need to Look up at a DSO to fetch Financial Document Number.
Details:
We will be loading the Invoice data from 0LIV_DS01 ODS to the target cube ZLIV_DS01. We have a field called Invoice Clearing Date(0clear_date) in the target cube which is not present in this  0LIV_DS01 ODS. We have Invoice clearing date in the second cube(ZCSOINV). We need to write an END routine in the transformation between ZCSOINV and the target cube.
We need to select Financial Document Number from Active table of 0liv_ds01 ods and store it in an internal table.
Then compare this Financial Document Number with the Financial Document Number in the ZCSOINV cube. If there a match we need to select 0clear_date from ZCSOINV cube and assign it to result package.
Please let me know what code needs to be written to achieve the above requirement in End Routine. Thanks
Regards,
Kavitha Jagannath

In order to read the info cube you can use this function module: RSDRI_INFOPROV_READ
This is the link in order to help you to use that function :
/people/dinesh.lalchand/blog/2006/06/07/reading-infocube-data-in-updatetransfer-rules
SAP also have the demo about it:
You can open it in this program : RSDRI_INFOPROV_READ_DEMO
1. go to tcode : se38
2. type : RSDRI_INFOPROV_READ_DEMO then execute it.
Edited by: Ananda Theerthan on Apr 12, 2010 6:20 PM

Similar Messages

  • Difference between Start Routine  and End Routine in Transformations

    Hi  Friends,
      I'm using BI 7.0... here in Transformations step  we have two options..that is START ROUTINE... and END ROUTINE... What is the Difference between Start Routine  and End Routine in Transformations..
       When  we go for Start Routine.. and when we go for End Routine..
    Plz clarrify... points will be rearded..
    thanks
    babu

    Hi,
    One real time scenario for End Routine.
    We have a scenario where in a datasource field is mapped to three infoobjects on the datatarget side. There are 2 key figures which need to get data after these these Infoobjects are filled. The best place for this to happen would be in a End Routine, where in we would loop through the results package and using the values of the infoobjects from the data target ( Cube in this case).
    Hope this helps,
    HD

  • Primitive APAB editor in start/end routines in transformations

    When editing or viewing ABAP code in BI transformations, for example in a start routine, the editor that opens is very primitive compared to the normal SE38 editor. Some of the limitations include:
    The editor window doesn't cover the whole screen with seemingly no way to increase its size.
    The syntax check doesn't show on which line syntax errors are located.
    There is no option to perform a extended program check.
    There is no way to insert break-points (other than with the ABAP keyword of course)
    These limitations are present regardless of whether i choose the new front-end editor, the old front-end editor or the back-end editor. We're running SAP Netweaver 2004s.
    It is of course possible to create a program in SE38 and copy-paste your start routine code to see the code using the "real" editor, but this is very tiresome and time consuming. Is there a way to make this editor look and behave like the normal editor? I have looked through the setting options an searched SDN without finding a way.

    Hi,
    This is just the settings you need to change to open the start,end, and characteristics routine using the old editor you are comfortable with. No need to go to se38 and check copy the program.
    Go to se38->Utilities->settings->abap editor->editor tab->select the old abap editor.
    To specifically put break point in transformations (start routine..end routine..)..goto transformation (RSA1) and then display the transformation.
    Then goto extra (menu)->generated program. search for start_routine (method now) and put break point in the desired place.
    Then from the DTP enable all 4 break points..in tranformation (this will come when u cange it to debug mode simulation). And u can debug the transformation.
    The new editor is a good handy one. But take some time to get acquented to it. After you may start liking it :).
    Cheers,
    -J

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

  • BI End Routine MONITOR entry overwrites Start Routine MONITOR entries

    Hi Colleagues,
    I'm using MONITOR TYPE rstr_ty_t_monitors in start routine as well as in end routine of transformations.
    But DTP request monitor shows only my end routine monitor entries under "Start routine" and my start routine monitor entries are not shown.
    msgid = RSM1
    msgty = W or E
    msgno = 799
    Any suggestions?
    Thanks and regards,
    Wolfgang

    Fixed by SAP by means of support package.

  • 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

  • Source Field in End Routine of DSO Transformation

    Hi,
    I made a transformation from source DSO to Target DSO.
    There are 7 fields in source & 6 fields in target..All the 6 fields are one to one mapped from the source to Target
    I need to write a simple ABAP Logic in End Routine based on the 7th source field which is not mapped.
    Please let me know the piece of ABAP code or steps where i can get the value of Source table in End routine
    Regards
    Suresh

    Hi Suresh,
                      Check here.........
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
    Regards,
    Vijay.

  • Start & End Routines in BI 7  Transformations

    Hi,
    In Transformations from DSO1-->DSO2
    In Start Routine for all entries in Source Package i read some fields from DSO3 and filled an iternal table
    And  in end routine i read the iternal table and filled the result package/fields
    In the mapping i haven't mapped any thing to the fields to which i intended to fill using routines
    When i executed data load those fields are not populated with any value
    But if i debug the transformation...results are updating in all fields in the  result package.......
    Do i need to make any setting or mappings to the fields which i want to update using end routine
    Thanks

    HI,
    For support pack 16 and above you get one more button besides End Routine (once end routine is created).
    This button is to update behaviour of fields in End Routines. You get two options once you select this button. One needs to make selection of proper option as it is mandatory.
    The default setting for the pushbutton is that only the fields with active rules are updated in the transformation. With this selection, fields populated in End routine wont be updated in the data target if no active rule exists for them in Transformation.
    Alternatively, you can define that all the fields should always be updated by selecting 2nd radio button. As a result, fields filled in the end routine are not lost if there is no other active rule.
    So in your case if you are in SP 15 or lower, then you will have to map the fields.
    Go through this article it gives the above explanation along with screenshots.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30d35342-1fe3-2c10-70ba-ad0da83d23bd
    Hope this helps.
    Thanks,
    Rahul

  • Error in  END ROUTINE while activating the transformation.

    Hi ALL,
    While writing an END ROUTINE IN BI, I got no error while saving the code.
    But when Activate the Transformation I got the following Error.
    " Syntax Error in GP_ERR_RSTRAN_MASTER_TMPL,row 54(->long text)
    Diagnosis:Component called CRM_OBJ_ID already exits  "
    I have used the above object in the transformation.
    Please help me debug the error or highlight on it.

    Hi,
    i guess u have create two object with  same variable name.check.
    regards,
    rakesh

  • Transformation End Routine - Aggregation - Dummy rule

    Hello,
    I am writing a transformation end routine.
    I would like to use a 'SUM' aggregation behaviour the key figures in my Result_Table instead of a MOVE.
    The help at sap http://help.sap.com/saphelp_nw04s/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/content.htm
    says that
    "key figures are updated by default with the aggregation behavior Overwrite (MOVE)".
    In ordrer to do otherwise "You have to use a dummy rule to override this.".
    Could someone explain me how to do this?
    Claudio

    Claudio,
    Map your KF to a dummy KF and then set the aggregation to Summation.
    Then apply your transformation end routine and then the value calculated in the end routine will get summed up to the existing value.
    Arun

  • 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

  • Selecting, reading and sum of billing quantity for last 12 months in transformation end routine

    Hi experts,
    i have requirement to write end routine to read a DSO for last 12 months sales quantity for each month and sum value pass to keyfigure
    not interested using bex variable, while data loading from source to target dso in end routine i am trying to read another DSO which is same as my
    target dso where information is stored by fiscal period, year material etc. finally there is  a keyfigure in target whih needs to be filled with sum of 12
    months sales quantity, for each record form sourc to target maximum of 12 records will be in read dso (for 12 months) my routine is like below.
    i am not expert in abap please kindly gothrough and guide me in this
    TYPES: BEGIN OF s_/BIC/AZOSLS00,
    FISCPER  type /BI0/OIFISCPER,
    FISCVARNT  type /BI0/OIFISCVARNT,
    PLANT  type /BI0/OIPLANT,
    STOR_LOC  type /BI0/OISTOR_LOC,
    /BIC/MATERIAL  type /BIC/OIMATERIAL,
    VTYPE  type /BI0/OIVTYPE,
    BILL_QTY  type /BI0/OIBILL_QTY,
    END OF s_/BIC/AZOSLS00.
    DATA: it_/BIC/AZOSLS00 TYPE TABLE OF s_/BIC/AZOSLS00,
    wa_/BIC/AZOSLS00  TYPE s_/BIC/AZOSLS00.
    SELECT
    FISCPER
    FISCVARNT
    PLANT
    STOR_LOC
    /BIC/MATERIAL
    VTYPE
    BILL_QTY
         FROM /BIC/AZOSLS00 INTO TABLE it_/BIC/AZOSLS00
           FOR ALL
          ENTRIES IN RESULT_PACKAGE
           WHERE
    below field is from value of fiscal period (which is fiscal period -999 ex:  for 001.2014 this
    value will be 002.2013 so 12 months including current period)
    FISCPER >=  RESULT_PACKAGE-/BIC/ZFISCPERF
    below is result filed fiscal period (here i dont know which keyword or statement to be used to select
    interval values this between statement giving syntax error that can not be used in where for for all entries
    between RESULT_PACKAGE-FISCPER
            AND
             FISCVARNT = RESULT_PACKAGE-FISCVARNT AND
             PLANT = RESULT_PACKAGE-PLANT AND
             STOR_LOC = RESULT_PACKAGE-STOR_LOC and
          /BIC/MATERIAL = RESULT_PACKAGE-/BIC/MATERIAL .
        SORT it_/BIC/AZOSLS00 BY FISCPER FISCVARNT PLANT STOR_LOC
        /BIC/MATERIAL .
        LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
          READ TABLE it_/BIC/AZOSLS00 INTO wa_/BIC/AZOSLS00 WITH KEY
    below dont know what statement i need to use in read statement for interval of fiscal periods
    giving error that >= can not be used
         FISCPER >=  <result_fields>-/BIC/ZFISCPERF
    FISCPER = <result_fields>-FISCPER
             FISCVARNT = <result_fields>-FISCVARNT
             PLANT = <result_fields>-PLANT
             STOR_LOC = <result_fields>-STOR_LOC
          /BIC/MATERIAL = <result_fields>-/BIC/MATERIAL
           BINARY SEARCH.
          BREAK-POINT.
          IF sy-subrc = 0.
    below for each record there will be 12 records in read so sume of 12 records quantity i need to pass to result again dont know what to say here
    sum statement giving error
                <result_fields>-/BIC/ZLSTSLS12 =
                 sum(wa_/BIC/AZOSLS00-BILL_QTY).
              ENDIF.
        ENDLOOP.
    friends please help me in this.
    Thanks
    Chandra.

    Hiii,
    If you only want to store last  12 months data in Target ODS .
    Then Create filter in DTP and write routine in filter for calmonth or fiscal period.
    Refer the below link to create filter routine :
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80b2db87-639b-2e10-a8b9-c1ac0a44a7a6?QuickLink=index&…
    Regards,
    Akshay

  • Filling Data fields of a DSO in End Routine

    Hi Everyone,
    The data fields of a DSO contains 2 key figures and a characteristic.
    In the End routine of the transformation, i have assigned constant values for the infoobjects in the data field.
    After executing the DTP, if I check in the New Table of the DSO, these constant values are present.  But when I activate the DSO, the values for key figures gets initialised and the values for the characterisitic becomes empty (NULL).
    Is it not possible to assign values for the infoobjects in the data field? If so, why is this limitation?
    Thanks in advance,
    Uma

    Uma,
    To populate any field in the end routine, you have to assign some constant in the transformation first and then re-populate them using the end routine.
    Sometimes if you dont assign any constant in transformation, the values remain initial and even after you write a code fo that field, it is not populated in the end routine.
    All you have to do is assign constant 0 to the key figures you are populating in the end routine and run the DTP again.
    Thanks
    Sachin

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

  • Thumbrule for Start/End Routines Usage

    Friends,
                 Is there any thumb rule to decide when to use start or end routine in BW 7 in transformations ?  Can anybody provide a scenario for demonstration .. from performing simple lookups on different DSOs to get descriptions vs any other specific scenarios..   Is there any scenario in which only start or only end routine can be performed.. ?
    Any thoughts would be great..?
    thanks,
    Sunil

    Start routine is totally concerned with source data , where you need to write logic for source_package.
    Start routine will execute before transformation execution.
    Executes packageby package.
    loop at source_package into source-feilds.
    End routine works on target structure  and we have lo write logic on result_package.
    Genarally dso lookups are concerned with end routines.
    loop at result_package into result-feilds.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/609eea32-455e-2c10-c08a-c23adf8c934e
    http://forums.sdn.sap.com/thread.jspa?threadID=1963087
    Regards,
    rvc

Maybe you are looking for

  • Itunes wont open - Error 7 (windows error 127)

    When downloading the lastest version of itune my computer crashed and now itunes will not open. It says itunes was not installed correctly. Please reinstall. Error 7 (windows error 127). Reinstalling intunes has not fixed the problem. Please help!

  • I just bought this in order to copy and paste from a PDF and after I convert I still can't..

    I just bought this in order to copy and paste from a PDF and after I convert I still can't..

  • Issue with - Consume Web Services in a Messaging Only Scenario

    Hello, I am trying to consume a Oracle - SOA web service in BizTalk. 1. I followed the below MSDN post, http://msdn.microsoft.com/en-us/library/aa560545%28v=bts.70%29.aspx but I am getting "The custom tool 'BtsDiscoCodeGenerator' failed." error. 2. T

  • Can't install the newest version of iTunes

    Hi. I am trying to download the newest version of iTunes, its going about 3/4 of the way through the process then an error message is coming up saying "The feature you are trying to use is on a network that is unavailable. Click ok to try again or en

  • [URGENT] 1.4 GB logs in 2 days

    Hi, I have a rather annoying issue: -rw-r----- 1 root log  451M 2007-09-03 23:34 everything.log -rw-r----- 1 root log  451M 2007-09-03 23:34 kernel.log -rw-r----- 1 root log  450M 2007-09-03 23:34 iptables.log -rw-r----- 1 root log  885K 2007-09-03 2