JDBC-XI-FILE scenario. How to extract data from multiple tables

Hi,
At this moment I didn't have the access for XI system. So here I have some silly question. Could you please clarify the same ??
If I got to extract data from single table using JDBC adapter I can put the below query in communication channel
SELECT *FROM orders WHERE new='true'.
But if I got to extract data from multiple tables, logic to be used should be like as shown below. ( from previous thread------prabhu).
SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
FROM <Table_1> INNER JOIN <Table_2> on
<Table_1>.CARDNO = <Table_2>.CARD
where REC_DAT = <condition>
union
SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
FROM <Table_1> INNER JOIN <Table_2> on
<Table_1>.CARDNO = <Table_2>.CARD
where REC_DAT = <condition>
But my query is ........how to put the above entire code in one line. (i.e in Qery place of communication channel ) ??
Thanks
Kumar

Hi Palnati,
    You either use a select query with join or a stored procedure which will contain the logic to extract the data from multiple tables. But, the limitation in case of stored procedure is u can hv only one selct query in it.
You write ur actual query provided in the parameter 'Query SQL Statement". u can also wrt a stored procedure in it. Also, u can provide a update statement in it which will update a certain flag so tht u don selct the data again.
Check the following link
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm</a>
Regards,
Akshay
Message was edited by:
        Akshay Salunke

