Lookup in BI Transformations

Hi Experts,
My requirement is to write a lookup in transformations
While loading data from DSO 1 to CUBE I need to perform a select statement on DSO A and with the results from select statement I need to again perform select on to a DSO B and get the values which I can use in result fields.
I am familiar with first select statement on DSO A and moving the data to a internal table, But I couldn’t able to figure it out  how can I write second select statement and align the results to the same internal table so that I can read it in end routine.
Please help me with pseudo code….
Any questions please let me know

HI,
try the below code here 2 select statements. looking up  the 2 DSO's.
TYPES : begin of ty_ds200,
         HE_STUDNT TYPE /BI0/OIHE_STUDNT,
         HE_STAGE TYPE /BI0/OIHE_STAGE,
         END OF ty_ds200 .
data : lt_ds200 type TABLE OF ty_ds200,
        ls_ds200 type ty_ds200 .
TYPES : BEGIN OF ty_dso400 ,
         HE_STUDNT TYPE /BI0/OIHE_STUDNT,
         /BIC/ZLC_GEO TYPE /BIC/OIZLC_GEO,
   END OF ty_dso400 .
data : lt_dso400 TYPE TABLE OF ty_dso400 ,
        ls_dso400 TYPE TY_dso400 .
if RESULT_PACKAGE is NOT INITIAL .
   SELECT HE_STUDNT HE_PRGRM HE_STAGE from /BI0/AHE_DS0200 into TABLE
  lt_ds200
     FOR ALL ENTRIES IN RESULT_PACKAGE
     WHERE HE_STUDNT = RESULT_PACKAGE-HE_STUDNT.
   SELECT HE_STUDNT HE_STORGP HE_STORGA HE_STCAMP  from
   /BI0/AHE_DS0400
     INTO TABLE lt_dso400 for ALL ENTRIES IN RESULT_PACKAGE
     WHERE HE_STUDNT = RESULT_PACKAGE-HE_STUDNT
     and DATETO = '99991231'.
   loop at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS> .
     READ TABLE lt_ds200 into ls_ds200 WITH KEY HE_STUDNT =
     <RESULT_FIELDS>-HE_STUDNT .
Hope it will help.
Thanks,
Phani.

