Lookup in ODS

HI all
I already have a cube with data in that. I also want to get 2 fields from the ODS.
I have to write an ABAP code to get the data from ODS to the CUBE so that I can write query on the CUBE. I want to know the ABAP code. I have 2 fields common in both ODS and CUBE.
Thanks

First add the 2 fields to cube that you want to get from the ODS. 
Provided you want the charactersitcs or key figures from ODS..
You can code in start routine of update rules..
you should be knowing your ODS active table name..if not go to se11 and give /BICyour oDS name you shd get 3 entries , one is active table.
now write a select on this table with your condition like based on what fields in cube you want to match to get 2 fields from ODS.
select F1 F2 from /BIC/A*  into int_table where fieldinODS = fieldincube..
loop at datapackage..
read int_table where fieldincube = datapackage-fieldincube.
if sy-subrc eq 0.
  modify datapackage......      ''modify datapackage with field F1 and F2 ..
endif.
endloop.
Regards
Manga
Assign points if it helps.

Similar Messages

  • Lookup tables (ODS).

    Hi experts
    I know that by using lookup strategy we can refer active table of some other ODS in our ODS (using ABAP code)
    Can you please tell me that if i am using ODS objct A's active tables reference in ODS object B.. then do we need to have data in ODS A??
    Regards
    Swati

    Hi
    I have one ODS object which is using reference of active table of another ODS in start routine..
    DATA: l_pp_o0100 LIKE /bi0/app_o0100,
          l_pp_ds0300 LIKE /bi0/app_ds0300,
    To activate my required ODS i need to activate ODS app_o01 & app_ds03.
    Because as u can see above my required ODS is using reference of active tables of ODS app_o01 & app_ds03.
    I have now activated these 2 ODS objects ODS app_o01 & app_ds03.
    Now to fill my required ODS do I need to have data in other 2 ODS objects??
    Regards
    Swati

  • How  to  Match / Lookup  in  ODS and Cube

    Hi  Friends
    I need to Match a field " Status "  in   an "ODS"  and  " Infocube "  ,
    If this match found ( from ODS and Infocube )  I need to Create a New Cube with the matched data.
    Pls give me some idea how to do this Match /lookup to get  Matched Status field Values to New Cube
    Thanks
    Sree

    Hi Sree,
    You can do this.
    Create a transformation from ODS to new cube.
    In the transformation write a start routine.
    Here read data from the cube by using function module "RSDRI_INFOCUBE_READ" into internal table.
    You can pass the filter and fields which you want to read from the cube to this function module.
    By looping on the soruce package and the internal table which contains the cube data, check if the data is matching or not. If a record is not matching then delete it from the source package.
    This way, after the start routine source_package will have only those records where status is matching.if status is not matching for any record , then 0 records will be loaded to new cube.
    THis will surely help.
    - JAimin

  • ODS Objects in update rules

    Hello,
    I'm using an ODS object lookup in multiple update rotines, Is there a way to list all the update rules that uses the ODS object.
    for (e.g)
    I'm looking up ODS 51 in the update routines for ODS 53 and ODS 56 and also in other update rules, I want to see a list of  all update rules that uses ODS 51.
    Please let me know if there is a way to do this.
    Thanks
    Krish

    Hello Krish,
    You can find this information by looking at a combination to tables:
    Lookup your ODS (tablename) in the program editor line of table RSAABAP. Then using the ABAP code id lookup the update rule id in table RSUPDROUT. For more information check out this link:
    /thread/229531 [original link is broken]
    Regards,
    Mahwish

  • Reconcilation via lookups

    hi ,
    Can anyone tell me how can u do reconcillation by lookups thru ODS ,
    Step by step procedure is appreciated ..
    regards

    Hi,
    Reconcillation is the process of validating the data that is loaded into BW.
    This can be done in several ways .
    Generally it is done by using the reports developed.
    A. By using the reconcillatuion reports.
    B.By comparing thr RSA3 count with the data in the PSA.
    C.With a particular field in the Source to the corresponing object in the report .
    Reach us if any help required
    Regards,
    Sarvepalli.

  • Duplicating Rule Anomaly

    In CS3, I am duplicating a .3 pt stroke line by option dragging and once finished the line now becomes a 1 pt stroke. It happens sporadically with the project that I am currently involved. Not really looking for a solution, and not sure that it is a bug. But a heads up for anyone that comes across this.

    Technically, you could to this in the start routine by appending lines to datapak.
    But in your case you have to know whether the po has invoice or not before hand. Looks like you have to load EKBE information into ODS and activate ODS data before you load EKKO & EKPO information so that you can lookup the ODS to set RECORDMODE TO 'D'.
    Kumar Gudiseva.

  • Lookup from an ODS

    Hi Guys,
    I have included few key figures (Cumulatives) into the Inventory Cube. I want to populate the data to them via update routines with a lookup from an ODS from which the values for these key figures are coming. Please help me with a sample routine for this.
    Thanks a lot in advance...

    Hi,
    First of all you should know what is the key infoobject between two infoproviders. then based upon that you can write a simple routine to fetch data for the key figure.
    Cheers,
    Malli....

  • Lookup by SQL select in ODS tables and source package

    Hi all
    I load FI data in ODS and need some extra info from older ODS records.
    In my Update rule for target InfoObject I created 2 SQL selects on Active Data and New data tables of ODS. Selects worked fine while testing them as separate program, but I got no data while data load.
    I guess, the data I need was in the same data package during data load. So I assume, besides Active/New data selects, I need to check data on SOURCE_PACKAGE. Is it possible on update rule level of InfoObject? Could you please, provide me some ABAP example?
    thanx in advance, points will be awarded.

    SELECT in field routine:
    ==========================================================
          DATA src_doc_no(10) TYPE c.
          DATA src_item_num(3) TYPE c.
          DATA src_year(5) TYPE c.
          DATA src_doc_typ(2) TYPE c.
      if ( COMM_STRUCTURE-AC_DOC_TYP = 'DD' or COMM_STRUCTURE-AC_DOC_TYP =
      'LD' ) and STRLEN( COMM_STRUCTURE-REF_KEY3 ) = 17.
         CONCATENATE COMM_STRUCTURE-REF_KEY3+0(4) '%' INTO src_year.
         src_item_num = COMM_STRUCTURE-REF_KEY3+15(3).
         src_doc_no = COMM_STRUCTURE-REF_KEY3+4(10).
    select from NEW data of ODS:
         SELECT AC_DOC_TYP into src_doc_typ
         FROM /BI0/AFIAR_O0340
         WHERE COMP_CODE = COMM_STRUCTURE-COMP_CODE
           AND DEBITOR = COMM_STRUCTURE-DEBITOR
           AND FISCVARNT = COMM_STRUCTURE-FISCVARNT
           AND AC_DOC_NO = src_doc_no
           AND ITEM_NUM = src_item_num
           AND FISCPER like src_year.
         endselect.
         if src_doc_typ = ''.
    select from ACTIVE data of ODS:
           SELECT AC_DOC_TYP into src_doc_typ
           FROM /BI0/AFIAR_O0300
           WHERE COMP_CODE = COMM_STRUCTURE-COMP_CODE
             AND DEBITOR = COMM_STRUCTURE-DEBITOR
             AND FISCVARNT = COMM_STRUCTURE-FISCVARNT
             AND AC_DOC_NO = src_doc_no
             AND ITEM_NUM = src_item_num
             AND FISCPER like src_year.
           endselect.
         endif.
         RESULT = src_doc_typ.
      endif.
    ============================================

  • ODS Lookup Routine

    Hi Guys,
    I am using BI 7.0.
    My cube has 0material, 0salesorg, 0DISTR_CHAN,0rebate_grp and other characteristics. I have an ODS with 0material, 0salesorg, 0DISTR_CHAN,0rebate_grp only. I want to populate the 0rebate_grp data in the cube from the ods where 0material, 0salesorg, 0DISTR_CHAN are the key fields in the ODS.
    Do you think this can be done through direct mapping or i would need code. If code is needed, thanks for code samples.

    If 0rebate_grp data is present in ODS (key field or data field does not matter) than you can use direct mapping.
    You need to use routine only when field is not present in the source or you need to do some extra calcuation on the source field

  • ODS lookup for a second layer ODS

    HI guys,
    i'm writing a start routine in a transformation (ODSA to ODSTARGET) to make a lookup from the ODSA to the ODSB to populate into the ODSTARGET one field that is present only in ODSB
    i read that is better to make it in the start routine instead in the end routine,
    But i receive an error during the creation of the routine
    Field CASEID unknown
    how can i solve it?
    is ok this approach?
    thanks
    [code]
    PROGRAM trans_routine.
          CLASS routine DEFINITION
    CLASS lcl_transform DEFINITION.
      PUBLIC SECTION.
        TYPES:
          BEGIN OF tys_SC_1,
         InfoObject: CASEID CaseID.
            /BIC/CASEID           TYPE /BIC/OICASEID,
         InfoObject: 0RECORDMODE BW Delta Process: Update Mode.
            RECORDMODE           TYPE RODMUPDMOD,
         InfoObject: EFFDATE Caseheader Effective Date.
            /BIC/EFFDATE           TYPE /BIC/OIEFFDATE,
         InfoObject: ENDDATE Caseheader End Date.
            /BIC/ENDDATE           TYPE /BIC/OIENDDATE,
         InfoObject: RECDATE Caseheader Received Date.
            /BIC/RECDATE           TYPE /BIC/OIRECDATE,
         InfoObject: REGDATE Caseheader Registration Date.
            /BIC/REGDATE           TYPE /BIC/OIREGDATE,
         InfoObject: STARTDATE Caseheader Start Date.
            /BIC/STARTDATE           TYPE /BIC/OISTARTDATE,
         InfoObject: CASETYPE Case Type Code.
            /BIC/CASETYPE           TYPE /BIC/OICASETYPE,
         InfoObject: USERID User Name.
            /BIC/USERID           TYPE /BIC/OIUSERID,
         InfoObject: ORGUNITID Organization Unit Id.
            /BIC/ORGUNITID           TYPE /BIC/OIORGUNITID,
         InfoObject: INTCASEID Integrated CaseID.
            /BIC/INTCASEID           TYPE /BIC/OIINTCASEID,
         InfoObject: CASEOWNER CASEOWNER.
            /BIC/CASEOWNER           TYPE /BIC/OICASEOWNER,
         InfoObject: CHSTDATE Caseheader Start Date.
            /BIC/CHSTDATE           TYPE /BIC/OICHSTDATE,
         InfoObject: CHENDDATE Caseheader End Date.
            /BIC/CHENDDATE           TYPE /BIC/OICHENDDATE,
         Field: RECORD.
            RECORD           TYPE RSARECORD,
          END   OF tys_SC_1.
        TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
      PRIVATE SECTION.
        TYPE-POOLS: rsd, rstr.
    $$ begin of global - insert your declaration only below this line  -
    ... "insert your code here
    $$ end of global - insert your declaration only before this line   -
        METHODS
          start_routine
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
            EXPORTING
              monitor                  type rstr_ty_t_monitors
            CHANGING
              SOURCE_PACKAGE              type tyt_SC_1
            RAISING
              cx_rsrout_abort.
        METHODS
          inverse_start_routine
            IMPORTING
              i_th_fields_outbound         TYPE rstran_t_field_inv
              i_r_selset_outbound          TYPE REF TO cl_rsmds_set
              i_is_main_selection          TYPE rs_bool
              i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
              i_r_universe_inbound         TYPE REF TO cl_rsmds_universe
            CHANGING
              c_th_fields_inbound          TYPE rstran_t_field_inv
              c_r_selset_inbound           TYPE REF TO cl_rsmds_set
              c_exact                      TYPE rs_bool.
    ENDCLASS.                    "routine DEFINITION
    $$ begin of 2nd part global - insert your code only below this line  *
    ... "insert your code here
    $$ end of 2nd part global - insert your code only before this line   *
          CLASS routine IMPLEMENTATION
    CLASS lcl_transform IMPLEMENTATION.
          Method start_routine
          Calculation of source package via start routine
      <-> source package
      METHOD start_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <SOURCE_FIELDS>    TYPE tys_SC_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    *$*$ begin of routine - insert your code only below this line        *-*
    ... "insert your code here
    TYPES: BEGIN OF G_REC_S,
    CASEID TYPE /BIC/OICASEID,
    EFFDATE TYPE /BIC/OIEFFDATE,
    ENDDATE TYPE /BIC/OIENDDATE,
    REGDATE TYPE /BIC/OIREGDATE,
    STARTDATE TYPE /BIC/OISTARTDATE,
    CASETYPE TYPE /BIC/OICASETYPE,
    CASEREF TYPE /BIC/OICASEREF,
    USERID  TYPE /BIC/OIUSERID,
    ORGUNITID TYPE /BIC/OIORGUNITID,
    INTCASEID TYPE /BIC/OIINTCASEID,
    CASEOWNER TYPE /BIC/OICASEOWNER,
    CHSTDATE TYPE /BIC/OICHSTDATE,
    CHENDDATE TYPE /BIC/OICHENDDATE,
    END OF G_REC_S.
    *DATA: W_REC_S TYPE /BIC/ACASEHEAD00.
    *DATA: T_REC_S TYPE STANDARD TABLE OF /BIC/ACASEHEAD00 INITIAL SIZE 0.
    DATA: W_REC_S TYPE G_REC_S.
    DATA: T_REC_S TYPE STANDARD TABLE OF G_REC_S INITIAL SIZE 0.
    SELECT *
    FROM /BIC/ACASEHEAD00 as a INTO CORRESPONDING FIELDS OF TABLE T_REC_S
    FOR ALL ENTRIES IN SOURCE_PACKAGE
    WHERE CASEID = SOURCE_PACKAGE-CASEID.
    SORT T_REC_S ASCENDING
    BY CASEID.
    DELETE ADJACENT DUPLICATES FROM T_REC_S COMPARING CASEID.
    *--  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.                    "start_routine
          Method inverse_start_routine
          This subroutine needs to be implemented only for direct access
          (for better performance) and for the Report/Report Interface
          (drill through).
          The inverse routine should transform a projection and
          a selection for the target to a projection and a selection
          for the source, respectively.
          If the implementation remains empty all fields are filled and
          all values are selected.
      METHOD inverse_start_routine.
    $$ begin of inverse routine - insert your code only below this line-
    ... "insert your code here
    $$ end of inverse routine - insert your code only before this line -
      ENDMETHOD.                    "inverse_start_routine
    ENDCLASS.                    "routine IMPLEMENTATION[/code]
    Message was edited by:
            Bloom

    Hi Bloom,
    "for all entries" statement required a table with header line but, in BI7, source package is a table with NO header line.
    For now I use a loop...endloop (I know that it isn't efficient!!!)
    <b>loop at source_package assigning <source_fields>.
    SELECT *
    FROM /BIC/ACASEHEAD00 as a INTO CORRESPONDING FIELDS OF TABLE T_REC_S
    WHERE CASEID = <source_fields>-CASEID.
    endloop.</b>
    Ciao,
    Antonio

  • Records not matching in RSA3 and my  ODS(Urgent)

    Hi All,
    I am aware of that data in the ODS will be aggreagated in the ODS accordingly to key fields by which the records loaded in the ODS will be lesser,
    My request is, Plz walk me through the best possible way in step wise to compare the records in RSA3 with my ODS ,
    The scenario is like that i am getting data from ODS1 and ODS2 and the data is uploaded and consolidated into ODS3 from the above two ODS"s 1&2,
    Thanks in advance,
    With Regards,
    Ram

    Hi Ram,
    There are several places where source data get modified before landing in ODS.
    Well please check out every place, for possible modification of data based on Code, routine, selections, master data lookup etc.
    To start with u can take data for sample selections and see how it is getting modified.
    Data normally get aggregated based on Key's od ODS so, as you better aware about key of ODS, u can better understand how aggregation is taking place.
    This process of Data integration will give idea of how data is getting clubbed in BW.
    Hope this will help u to certain extent.

  • Need suggestion to get data from change log table of ODS.

    Hello,
    There is a case where i am loading opportunity header data from header ODS and opportunity item data from item ODS in the opportunity cube.
    Status (1= OPEN, 2= WON ETC) of the opportunity are available only in header ODS and not in item ODS.
    While loading data from header ODS to cube, I am loading it directly but while loading data from item ODS to cube i am using active data table of header ODS as a lookup in the update rule from item ODS to cube. I am selecting status from the active data table of header ODS while loading data from item ODS to cube.
    Since active data table will have only after image records, there is some data mismatch in the report as i am selecting data from active data table of header ODS while loading data from item ODS to cube.
    I need to select data from Change log in order to get before image also instead of active data table in order to overcome this issue. Is there any way by which i can do selection from Change log instead of active data table as change logs are generated at run time.
    Please let me know if you have any suggestions.
    Regards,
    Sanjay Chaurasia.

    Hi,
    You can use the changelog table of the DSO.
    Right click manage the Header DSO, go to the contents tab and click Change Log table. There you can see the technical name of the Change Log table.
    In the update rule Routine, give the tech name of Change log table instead of Active table name.
    Hope it helps.
    Krishna

  • Flat file data load - ODS - Look up data in Startroutine

    Hi All,
    There is a requirement that I have two ODS say 1) ABC and XYZ.
    For Both ODS , We load flat file data.
    First we load data to ABC for current fiscal period
    During the data load to XYZ, We lookup part nos data in ABC for current fiscal period , if data there , for those part nos we load XYZ Flat file data.
    My requirement is that , I need to fetch part nos data from ABC for Fiscal period < current fisacl period.  Then I need to extract already loaded data for those part nos from XYZ and Mark the flag field as Non reportable .
    How can we achieve this ?
    Please advice
    Thanks
    Ajay

    Hi ,
    Thanks for your reply.
    I have done so. When I add lines of My Internal table data to DATA_PACKAGE, It gives the syntax error that both structures are not unique. We have several fields in XYZ ods but they are not in Communication structure.
    Thats the problem. Also , if I write the code , will it be executed for each datapackage. I mean , for each datapacket process , my code will fetch whole data from ABC and then from XYZ. Repetion will be there?
    Any other logic can i use ?
    Thanks
    Ajay

  • Reg Usage of ODS Table in Transformation

    Hai All,
                I am new to SAP NetWeaver BI. Can i use the ODS Table in the transformation rules ?
    Is this the right approach  or not ? My requirement is i have  to poulate some infomration into new ODS depending on the data which is available in othere ods table.
    Regards
    Prashanth

    Hi Prashant,
    Please refer to the sources below to understand Transformations...
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/EN/e3/e60138fede083de10000009b38f8cf/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/EN/e3/e60138fede083de10000009b38f8cf/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/EN/e3/e60138fede083de10000009b38f8cf/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/EN/e3/e60138fede083de10000009b38f8cf/frameset.htm</a>
    Also refer to this white paper in SDN on Transformations
    <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19">https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19</a>
    To ensure good performance, use the Start or End Routine to execute such lookups on DSO tables.
    Regards,
    Shrikant

  • ABAP routine/lookup in update rule

    Hello Gurus, I am trying to do a lookup from 2 ODS's into one. I am trying to join sales and delivery data.
    My current idea is that I will use the 2LIS_11_V_SSL extractor that has SO, SOitm, DO, DOitm data and bring that into an ODS that has those four items as the key.
    During that update, I will need specific fields (mostly key figures - Net Price from the SalesOrder ODS, and Del. Qty from the DelOrder ODS).
    The SO and DO ODSs each have a key of SO/SOitm and DO/DOitm respectively.
    What I am trying to do is write a routine for each of the necessary fields to do a lookup on the source ODS and bring in the field value according to the SO/SOitm or DO/DOitm key.
    A simplified example
    <u>Target ODS</u> Initially coming from 2LIS_11_V_SSL (keys)
    <b>SO
    SOitm
    DO
    DOitm</b>
    Net Price
    Del. Qty
    <u>SO ODS</u>          
    <b>SO              
    SOitem</b>          
    Net Price       
    <u>Del Order ODS</u>
    <b>DO
    DOitm</b>
    Del Qty.
    I have the 4 key fields coming from another extractor, need to lookup the key figures from the other ODSs on the load
    If I could get some example code on how to do this I would greatly appreciate it! I was told an internal table might do the trick, but after scouring the forums I can't find anything that seems close enough.
    Thanks!
    Justin
    Message was edited by: Justin  Molenaur
    Message was edited by: Justin  Molenaur

    Ajay (or anyone else)...one more question
    Is there a way to limit the number of times that the net price field may be written.
    for example, a SO item may be associated with multiple delivery order items, so you only want to write the net price field once PER sales order item. If we did it just like above, everytime a sales order item had multiple delivery order items, there would be multiple net price values for each delivery order item, which is not correct (see spreadsheet).
    Sales Order     Sales Order item     Delivery Order     Delivery Order item     Net Price (SO)     Del Qty (Del)
    1     10     100     10     15     150
    2     10     101     10     25     200
    <u>2     20     101     20     <b>50</b>     250
    2     20     101     30     <b>50</b>     299</u>
    3     10     102     10     23     213
    4     10     102     20     27     476
    So the challenge would be to create a counter(?) or something that will only allow a SOitm to have only one net price.
    Thanks for you help!
    Justin
    Message was edited by: Justin  Molenaur
    Message was edited by: Justin  Molenaur

Maybe you are looking for