Similar Messages

  • How to extract data from multiple tables (always got errors)

    Dear Experts,
    I have a simple mapping to extract data from multiple tables as a source (A, B, C) to a target table (X). Below is the picture:
    (Sources)....(Target)
    A----------------***
    B----------------X
    C----------------***
    Sample Source Data:
    Table A:
    ColA1
    100
    200
    etc
    Table B:
    ColB1 ColB2 ColB3
    10 Y Ten
    20 Y Twenty
    30 Y Thirty
    etc
    Table C:
    ColC1 ColC2
    11
    12
    13
    etc
    Target table (X) should be (just has 1 group INGRP1):
    ColA1 ColB1 ColB3 ColC1
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    Scenarios:
    1. Directly map from A, B, C to X. Unable to map with error message: "API8003: Connection target attribute group is already connected to an incompatible data source. Use a Joiner or Set operator to join the upstream data first before connecting it into this operator."
    2. Map each source to Expression Operator and then map from each Expression to target table. I am able to map all attributes successfully but got error when validating it with message: "VLD-1104: Attributes flowing into TEST.EXPR_SRC.INGRP1 have different data sources."
    How can I achieve the correct mapping for this purpose?
    Use Joiner? I have no key to join the sources
    Use Set? The sources have different number of columns
    Thanks in advance
    Prat

    Thanks Nico,
    I think it will results data like this:
    100 10 Ten 11
    200 20 Twenty 12
    300 30 Thirty 13
    etc
    and not the expected:
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    But it inspired me to solve this by adding key expression in each source table (B & C) to be joined to table A with this formula:
    100+TRUNC(INGRP1.COLB1,-2)
    Regards
    Prat

  • Does ODI has ability to extract data from multiple tables

    We have requirement using ODI to extract data from multiple tables depending on certain logic and spool 100+ files.
    How efficient ODI is in data extraction from several multiple tables especially when the extraction is dependent on certain business logic conditions ? Also, if anyone used Peoplesoft Application Engine process to extract volumes of data, how efficient Peoplesoft Applicaiton Engine process is as compared to ODI ? I will really appreciate if someone throws some light on this ? Thanks in advance.
    Ram

    One more option
    Create two Integration Interfaces and launch them sequentially:
    1st Interface : select a IKM ... Append and activate the Distinct rows check box.
    2nd Interface : select an IKM ... Incremental Update and set the UPDATE option to No.
    Be aware that the update key in this Integration Interface should be composed of all the target columns mapped. Also activate the Distinct rows check box.
    Thanks,
    Sutirtha
    Edited by: Sutirtha Roy on Jul 21, 2009 10:08 AM

  • How to extract data from 12 tables ?

    Hi experts,
    I want to extract data from 12 tables into bi.
    How can we do this. And also can we extract some fields from
    a structure?
    Full points will be assigned.
    Regards,
    V N.

    Hi,
    First you need to check if the tables are standard tables or custom tables. If they are standard tables check which extractors are using those tables.
    If they are not being used by any of the standard extractors then you you need to create generic datasource for the same. The same hold true for custom tables as well. For custom tables, you'll need to create generic datasource. If you search the forum for generic datasources you'll get a lot of information.
    Its very important that you understand the table relationships, data volumes, if delta is possible or not, data granularity, etc for your datasource design.
    Cheers,
    Kedar

  • Extracting data from multiple tables using DB connect

    Hi,
       I am having different tables which are  having the same structure in oracle database but  there names are different.Now i have only one datasource at BI side.This datasource shld extract data from the  tables dynamically.How can i do it using DB Connect .
    Thnxs

    ahh I see - problem as you said then is if you then take on a new location!
    I would then put into the source system a table identifier and create a view across all the tables
    Then dbconnect from the view and use the selection parameter of table parameter if you wanted one infopackage per "location"
    If you do need to have a new table in the source then just expand the view and create a new ipak
    hence NO bw changes required that need a dev-q-p transport - just the ipak in prod and it;s the source systems problem to add the extra table to the view

  • How to  extract  data from PCD tables to create  custom activity report

    Hi Friends
    I have a requiremnt for creating custom portal activity report, even though we have
    standard report for that, we need to extract the data from the following pcd tables
    WCR_USERSTAT, WCR_WEBCONTENTSTAT,WCR_USERFIRSTLOGON,
    WCR_USERPAGEUSAGE.
    This extraced data will be used to create BW Reports.
    my questions  are
    1.How to extract the  data from   pcd tables?
    2.can i use   UME API   for  extracting the  data from the given PCD tables?
    3.Can i querry   the  PCD tables from JSPdynpage or  Webdynpro APP?
    Please guide me.
    Thanks in advance
    Ashok

    Hi Kishore,
    Refer to
    http://wiki.sdn.sap.com/wiki/display/Snippets/DirectAccesstoDatabaseTables
    http://wiki.sdn.sap.com/wiki/display/WDJava/OracleConnectivitywithEJBusingWebDynproApplication
    JDBC Connectivity with Webdynpro and Max DB
    Thanks
    Prashant

  • Need suggestion on how to extract data from a table

    Many years ago, I wrote many Perl scripts to increase my work productivity.
    Now I am starting learning Java, Javascript and PHP for some purposes. Just wrote a simple html2txt java program.
    Now I need experts' suggestion for one specific purpose - extract data from a html table. One of the examples is here: http://mops.tse.com.tw/nas/t06sa18/200902/A02_2454_200902.htm
    I need to extract datum from the table and make some analysis. (Txt is in Chinese, sorry)
    What is the best way to code it? Java, PHP or other? If Java, any suggestion what classes/module and approach to use?
    Thanks very much.

    xcomme wrote:
    Many years ago, I wrote many Perl scripts to increase my work productivity.
    Now I am starting learning Java, Javascript and PHP for some purposes. Just wrote a simple html2txt java program.
    Now I need experts' suggestion for one specific purpose - extract data from a html table. One of the examples is here: http://mops.tse.com.tw/nas/t06sa18/200902/A02_2454_200902.htm
    I need to extract datum from the table and make some analysis. (Txt is in Chinese, sorry)
    What is the best way to code it? It this a one shot (one time only task)? Then the best way is whatever way you are most comfortable with and which works.
    If on going then I doubt language choice matters but using a html parser rather than attempting to parse it yourself is going to help in any language.
    And are you starting with html files or starting with a http server? The two are very different.

  • How to extract data from MDTC table.

    Hi all.
    I want to fetch data from MDTC table. But in that table field CLUSTD contain compressed data. How can i extract that data.
    Can i extract data for structure MDPSX.
    is MDTC table is used in function module MD_STOCK_REQUIREMENTS_LIST_API .
    Please help me and give the information.
    thanks.

    Dear Sam,
    I would suggest you to have a look at the function module CHANGEDOCUMENT_READ u2013 you can use this function module as a core in the developed function module for generic extractor. Unfortunately, the suggested function module can not handle import parameters for field names, so the strategy which can be applied here is to use this function module to fill the internal table based on restrictions on object class and table name and then go through filled internal table and delete records which are not relevant for fields KOFIZ or ABRSPERR.
    As for delta implementation, would you please advise if delta relevant field based on timestamp generated on date and time of the change document is sufficient for your needs? If so then you can use fields UDATE and UTIME to generate timestamp on them including the field containing generated timestamp to the extract table. Next step here is to choose this field as delta relevant field in the Generic DataSource maintenance (TCode RSO2).
    Please inform me if this solution suits you or if you have any questions or concerns regarding it.
    My best regards,
    Vadim

  • How to Extract data from Cluster table  and transperant table

    Hello BW Experts ,
    I want to extract the data from cluster table BSEG and a transperant table BKPF .
    The primary fields are BELNR , GJHAR and BUKRS.
    the fields of table BKPF to extarct is BUDAT and fields of BSEG table is HKONT , BSCHL , ZUONR and POSID.
    I can not create a view over these two tables as BSEG is a Cluster table.
    Please guide me.
    Regadrs ,
    Amol.

    hi Amol,
    take a look Sigg's weblog
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    you can use RSAX_BIW_GET_DATA_SIMPLE as sample, there specified import parameters
    FUNCTION RSAX_BIW_GET_DATA_SIMPLE.
    ""Lokale Schnittstelle:
    *" IMPORTING
    *" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
    *" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *" TABLES
    *" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *" E_T_DATA STRUCTURE SFLIGHT OPTIONAL
    *" EXCEPTIONS
    *" NO_MORE_DATA
    *" ERROR_PASSED_TO_MESS_HANDLER

  • Extracting data from multiple tables based on somelogic on each tables

    Hai
    I need to extract data from some base tables.
    1) first i need extract COMPANYCODE, PROFIT CENTER , PRODUCT from ZRLR custom Rl3-table.
    2) Then i need extract MATERIALS based on above selected COMPANY CODE , PROFIT CENTER , PRODUCT from MKAL , CRHD Base R/3-Tables.
    3) Then i need to extract the MATERIALS based on the above PROFIT CENTERS from MARC table with filters Material Type = 2P , 3P, 2N, 3N , 2S.
    How i extract like this data . Please let me know
    kumar

    Hi,
    you need to create a generic extractor using a function module for this. For some help check this: /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Additionally you can get a template from me. You'll find my email in my business card.
    regards
    Siggi

  • How to get data from multiple tables

    Hello Everyone,
    I need to read data from a few tables (VBAK, VBAP, VBUK, VBUP etc.) because I'd like to get all open Sales Orders. I've tried to use RFC_READ_TABLE but it looks like it can read only 1 table at a time. I've tried to read data from individual table and then join them but it didn't work out very well because I got about 1.5 millions records from just the VBUP table. So anyone knows if there is any function that I can use to join those tables and just get the records I need?
    Any help would be highly appreciated.

    Hi Nhan,
    Thank you for your reply.
    Do I have to be a SAP developer to create BAPI on SAP? What kind of access rights do I need?
    I've tired to use other BAPIs such as BAPI_SalesOrder_GetList and it doesn't work for me because I don't have all customer numbers and I need to get all un-shipped orders for all customers.
    I've read a post on the internet brieftly menitoned that we can create a table to store information about the tables we want to join and then call the RFC_READ_TABLE function. Do you know if that is possible?
    Is there any other way you can think of?

  • How to extract data from multiple flat files to load into corresponding tables in SQL Server 2008 R2 ?

    Hi,
              I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
              I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
    load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job.  Actually I have to automate this job. Few files are in same format(with same column names
    and datatypes) where others are not.
    1. Do I need to create 20 different projects ?
                   or
        Can I implement this in only one project by having 20 packages?
                 or
        Can I do this in one project with only one package?
    Thanks in advance.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • How to extract data from Oracle Table to an Oracle XMLtype field

    All,
    I'm very new with ODI and I'm looking for a way to implement the following scenario:
    I have the Oracle table A, already mapped to Data Model A. This table has the following fields:
    field X (PK)
    field Y
    field Z
    field W
    I have a table B, already mapped to Data Model B. This table has the following fields:
    field X (PK)
    field V (XMLType)
    I want to extract the data from Table A to a XML file with the following structure:
    <X> yada yada yada </X>
    <Y> yada yada yada </Y>
    <Z> yada yada yada </Z>
    <W> yada yada yada </W>
    and then insert this file into the field V of Table B. How can I do that?
    TIA,
    Rodrigo

    You can use UDConnect to get from Oracle database in to BW
    <b>Data Transfer with UD Connect -</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
    <b>Prerequisites</b>
    You have installed the SAP WAS J2EE Engine with BI Java components.  You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
    Hope it Helps
    Chetan
    @CP..

  • How to extract data from monthly tables for annual balance chart?

    Hello Again!
    I am wanting to decide whether to enter all of my transactions into one table for the whole year or separate tables for each month. If I was to use one table for the whole year it would probably have in the region of 1000 entries, and as I understand it, Numbers doesn't work so well with such large tables. Also, as I will be mostly using Numbers on my iPad, where it runs slower, this may well slow things down considerably. Another reason for using Monthly Tables is that it would be easier to search.
    Having said this, I am using the following method to construct balance charts for my accounts which seems to depend on having just one table for all transactions for the year. Here is a sample of the transactions table:
    which updates the balance for each account after each new transaction is entered.
    Then I use the following table for creating the balance charts:
    It uses the following formula to return the balance at the end of each week for each account (this is the formula for Account 1) which then is displayed in the chart.
    =LOOKUP(A2,$Week Number,All Transactions :: Account 1)
    If I was to use the Monthly Tables method it is not obvious to me how I would create the Weekly Balance Table, given that I would need to draw data from 12 different tables, and that some of these Tables would contain the same Week Number (for weeks that overlap months).
    I would be grateful for any advice on achieving the result I am looking for by the most efficient method.
    Thanks
    Nick
    P.S. Hopefully this is the last question for a while!

    I wasn't urging you to keep an annual table but to spit it on an easier to rule basis.
    Split it in chuncks of exactly 35 days starting from the first one of the 'year' in operation
    Doing that everything will be easier
    the index of a day will be calculated by
    =DATEDIF(B,D,"D")+1
    The index of the 'custom_week' will be calculated by :
    =1INT((DATEDIF(B,D,"D")1)/7)
    So, it would be easy to gather datas from a given 'custom_week'.
    Yvan KOENIG (VALLAURIS, France) jeudi 5 août 2010 10:22:25

  • How to extract data from cluster table

    Hi, experts,
    Here I want to extract change documents, which is from tables CDHDR(header) and CDPOS(line items). The problem is that CDPOS is a cluster table so that I can't create a view to develop a generic data source.
    I have search on the forum and some one said generic data source based on function module was a choice, but I think coding FM is so complex, especially including delta implementation.
    Could any one give me some advice? or give me some coding samples?
    Thanks a lot!

    Dear Sam,
    I would suggest you to have a look at the function module CHANGEDOCUMENT_READ u2013 you can use this function module as a core in the developed function module for generic extractor. Unfortunately, the suggested function module can not handle import parameters for field names, so the strategy which can be applied here is to use this function module to fill the internal table based on restrictions on object class and table name and then go through filled internal table and delete records which are not relevant for fields KOFIZ or ABRSPERR.
    As for delta implementation, would you please advise if delta relevant field based on timestamp generated on date and time of the change document is sufficient for your needs? If so then you can use fields UDATE and UTIME to generate timestamp on them including the field containing generated timestamp to the extract table. Next step here is to choose this field as delta relevant field in the Generic DataSource maintenance (TCode RSO2).
    Please inform me if this solution suits you or if you have any questions or concerns regarding it.
    My best regards,
    Vadim

Maybe you are looking for