Similar Messages

  • ABAP Command in Transformation routine

    Hi
      I had a Internal Table used in Lookup of a Transformation which is being populated from a Active Table of DSO.
      The Internal table has about 5 fields.
      My requirment is to check the data in the IT Stable after the select statement and Replace ',' in the data with '-'....is there any way we can achieve this
    Thanks

    Hi,
    Please use the below code. Its is just a rough work. You implement it as per your specifications,
    Loop at <source_packge> assigning <source_field>
    replace  ',' with '-' into <source_field>-<internal table field>.
    Now that you have replcaed. Next step is to modify the same
    modify <source_package> from <source_field> transporting <internal table field>.
    you can omit transporting addition if you want. No need to specify the index addition when using within loop and endloop
    end loop.

  • LOOKUP-Master Data Attribute (ABAP Code)

    Hi,
    My requirment
    ZCOMPANY is an attribute of ZCostcenter
    ZCost center is an attribute ZEMPLOYEE
    zcomp is an attribute of employee
    While Loading attribute data to employee i need to write Lookup/routine in transformations that will
    Based on ZCOSTCENTER data of an employee i has to read setup tables in BW and update ZCOMP of an employee(attribute) from ZCOMPANY  of ZCostcenter
    Please update me with the ABAP Code
    Thanks in advance

    Hi,
    This is the routine written in transformations.
    My requirment is to modify this a bit to include following conditions
    1)source_fields-costcenter
    (It needs to be converted to CAPS)(Bcaz ZCOSTCENTER consists all the caps)
    2)I want to include 'OBJVERS'='A' in the code
    Please update me with the code
    select /bic/zcompany from /bic/mzcostcenter
    into result
    where zcostcenter = source_fields-costcenter.
    end select.
    Thanks

  • Lookup routine problem

    Hi
        I have problem in Lookup routine in transformation.
    But need for some object which were not in Standard infocube 0sd_c03, i have created one customize Infocube ZSD_C03_1 where data have been coming from Standard 0SD_C03 infocube by Lookup Transformation routine & running full load DTP in Daily basis. It is working fn till today.
    But problem is that now size of data is very huge while full DTP run from 0sd_c03 to ZSD_C03_1. can any one give suggestion what should i do for only delta data come. lookup routine should update data in daily.plz help

    Hi
    In that case i would suggest you to have a DSO between the data loding process as your expectation cannot be met with data
    loading between cube to cube.
    Just create a standard DSo between the cubes and do the data loading so that the delta handling will be as per your
    expectation
    Prathish

  • LookUp to the same table with multiple conditions

    Hi,
    I nead to do a lookup to the same table in the flow but with diffrent quieres, each query contains it's own 'where'.
    Can I do it somehow in one look up or do I have to use a few ?
    select a from table where a=1
    select b from table where c=3
    Thanks

    Hi,
      Using multiple lookups will be a cleaner approach. If you are using multiple lookups on the same table consider using Cache transform. Refer the below link for details on Cache transform
    Lookup and Cache Transforms in SQL Server Integration Services
    Alternatively if you want to go ahead with single look up , you may have to modify the SQL statement in the Lookup accordingly to return the proper value. In you case it may be
    select a,b from table where a=1 or c=3
    Note : Consider the above as a pseudo code. This needs to be tested and applied based on your requirement.
    Best Regards Sorna

  • Combining Purchasing and AP data

    Trying to combine a bit of AP data with some Purchasing info.  The data mix would be about 75-80% Purchasing data to 20-25% AP data.  Multiproviders don't work unless the format is the same, and infosets are problematic.  We've got a cube built for each, but now are trying to figure out the best way to proceed.  We've hit upon 4 solutions so far, each of which have their own issues:
    1) Infoset solution 1 -- Infoset both cubes
    2) Infoset solution 2 -- Infoset the purchasing cube and outer join an AP DSO
    3) Build the AP cube out to mirror the format of the Purchasing cube (plus the added AP fields) and fill in the needed Purchasing data using an ABAP lookup in the transformation to fill the gaps of data from Purchasing.
    4)  Add the fields needed from AP to the Purchasing Cube and look up the data during Purchasing loads (similar to option 3).
    Any other solutions anyone else can come up with?  Thanks in advance.

    Did you figure out what is the best approach...bcoz I am having the same situation.
    could you pl throw some more light if you had any other issues using any of the sol
    mentioned above.

  • Using SSIS 2012 - merge join component to transfer data to destination provided it does not exist

    HI Folks,
    I have a table - parts_amer and this table exists in source & destination server as well.
    CREATE TABLE [dbo].[Parts_AMER](
     [ServiceTag] [varchar](30) NOT NULL,
     [ComponentID] [decimal](18, 0) NOT NULL,
     [PartNumber] [varchar](20) NULL,
     [Description] [varchar](400) NULL,
     [Qty] [decimal](8, 0) NOT NULL,
     [SrcCommodityCod] [varchar](40) NULL,
     [PartShortDesc] [varchar](100) NULL,
     [SKU] [varchar](30) NULL,
     [SourceInsertUpdateDate] [datetime2](7) NOT NULL,
     CONSTRAINT [PK_Parts_AMER] PRIMARY KEY CLUSTERED
     [ServiceTag] ASC,
     [ComponentID] ASC
    I need to exec the following query using SSIS components so that only that data ,is transfered,which does not exist at destination -
    select source.*
    from parts_amer source left join parts_amer destination
    on source.ServiceTag = destination.ServiceTag
    and source.ComponentID=destination.ComponentID
    where destination.ServiceTag  is null and destination.ComponentID is null
    Question - Can Merge component help with this?
    Pl help out.
    Thanks.

    Hi Rvn_venky2605,
    The Merge Join Transformation is used to join two sorted datasets using a FULL, LEFT, or INNER join, hence, not suitable in your scenario. As James mentioned, you can use Lookup Transformation to redirect the not matched records to the destination table.
    Another option is to write a T-SQL script that makes use of
    Merge statement, and execute the script via Execute SQL Task.
    References:
    http://oakdome.com/programming/SSIS_Lookup.php 
    http://www.mssqltips.com/sqlservertip/1511/lookup-and-cache-transforms-in-sql-server-integration-services/ 
    Regards,
    Mike Yin
    TechNet Community Support

  • How to convert rows to columns in sql server 2008

    How to convert rows to columns in sql server 2008 using the GROUP BY function? (only one query allowed)

    Lookup the Pivot transformation. From BOL:
    The Pivot transformation makes a normalized data set into a less normalized
    but more compact version by pivoting the input data on a column value. For
    example, a normalized Orders data set that lists customer name, product, and quantity purchased typically has multiple rows for any customer who purchased multiple products, with each row for that customer showing order
    details for a different product. By pivoting the data set on the product column, the Pivot transformation can output a data set with a
    single row per customer. That single row lists all the purchases by the customer, with the product names shown as column names, and the quantity shown as a value in the product column. Because not every customer purchases every product, many columns may contain
    null values.
    When a dataset is pivoted, input columns perform different roles in the pivoting process. A column can participate in the following ways:
    The column is passed through unchanged to the output. Because many input rows
    can result only in one output row, the transformation copies only the first
    input value for the column.
    The column acts as the key or part of the key that identifies a set of
    records.
    The column defines the pivot. The values in this column are associated with
    columns in the pivoted dataset.
    The column contains values that are placed in the columns that the pivot
    creates.
    Paul

  • Lookup transformation - Performance Issue -Please help!

    Hi,
     I have a Source table with 5 million rows. I am pulling all the rows from the source table, then doing the lookup with 5 different tables one by one.
    I use Full cache as the lookup table size is very less only. I used 'Ignore Failure' option in lookup table as I need to do the left join. That means, even if there is NO match, those records also should be passed to the bottom.
     Now, the problem is it is taking a lot of time. To load 1,00,000 records, it is taking 1 hour. The how about 5 Million rows? 50 hours? Could you please help me to find out what is the  mistake i am doing here?

    Is the performance still very poor if you only add for example a row count transformation after your source?
    How many rows are there in the lookup tables? Are you only selecting the columns you need? Is the data type of the selected columns very large?
    Please mark the post as answered if it answers your question | My SSIS Blog:
    http://microsoft-ssis.blogspot.com |
    Twitter

  • Lookup in transformation not fetching all records

    Hi Experts,
    In the routine of the transformation of a DSO (say DSO1), i have written a look-up on other DSO (say DSO2) to fetch records. I have used all the key fields of DSO2  in the Select statement, Still the look-up is not fetching all the records in DSO1. There is difference in the aggregated value of the Key Figure of both the DSOs. Please suggest, how can i remove this error.
    Thanks,
    Tanushree

    hi tanushree,
    The code which yu have written in the field routine for lookup is not fetching the data. you can debug the field routine code in the simulation mode of execution of DTP by keeping a break point after the transformation.
    you can test the routine with out actually loading the data..
    double click rule where you have routine and in the below you have option called test routine.
    here you can pass input parameters..
    i hope it will give you an idea.
    Regards
    Chandoo7

  • Abap error in Transformation Endroutine - DSO Lookup

    Hi,
    I am trying to populate Key figure field in transformation end routine but I got this error.
    I have used similar code to perform DSO lookup without getting errors
    E:Unknown column name  "X_COST" until runtime, you cannot specify a field list.
    Data rp TYPE tys_TG_1.
    LOOP AT RESULT_PACKAGE INTO rp.
    SELECT SINGLE X_COST FROM DSO_CADO00 INTO rp- X_COST
    WHERE X_MATID  EQ rp X_MATID.
    MODIFY RESULT_PACKAGE FROM rp.
    ENDLOOP.
    thanks

    Hi,
    Just realised that  I was using the wrong DSO to fetch the data.
    It has now been corrected and the code is working properly.
    thanks alot

  • Can we replicate Informatica Lookup transformation in ODI Interface?

    So was just wondering if we could replicate a lookup transformation in an ODI join of some sort where in only one value is returned for multiple matches of the same item....something like a max for a group or something while joining 2 tables...
    So for example I have 2 tables...A columns (Attendee_id,xyx,byx)
    B columns (partnerid,attendee_id,xyz,bxc)
    I want to join table A and B on Attendee_id and get the partner_id---but I want only one record in case of multiple matches for a particular attendee_id
    can we do this??

    No responses yet...Ive tried doing a left outer join...but it still returns all the matches...I want to return only one record....ne help from the xperts?

  • Identifying all TR/UR/Transformations for LOOKUP Object in whole BW System

    Hi ,
    I have one ODS object ZTEST in BW system. This ODS object is used in many other data flow's Transfer Rules, Update Rules and Transformations as LookUp object like
    SELECT * FROM /BIC/AZTEST00 INTO ITAB WHERE DELIVERY = DATA_PACKAGE-DELIVERY
    Now how can i findout all the Transfer Rules, Update Rules and Transformations where this ODS object ZTEST is used as the Lookup object in all BW system .
    Please let me know the step by step procedure for it .
    Regards
    Mubeen

    Mubeen,
    This is kind of hard to do.
    One thing that can possibly alleviate your effort would be to look for
    /BIC/AZTEST00 in the table RSAABAP.
    But this is not a complete output and you will still have to trace back the generated programs to the original TR / UR etc... but thien - this  might give you a start.
    P.S We tried this in a previous project but gave up because :
    1. We could not trace the original transformations effectively
    2. The output of RSAABAP is not a complete list - but it gave us an idea..

  • Master Data table in a Lookup in Transformation

    Hi,
    I am writing a Lookup in Transformations.As per the logic i need to read the Master Data Table of a Infoobject to get the Attribute from the master data table.
    The Master data is not time dependent
    Which Master Data table should i use in my Logic
    /BI0/M *
    /BI0/P *
    Thanks

    If there is no time dependency, use /BI0/P *

  • Fuzzy Lookup Transform not writing to destination

    I'm using MSSQL 2008R2 on a MS Server 2008 R2.
    I've tried using a flat file, excel, and creating tables to use the Fuzzy Lookup transform.
    But each time, the source object and Fuzzy Lookup transform turn yellow, but the destination is never reached.
    I'm not trying anything fancy for this now, I have been reduced to just trying to match some test data to see if I was doing anything wrong.
    For my source, it is simply a single column table, we will call it table A, with Oatmen, Juce, and Conut in the Name column.
    The reference table, table B has Oatman, Juice and Coconut in the Name column.
    IS there a known issue with the Fuzzy lookup that I have not found?
    Thanks
    A valiant warrior dies but once, a coward dies a thousand times before his death.

    It could be the bitness issue since the server is 64 bit, change
    to TRUE
    Arthur My Blog

Maybe you are looking for

  • Can't recover App, Phone off

    I got my Iphone 5s yesterday, I tried using the normal App recovery but some Apps could not be recovered so I used ITunes. While this was happening, it got stuck with the Itunes logo and a plug-in icon. And Itunes could no longer detect the Iphone. I

  • Today's Esoterica: What are the Differences between Tint, Tint, and Tint?

    There are three controls in Aperture named Tint: - The lower half of the "Temperature and Tint" panel in the White Balance Brick. - The eponymous section in the Enhance Brick - The eponymous Quick Brush, which, when used, creates a Tint Brick. Are th

  • Funtion Module to convet Date's month from numeric to words ???

    Hi guys, I have a requirement such that:- For Date:- 06.07.2007 (DD.MM.YYYY) i want it to display as 06-July-2007 Is there any funtion module to do that. Regards Rahul

  • Iphoto : mailing pictures

    how do i set up iphoto so that i can send pictures through my earthlink email account. do i have no choice but to use mac.com? is there a way to configure around this impasse?

  • Screen share

    my mother has just recently bought the entry level macbook, and i was wondering why i can share my screen with her but she cant with me.... would be really useful as some of the questions she asks are so hard to talk her through. any fix for this we