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.

Similar Messages

  • Delete blank records from the cube

    Hello;
    We just upgraded from 3.5 to 7.0.  When we started running our queries for the Inventory cube, we were getting an error message of "Error:  The validity interval has the initial value as lower limit".
    When I checked the cube, I found records that were blank, such as no dates, plants, etc..  I then tried to see if I can delete those records, but I cannot find a way to do this.  Can someone tell me how to delete the blank records or any records from the cube directly?  When I run the queries from the ODS, I do not get any errors at this time.
    Any information, suggestions or HELP is greatly appreciated.
    Thanks,
    Maximina Barry

    Hello Maximina,
    You could try writing in some code that would delete the records which have some fields as blank in the start routine of the transformation that connects the ODS to the cube . So that the next time you load data from the ODS to the cube .. they would stay deleted .
    Hope it helps.
    Just to add ...
    refer -> Need Sample Code to delete records from Cube using  SE38 Editor
    Thanks,
    ~Vj
    Message was edited by:
            Vijay Gopinath

  • Double data records in the cube.

    Hi experts
    when we are loading the data from DSO to infocube by using DTP ,
    the Problem is its updating double records in the infocube,  with  same record and the key figure values zero .
    in the transformations we don't have any start routine, end routine  ..
    Please could any  tell me how to overcome from this
    thanks
    kumar

    Hi Fredrik,
    not all settings in infopackages work in chains in the same way they do while running the package manually. Mostly you can check that with pressing F1 on the setting. In your case, you need to add a process type for deleting the data to the chain. In your chain maintenance, look at process types and then in load processes .... There you will find the type you need.
    kind regards
    Siggi

  • How to differentiate the records in the cube

    Hi experts,
    I get data from 3 dso's to a cube through 3 DTP's.
    In the cube how to recognize that a particular record came from a particular dso.
    I thought of identifying it with request ids but for delta loads daily different req ids will be coming.
    Can we populate the dtp name into the cube ?
    If so, how ?
    Regards,
    Bhadri M.

    Yes Bhadri,
    this can be done by adding another char in the cube and populating this char with diff values, lets say 'A' for DSO1, B for DSO2 and similar for third.
    This char would help us identify at a later point the records source.
    Naveen.A

  • Abap logic in Transformation end routine bringing 0 records

    Hi,
    I wrote this logic but is not populating the figure that I need. I am trying to get a Key figure /
    field-symbols: <fs_rp> LIKE LINE OF RESULT_PACKAGE.
    Types : Begin of s_itab,
    S_ITEMID TYPE /N/ADSO_ASPC00-/N42/S_ITEMID,
    STRDCOST TYPE /N/ADSO_ASPC00-/N42/S_STRDCOST,
    End of s_itab.
    Data : it_itab type table of s_itab,
    wa_itab type s_itab.
    LOOP AT RESULT_PACKAGE ASSIGNING <fs_rp>.
    Read table it_itab INTO wa_itab with key S_ITEMID =
    <fs_rp>-/N42/S_ITEMID.
    Clear wa_itab.
    if sy-subrc ne 0.
    SELECT /N/S_STRDCOST /N/S_ITEMID FROM /N/ADSO_ASPC00 INTO
    CORRESPONDING FIELDS OF wa_itab
    FOR ALL ENTRIES IN RESULT_PACKAGE
           WHERE /N/S_ITEMID EQ RESULT_PACKAGE-/N/S_ITEMID.
    ENDSELECT.
    <fs_rp>-/N/S_STRDCOST = wa_itab-STRDCOST.
    ENDIF.
    ENDLOOP.

    1. the name of the fields in the internal table it_itab and in table /n/adso_dsc00 are not the same, so you're move-corresponding is not working.
    2. you need to select in table it_itab not in workarea wa_itab.
    Data rp TYPE tys_TG_1.
    field-symbols: <fs_rp> LIKE LINE OF RESULT_PACKAGE.
    Types : Begin of s_itab,
    /N/S_ITEMID TYPE /N/ADSO_DSOC00-/N/S_ITEMID,
    /N/S_STRDCOST TYPE N/ADSO_DSOC00-/N/S_STRDCOST,
    End of s_itab.
    Data : it_itab type table of s_itab,
    wa_itab type s_itab.
    SELECT /N/S_STRDCOST /N/S_ITEMID FROM N/ADSO_DSOC00 INTO
    INTO table it_itab
    FOR ALL ENTRIES IN RESULT_PACKAGE
    WHERE /N/S_ITEMID EQ RESULT_PACKAGE-/N/S_ITEMID.
    ENDSELECT.
    LOOP AT RESULT_PACKAGE ASSIGNING <fs_rp>.
    Read table it_itab INTO wa_itab with key /N/S_ITEMID =
    <fs_rp>-/N/S_ITEMID.
    if sy-subrc ne 0.
    <fs_rp>-/N/S_STRDCOST = wa_itab-STRDCOST.
    ENDIF.
    ENDLOOP.

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

  • Loading the cube from 3 datasources and getting 3 records for each keyfield

    Hi All,
    I am loading an InfoCube from 3 separated datasources. These 3 datasources are UD Datasources and their unique source system is UD Connect.
    Each of the datasource contains a unique key field 'Incident Number' (same as we use have in Datasources for DSO).
    The problem is, when I am loading data with these 3 datasources to the cube, for each 'Incident number' there becomes 3 records.
    We have reports on this Infocube and the report also displays 3 records for each incident number.
    If I remove Incident Number key field from 2 of the Datasources, the data from these datasources do not reach to the Cube.
    For many of you, this may be a minor problem ( or may not be a problem at all !!! ) , but as a New Joinee in SAP field, this has become a showstopper issue for me.
    Please suggest.
    Thanks in Advance.

    Hi Pravender,
    Thanks for your interest.
    The scenario is, I have 3 datasources form the same source system, All the 3 datasources have different fields except 'Incident Number'. So, each and every field has only one value in the report. But due to 3 separate datasources, it creates 3 records displahying values of each datasource in a separate record.
    There is no field in the query output which is having different values for the different source systems. Due to 3 records in the cube, one record will contain the value for a particular field and the other two records will show a Blank for that field.
    Regards.

  • End Routine Implementation Issue

    Hi Colleagues,
    I want to implemente an end routine in order to populate the material type from the material master data.
    The source structure of my transformation contain the material.
    The target structure of my transformation contain the material and material type infoobject.
    I have implemented the following source code in the end routine based on the sdn doc below :
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
    My source code is :
    Global data declaration
    List of all Employees and corresponding sales organisation
        DATA: BEGIN OF I_S_MATERIAL_TYPE,
          MATERIAL TYPE /BI0/PMATERIAL-MATERIAL,
          MATERIAL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
        END OF I_S_MATERIAL_TYPE.
        DATA: i_t_material_type like table of I_S_material_type.
      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        -
    local data declaration
        data: e_s_result type tys_TG_1.
        data: e_t_result type tyt_TG_1.
        data: material_type like e_s_result-matl_type.
    read master data in local table once
          SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
            into corresponding fields of table i_t_material_type
            WHERE  MATERIAL  = <RESULT_FIELDS>-material
            AND    objvers  = 'A'.
    Do the calculation and add the new rows
    *>>
    loop over the input result data package
        loop at RESULT_PACKAGE into e_s_result.
    get Counter
          read table i_t_material_type into e_t_result with key
          material = e_s_result-material.
             move material_type to e_s_result-matl_type.
             append e_s_result to e_t_result.
        endloop.
    add the lines to the output package
        refresh RESULT_PACKAGE.
        move e_t_result[] to RESULT_PACKAGE[].
    $$ end of routine - insert your code only before this line -
      ENDMETHOD. "end_routine
    $$ end of routine - insert your code only before this line         -
    ENDMETHOD.                    "end_routine
    I have the following error message :
    E:"E_T_RESULT" cannot e converted to the line type of
    "ME->I_T_MATERIAL_TYPE"
    Question :
    Can someone explain me what is the issue in my source code ?
    Cheers,

    Hi Vijay,
    Thanks for your precious answer !
    I have modified the matl_type - but I still have the same error message on the read table coding part.
    Error message: E:"E_T_RESULT" cannot be converted to the line type of
                                  "ME->I_T_MATL_TYPE".
    Global data declaration
    List of all Employees and corresponding sales organisation
        DATA:
        BEGIN OF I_S_MATL_TYPE,
            MATERIAL  TYPE /BI0/PMATERIAL-MATERIAL,
            MATL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
        END OF I_S_MATL_TYPE.
        DATA: i_t_matl_type like table of I_S_matl_type.
    local data declaration
        data: e_s_result type tys_TG_1.
        data: e_t_result type tyt_TG_1.
        data: matl_type like e_s_result-matl_type.
    read master data in local table once
        SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
        into corresponding fields of table i_t_matl_type
        WHERE MATERIAL = <RESULT_FIELDS>-material
        AND objvers = 'A'.
    Do the calculation and add the new rows
    loop over the input result data package
        loop at RESULT_PACKAGE assigning <result_fields>.
    Error message: E:"E_T_RESULT" cannot be converted to the line type of*
                                 "ME->I_T_MATL_TYPE".*
          read table i_t_matl_type into e_t_result with key
          material = e_s_result-material.
          <RESULT_FIELDS>-matl_type = i_t_matl_type-matl_type
          Modify result_pacakage from <result_fields>
        endloop.

  • End routine field not populated

    Hi,
    I have made the following end routine in order to populate the field YNEGOCIO with two characters.
    I´m uploading data from DSO 0FIAR_O03 to customized DSO.  When i activate this DSO i don´t see the field YNEGOCIO populated but the strange thing is that when i make a debbugg to the end routine,  the result package-YNEGOCIO at the end of routine IS POPULATED with the correct values.
    Can anybody help me with this?
    LOOP AT RESULT_PACKAGE INTO e_s_result.
    **Recover characters 14,15 from YNEGOCIO.
    CLEAR lv_negocio.
               SELECT SINGLE
                 /BIC/YYKEY
                FROM /BIC/AYSDLASPV00
                INTO lv_key
                    WHERE
                      /BIC/YYVALUE EQ e_s_result-GL_ACCOUNT.
                IF sy-subrc EQ 0.
                  MOVE lv_key+13(2) TO lv_negocio.
                ENDIF.
          LOOP AT gt_inv_gl9_doc INTO gs_inv_gl8_doc
            WHERE ac_doc_no = e_s_result-ac_doc_no.
    * Calculate Importe Aplicado
            MOVE e_s_result to aux_s_result.
             aux_s_result-record = v_count + 1.
            IF aux_s_result-DEB_CRE_DC IS NOT INITIAL.
              aux_s_result-PROFIT_CTR = gs_inv_gl8_doc-profit_ctr.
              aux_s_result-USERNAME = gs_inv_gl8_doc-USERNAME.
              aux_s_result-deb_cre_dc = gs_inv_gl8_doc-DEB_CRE_DC.
              aux_s_result-/BIC/YI_WRBTR = gs_inv_gl8_doc-DEB_CRE_DC *
                aux_s_result-/BIC/YI_WRBTR / aux_s_result-DEB_CRE_DC.
              aux_s_result-/BIC/YNEGOCIO = lv_negocio.
              APPEND aux_s_result to e_t_result.
            ENDIF.
          endloop.
        endloop.
        REFRESH RESULT_PACKAGE.
        MOVE e_t_result[] TO RESULT_PACKAGE[].
    Regards,
    Diego

    hi,
       check your changelog table and see data over there, i guess this situation generally happens when you do delta laod , itmight happening bcoz of two image are created which might be cancelling each other when request gets actiavted in DSO and also see for 0recordmode value.
    hope it helps
    regards
    laksh

  • Error_message while archiving the cube

    Hi,
    I am archiving a cube. the job get started .
    Step 001 started (program GP4IY4269LUILPMJOZFNME9F9SA, variant ZARV_ XXXXuser ID EXXXXX)
    Fill in all required entry fields
    Job cancelled after system exception ERROR_MESSAGE
    and end with the following error message. But i have entered all the required fields.. have any one
    come accross this type of error . pls advice what to be done....
    regards !
    karthik

    Hello Karthik,
    Please check if there are any records in the cube that are not yet compressed.
    Before you can perform time slice archiving, the data that you want to archive
    has to be completely compressed.                                                                               
    If this does not help, then please provide more details:
    What SP are you on for BW?
    Are you receiving any other error messages in the job log? any dumps?
    Best regards
    Barry

  • Number of records in BPC Cube

    Dear Friends,
    I am working in EPM10 NW/BW 7.31.
    I just want to know  how can I find number of records in BPC cube from the back end (i.e using T-Code RSA1)
    As I am not a BW expert, any simple suggestion will be appreciated.
    Thanks,
    Rahul

    Hi Rahul,
    The way I do it is right click on the cube, then display data.
    goto the bottom section of the menu where you see the following:
    tick output number of hits
    also change the max no, of hits to a high number
    then run
    in the output screen you sum up the first column, it will give you the total number of records in the cube
    Andy

  • 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

  • End Routine Issue - It does not move data from E_T_RESULT to RESULT_PACKAGE

    Hi,
    I am facing an issue with end routine. I have gone through previous posts on, how to write end routine and all.I wrote the end routine accordingly.
    Here is my scenario,
    I have 0CUST_SALES master data , which has all the Sales Org, Distribution Channel and Division, Sold to Party, Sales Grp and Sales Dist.
    I am getting , Sold to party and Distribution channel at the field routine.
    I am using, Sold to Party and Dist Channel and Division = '01'- whatever i populated using a field routine  and trying to get the Sales Org, Sales Grp and Sales Dist at the end routine.
    It looks like, all the code that i wrote seems correct but it does not populate any values into RESULT_PACKAGE.
    Here is the code I wote at the end routine. I am not sure, whats wrong in it. I used, this link to write this routine :
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/203eb778-461d-2c10-60b3-8a94ee91cbfc&overridelayout=true
    Global Declaration----
      DATA : BEGIN OF IT_CUST_SALES,
        DIV TYPE /bi0/pcust_sales-DIVISION,
        DIST_CH TYPE /bi0/pcust_sales-DISTR_CHAN,
        SALES_ORG TYPE /bi0/pcust_sales-SALESORG,
        CUST_SAL TYPE /bi0/pcust_sales-CUST_SALES,
        SALESDIST TYPE /bi0/pcust_sales-SALES_DIST,
        SALESGRP TYPE /bi0/pcust_sales-SALES_GRP,
        END OF IT_CUST_SALES.
    DATA: T_CUST_SALES LIKE TABLE OF IT_CUST_SALES.
    Start of End Routine
       SELECT DIVISION DISTR_CHAN SALESORG CUST_SALES SALES_DIST SALES_GRP
        from
        /bi0/pcust_sales INTO TABLE T_CUST_SALES for all entries in
        RESULT_PACKAGE
        where CUST_SALES = RESULT_PACKAGE-SOLD_TO
         AND DISTR_CHAN = RESULT_PACKAGE-DISTR_CHAN
         AND DIVISION = '01'.
        LOOP AT RESULT_PACKAGE INTO e_s_result.
          READ TABLE T_CUST_SALES INTO IT_CUST_SALES
              WITH KEY CUST_SAL = e_s_result-SOLD_TO
                 DIST_CH = e_s_result-DISTR_CHAN
                 DIV = '01'.
          IF SY-SUBRC EQ 0 .
            MOVE IT_CUST_SALES-SALES_ORG TO E_S_RESULT-SALESORG.
            MOVE IT_CUST_SALES-SALESDIST TO E_S_RESULT-SALES_DIST.
            MOVE IT_CUST_SALES-SALESGRP TO E_S_RESULT-SALES_GRP.
            APPEND E_S_RESULT  TO  E_T_RESULT .
          ENDIF.
        ENDLOOP.
        REFRESH RESULT_PACKAGE.
        MOVE E_T_RESULT[] TO RESULT_PACKAGE[] .
    End End Routine
    Data comes into E_T_RESULT but it does not move to RESULT_PACKAGE. Any inputs will be helpful.
    Regards,
    Kumar

    Hi Hegde,
    Declaration is same , its like this.
       datA: e_s_result type tys_TG_1.
        data: e_t_result type tyt_TG_1.
    I don't know, when i inserted this code in this post, initially it was OK but once i post i also saw , its not that read friendly.
    FYI, i am trying to put the code again, lets see if it works.
      SELECT DIVISION DISTR_CHAN SALESORG CUST_SALES SALES_DIST SALES_GRP
        from    /bi0/pcust_sales INTO TABLE T_CUST_SALES for all entries in
        RESULT_PACKAGE   where CUST_SALES = RESULT_PACKAGE-SOLD_TO
         AND DISTR_CHAN = RESULT_PACKAGE-DISTR_CHAN
         AND DIVISION = '01'.
        LOOP AT RESULT_PACKAGE INTO e_s_result.
          READ TABLE T_CUST_SALES INTO IT_CUST_SALES
              WITH KEY CUST_SAL = e_s_result-SOLD_TO
                 DIST_CH = e_s_result-DISTR_CHAN
                 DIV = '01'.
          IF SY-SUBRC EQ 0 .
            MOVE IT_CUST_SALES-SALES_ORG TO E_S_RESULT-SALESORG.
            MOVE IT_CUST_SALES-SALESDIST TO E_S_RESULT-SALES_DIST.
            MOVE IT_CUST_SALES-SALESGRP TO E_S_RESULT-SALES_GRP.
            APPEND E_S_RESULT  TO  E_T_RESULT .
          ENDIF.
        ENDLOOP.
        REFRESH RESULT_PACKAGE.
        MOVE E_T_RESULT[] TO RESULT_PACKAGE[] .
    Regards,
    Kumar

  • 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

  • CCMS monitoring data collection

    Hi, I have set up CCMS to show alerts for inbound IDOC errors. This seems to be working correctly, but the status is not being updated when the data collection method is being run. The data collection is set to run once per hour. best regards, Jason.

  • Problem running servlet using PJA tools

    Hi I am trying to run the TeksSurveyPie servlet from the PJA Package.But everytime i run it says Internal error: Unexpected error condition thrown (java.lang.NoClassDefFoundError: TeksSurveyPie (wrong name: com/eteks/servlet/TeksSurveyPie),TeksSurvey

  • Help - DVD freezes halfway through movie!

    I've tried burning something that is 1hr and 32 minutes long... but both times I've burned it, it freezes sometime during the 47 minute mark. When I say it freezes, I mean when it's finished burning, and I try it in a DVD player, it starts freezing a

  • Cross docking using SLS ( Supplementery logistics services )

    Hi All, I am trying to perform cross docking by using SLS. The scenario is that Store place order to D.C where D.C is performing a collective P.O run ( Wf10). Generally before you generate D.C order the SLS indicator should be checked based on the se

  • How to produce digital wave

    Just starting to build digital wave replace for counter signal in my DAQ. I can't get logical AND result as shown in attachment. In case of irregular pulses, How to build up or edit digital waveform more conveniently? Attachments: digital.jpg ‏68 KB