Select data from multiple servers(instances)

Hi All,
Is possible that we can login to SQLPLUS of one server and be able
to select data from other servers. For MSSQL server we can use
opendatasource but I don't know if in ORACLE we can
get the data from other servers by login to SQLPLUS of one server.
Your help is greatly appreciated.
Thanks in advance for your response.
JP

Hi,
Please try this ...
DATA: BEGIN OF ITAB1 OCCURS 0.
        INCLUDE STRUCTURE A_TABLE.
DATA: END OF ITAB1.
DATA: BEGIN OF ITAB2 OCCURS 0.
        INCLUDE STRUCTURE B_TABLE.
DATA: END OF ITAB1.
DATA: BEGIN OF ITAB3 OCCURS 0.
        INCLUDE STRUCTURE C_TABLE.
DATA: END OF ITAB3.
SELECT *
INTO TABLE ITAB1
FROM A_TABLE
WHERE A_ID IN S_A_ID.
SELECT *
INTO TABLE ITAB2
FROM B_TABLE
WHERE A_ID IN S_A_ID.
SELECT *
INTO TABLE ITAB3
FROM C_TABLE
WHERE A_ID IN S_A_ID.
To download to PC or application server, please check this sample codes.
http://www.sapdevelopment.co.uk/file/file_downloadpc.htm
http://www.sapdevelopment.co.uk/file/file_downloadsap.htm
Regards,
Ferry Lianto
Please reward points if helpful.

Similar Messages

  • Selecting data from Multiple Partitions in a single select stmt.

    Hi all,
    My Database is very large & my tables are partitioned.
    My question is:
    1) If my data is spread across multiple partitions, is there any way to select data from multiple partitions in a single query?
    If we dont mention partition name also it works fine, but perofmance wise it will be very slow. (Using EXPLAIN PLAN)
    (Note:I dont want to make use of Union concept, i want to do it in a single select statement)
    For ex:
    qry1.sql:
    select empno from emp_trans partition (P012000)
    This above query(qry1.sql) will work fine.
    qry2.sql:
    select empno from emp_trans partition (P012000,P022000)
    The above query(qry2.sql) will return will return the following error:
    ORA-00933: SQL command not properly ended
    If anybody has any solution for this, pls mail me immediately.
    Thanks in advance
    bye
    null

    All my queries are dynamically generated. All my tables are also indexed partition wise based on date field. My question is, if i want to mention multiple partition names at the time of generating my query(select), then with parformance will be good. I have refered some books, inthat what they say is to use UNION concept, i dont want to use that, instead i want in a single select statement.
    Thaks for ur reply
    Bye
    null

  • How to select data from multiple dropdowns(HTMLDB)

    Hi,
    How to get the data from multiple dropdowns in the same report. Both the dropdowns are gerring data from the same table.
    Ex:
    abc-1st dropdown
    pqr-2nd dropdown.
    when abc and pqr are blank, it should display all records by default. If abc="some value" and pqr is empty then it should display all values corresponding to abc.
    Regards,
    Pallavi

    Pallavi,
    I think this might be something you are looking for:
    http://htmldb.oracle.com/pls/otn/f?p=31517:99
    There are some examples on how to modify your SQL to get it working the way you want.
    Denes Kubicek

  • Need to get data from multiple database instances in a single query

    Hi,
    I need a small favour from you guys. The prob is as follows:
    I need to get name, row_id from table A from schema 1 and gbu_name, name from table B from schema 2 where a.name = b.name. I wrote the query in the following manner:
    SELECT a.name, a.row_id, b.gbu_name
    FROM Schema1.A as a, Schema2.B as b
    Where a.name = b.name
    But this query is not working and the error is like " The table does not exists".
    Please update me how to avoid the error and get the right sort of result.
    Thanks & Regards,
    Debabrata

    Ah, youre actually asking different things.
    In your topic title, you say youre running separate instances
    In your body text, you say you are under different user/schema
    So tell me, do you have more than one database or not? How many entries in your TNS file?
    I would say, for "multiple database instances"
    SELECT
      a.id, b.id
    FROM
      tableA a
      INNER JOIN
      tableB@OTHER_DATABASE_LINK_NAME b  <--NOTE!
      USING(id)And of course you will have to look up CREATE PUBLIC DATABASE LINK sql..
    Message was edited by:
    charred

  • SELECT data from two databases

    I have two databases that I need to select data from in a
    single SELECT. Using DWs Advanced window for creating the select I
    don't see any way to select more than 1 Connection. Both databases
    have unique user and passwords but reside on the same server. Any
    idea how I can write a single SELECT to get data from both dbs. I
    assumed it would be similar to selecting data from multiple tables
    within the same db but the connection part is stumping me. Any
    ideas would be greatly appreciated.

    TouchstonePress wrote:
    > Page 48, Developing a Web Database Application . . .
    speaks about making a
    > database with two related TABLES each with the same
    PRIMARY KEY column with
    > which to identify a customer using their unique number.
    That's the basic technique for joining two tables in the same
    database.
    The original poster has tables in different databases that
    have
    different user accounts and passwords.
    Although it's possible to join two databases, you cannot do
    it unless
    you have one user account with the same privileges on both
    databases.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • ** Is it possible to give select command from multiple tables in JDBC

    Hi Friends,
    Is it possible to give the select command to select data from multiple tables directly in the 'Query SQL statement' in JDBC sender communication channel ? (Instead of Stored Procedure)
    Thanking you.
    Kind Regards,
    Jeg P.

    Hi,
    here is a sample:
    Table #1
    Header
    Name EmpId Status
    Jai 5601 0
    Karthik 5579 0
    Table #2
    Name Contactnumber
    Jai 9894268913
    Jai 04312432431
    Karthik 98984110335
    Karthik 04222643993
    select Header.Name, Header.EmpId, Item.Contactnumber from Header,Item where Header.Name = (select min(Header.Name) from Header where Header.Status = 0) and Header.Name = Item.Name
    Regards Mario

  • Folder Comparison from multiple servers

    I need to compare folders from multiple servers which do not have direct connection so i was trying to generate a text file with command dir /b /s >c:\server1.txt and feed them to script to compare. 
    my desired output is csv file in the following format
    File name,Server1,server2,server3,is it missng file?
    File1,yes,yes,yes,No
    file2,Yes,Yes,No,Yes
    File3,Yes,No,Yes,Yes
    File4,No,Yes,Yes,Yes
    these folders contains few hundred thousand files and the script is taking 4 to 5 hours to run the comparison. i thought threads will help to run fast using parallel processng but did not help. i have no expreience with threads and after searching for examples
    and implementing it was even slower than normal. 
    i probably am doing something wrong. Any help is much appreciated. 
    The following is the script so far and it works fine but its taking long time.
    [array]$contentArray = @()
    [array]$allfileslist = @()
    [array]$uniquefileslist = @()
    [array]$allfilesSRVlist = @()
    [array]$srvlist = @()
    $FolderName = Split-Path -parent $MyInvocation.MyCommand.Definition
    $reportName = $FolderName + "\ComparisonReport3.csv"
    $ListOfFiles = get-childitem $FolderName
    $List = $ListOfFiles | where {$_.extension -ieq ".txt"}
    $list.count
    $index = 0
    foreach($listitem in $List){
    $listfilename = $listitem.FullName
    $listname = $listitem.Name
    $listname = $listname.replace(".txt","")
    $srvlist = $srvlist + $listname
    write-host $listfilename
    #$StrContent = get-content $listfilename
    $StrContent = [io.file]::ReadAllLines($listfilename)
    $contentArray += ,@($StrContent)
    $StrContent.count
    $contentArray[$index].count
    $index = $index + 1
    for($i = 0;$i -lt $index;$i++){
    $allfileslist = $allfileslist + $contentArray[$i]
    $allfileslist.count
    $uniquefileslist = $allfileslist | sort-object | get-unique
    $Stroutline = "File Name,"
    foreach($srvlistitem in $srvlist){
    $Stroutline = $Stroutline + $srvlistitem.ToUpper() + ","
    $Stroutline = $Stroutline + "Is it Missing file?"
    Write-Output $Stroutline | Out-File "$reportName" -Force
    foreach($uniquefileslistitem in $uniquefileslist){
    $Stroutline = ""
    $missingfile = "No"
    $Stroutline = $uniquefileslistitem + ","
    for($i=0;$i -lt $index;$i++){
    if($contentArray[$i] -contains $uniquefileslistitem){
    $Stroutline = $Stroutline + "Yes,"
    else{
    $Stroutline = $Stroutline + "No,"
    $missingfile = "Yes"
    $Stroutline = $Stroutline + $missingfile
    Write-Output $Stroutline | Out-File "$reportName" -Force -Append
    $j++
    Following is the script i modified using threads example. this is running even slower.
    [array]$contentArray = @()
    [array]$allfileslist = @()
    [array]$uniquefileslist = @()
    [array]$allfilesSRVlist = @()
    [array]$srvlist = @()
    $FolderName = Split-Path -parent $MyInvocation.MyCommand.Definition
    $reportName = $FolderName + "\ComparisonReport3.csv"
    $ListOfFiles = get-childitem $FolderName
    $List = $ListOfFiles | where {$_.extension -ieq ".txt"}
    $list.count
    $index = 0
    #$contentArray = New-Object 'object[,]' $xDim, $yDim
    foreach($listitem in $List){
    $listfilename = $listitem.FullName
    $listname = $listitem.Name
    $listname = $listname.replace(".txt","")
    $srvlist = $srvlist + $listname
    write-host $listfilename
    #$StrContent = get-content $listfilename
    $StrContent = [io.file]::ReadAllLines($listfilename)
    $contentArray += ,@($StrContent)
    $StrContent.count
    $contentArray[$index].count
    $index = $index + 1
    for($i = 0;$i -lt $index;$i++){
    $allfileslist = $allfileslist+ $contentArray[$i]
    $allfileslist.count
    #$uniquefileslist = $allfileslist | select –unique
    get-date
    $uniquefileslist = $allfileslist | sort-object | get-unique
    $uniquefileslist.count
    get-date
    $Stroutline = "File Name,"
    foreach($srvlistitem in $srvlist){
    $Stroutline = $Stroutline + $srvlistitem.ToUpper() + ","
    $Stroutline = $Stroutline + "Is it Missing file?"
    Write-Output $Stroutline | Out-File "$reportName" -Force
    $j = 1
    $count = $uniquefileslist.count
    $stroutput = ""
    $maxConcurrent = 50
    $results= ""
    $PauseTime = 1
    $uniquefileslist | %{
    while ((Get-Job -State Running).Count -ge $maxConcurrent) {Start-Sleep -seconds $PauseTime}
    $job = start-job -argumentList $_,$contentArray,$index -scriptblock {
    $StrArgFileName = $args[0]
    $ArgContentArray = $args[1]
    $ArgIndex = $args[2]
    $Stroutline = ""
    $missingfile = "No"
    $Stroutline = $StrArgFileName + ","
    for($i=0;$i -lt $ArgIndex;$i++){
    if($ArgContentArray[$i] -contains $StrArgFileName){
    $Stroutline = $Stroutline + "Yes,"
    else{
    $Stroutline = $Stroutline + "No,"
    $missingfile = "Yes"
    $Stroutline = $Stroutline + $missingfile
    $Stroutline
    While (Get-Job -State "Running")
    Start-Sleep 1
    $results = Get-Job | Receive-Job
    $results
    $stroutput = $stroutput + "`n" + $results
    Remove-Job *
    Write-Output $stroutput | Out-File "$reportName" -Force -Append
    Thank you very much!
    Vamsi.

    no i am not comparing the number of lines.. count i used was only for my information... it has nothing to do with the compare. here is the script with out count... 
    [array]$contentArray = @()
    [array]$allfileslist = @()
    [array]$uniquefileslist = @()
    [array]$allfilesSRVlist = @()
    [array]$srvlist = @()
    $FolderName = Split-Path -parent $MyInvocation.MyCommand.Definition
    $reportName = $FolderName + "\ComparisonReport3.csv"
    $ListOfFiles = get-childitem $FolderName
    $List = $ListOfFiles | where {$_.extension -ieq ".txt"}
    $index = 0
    foreach($listitem in $List){
    $listfilename = $listitem.FullName
    $listname = $listitem.Name
    $listname = $listname.replace(".txt","")
    $srvlist = $srvlist + $listname
    $StrContent = [io.file]::ReadAllLines($listfilename)
    $contentArray += ,@($StrContent)
    $index = $index + 1
    for($i = 0;$i -lt $index;$i++){
    $allfileslist = $allfileslist+ $contentArray[$i]
    $uniquefileslist = $allfileslist | sort-object | get-unique
    $strfinal = "File Name,"
    foreach($srvlistitem in $srvlist){
    $strfinal = $strfinal + $srvlistitem.ToUpper() + ","
    $strfinal = $strfinal + "Is it Missing file?"
    foreach($uniquefileslistitem in $uniquefileslist){
    $missingfile = "No"
    $Stroutline = $uniquefileslistitem + ","
    for($i=0;$i -lt $index;$i++){
    if($contentArray[$i] -contains $uniquefileslistitem){
    $Stroutline = $Stroutline + "Yes,"
    else{
    $Stroutline = $Stroutline + "No,"
    $missingfile = "Yes"
    $Stroutline = $Stroutline + $missingfile
    $strfinal = $strfinal + "`n" + $Stroutline
    Write-Output $strfinal | Out-File "$reportName" -Force -Append
    if you want to test it... just create two text files and put them in the same folder as the script. 
    server1.txt will have the following content
    filename1
    filename2
    filename3
    server2.txt will have the following content
    filename1
    filename2
    filename4
    it should generate the csv file ComparisonReport3.csv
    filename,server1,server2,Is it Missing file?
    filename1,yes,yes,no
    filename2,yes,yes,no
    filename3,yes,no,yes
    filename4,no,yes,yes

  • Generic datasource by function module to fetch data from multiple tables?

    I'm writing a function module to fetch price, for generic datasource.
    At first, extract test is OK. But InfoPackage never stop  when loading data to PSA in BW.
    And I find the example codes:
         OPEN CURSOR WITH HOLD S_CURSOR FOR
          SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
                                   WHERE CARRID  IN L_R_CARRID AND
                                         CONNID  IN L_R_CONNID.
        ENDIF.                             "First data package ?
    * Fetch records into interface table.
    *   named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE S_S_IF-MAXSIZE.
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.
    There using Cursor to fetch data package by package, and raise exception NO_MORE_DATA to stop the loading process.
    Now I fetch data from multiple tables, I don't think I can use Cursor.
    Then How can I handle this?  
    Thanks a lot.

    Thanks
    IF IT_999[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH  AND
           ( ( A~KSCHL = 'ZPRC' AND VKORG = 'Z000' AND VTWEG = 'Z1' ) OR
                          ( A~KSCHL = 'ZPRD' AND VKORG = 'A000' AND VTWEG = 'Y3' ) ) AND
    *                      A~DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR AS KHETR  KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH AND
          A~KSCHL = 'ZPR3' AND A~VKORG = 'I000' AND
    *                      DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
      ENDIF.
      IF IT_997[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VTWEG A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A997 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_997
                    WHERE
    *      A~KNUMH = IT_997-KNUMH      AND
          A~KSCHL = 'ZPRA' AND VTWEG = 'Y1' AND
    *                      DATBI >= SY-DATUM AND
                      LOEVM_KO = ''.
      ENDIF.
      IF IT_996[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
           TABLE TP_DATA
             FROM A996 AS A
               INNER JOIN KONP AS B
                   ON A~KNUMH = B~KNUMH
               INNER JOIN MARA AS C
                  ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_996
                    WHERE
    *      A~KNUMH = IT_996-KNUMH AND
          A~KSCHL = 'ZPRB' AND
    *                       DATBI >= SY-DATUM AND
          LOEVM_KO = ''.
      ENDIF.
      SELECT   MATNR     "u7269u6599u53F7u7801
               MEINH     "u4ED3u50A8u5355u4F4Du7684u5907u7528u8BA1u91CFu5355u4F4D
               UMREZ     "u57FAu672Cu8BA1u91CFu5355u4F4Du8F6Cu6362u5206u5B50
               UMREN     "u8F6Cu6362u4E3Au57FAu672Cu8BA1u91CFu5355u4F4Du7684u5206u6BCD
          FROM MARM
          INTO CORRESPONDING FIELDS OF TABLE IT_MARM
           FOR ALL ENTRIES IN TP_DATA
         WHERE MATNR = TP_DATA-MATNR AND  MEINH = TP_DATA-KMEIN.
      LOOP AT TP_DATA.
        IF TP_DATA-KPEIN NE 0.
          TP_DATA-KBETR =  TP_DATA-KBETR / TP_DATA-KPEIN.
          TP_DATA-KHETR =  TP_DATA-KHETR / TP_DATA-KPEIN.
        ENDIF.
        IF TP_DATA-KSCHL = 'ZPRA'.
    *       TP_DATA-MEINH = 'ZI'.
    *      TP_DATA-KSCHL = 'B4'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'CT'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRB'.
    *      TP_DATA-KSCHL = 'L0'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRC' OR TP_DATA-KSCHL = 'ZPRD'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'WZI'.
            TP_DATA-KBETR = TP_DATA-KBETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPR3'.
    *      TP_DATA-KSCHL = 'B2'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ENDIF.
        TP_DATA-MEINH = '01'.
        MODIFY TP_DATA.
    E_T_DATA-MATNR =   TP_DATA-MATNR.
    E_T_DATA-KSCHL =   TP_DATA-KSCHL.
    E_T_DATA-KHETR =   TP_DATA-KHETR.
    E_T_DATA-KBETR =   TP_DATA-KBETR.
    E_T_DATA-KMEIN =   TP_DATA-KMEIN.
    E_T_DATA-DATAB =   TP_DATA-DATAB.
    E_T_DATA-DATBI =   TP_DATA-DATBI.
    APPEND E_T_DATA.
        CLEAR WA_MARM1.
        CLEAR WA_MARM2.
      ENDLOOP.
    Edited by: Shen Peng on Oct 20, 2010 10:09 AM

  • Move data from multiple Tables to a Single Table & Convert the list to ALV.

    Hi,
    My aim is to get the list of Materials with their descriptions, with MRP Controller, with Unrestriced Qty. & the Reorder Qty. So, I have to fetch the data from different tables. But finally I am not able to copy or move the fetched data from multiple tables into the single final table.
    Also tell me how to convert this list into ALV.
    Below is the program code.
    *& Report  Y_REORDER_REPORT
    REPORT  Y_REORDER_REPORT.
    tables : marc,makt, mard.
    DATA: Begin of i_final occurs 0,
            matnr type marc-matnr,
            maktx type makt-maktx,
            DISPO type marc-DISPO,
            MINBE type marc-MINBE,
            LABST type mard-LABST,
          end of i_final.
    DATA: Begin of i_marc occurs 0,
           matnr type marc-matnr,
           DISPO type marc-DISPO,
           MINBE type marc-MINBE,
          end of i_marc.
    DATA: Begin of i_makt occurs 0,
           matnr type makt-matnr,
           maktx type makt-maktx,
          end of i_makt.
    DATA: Begin of i_mard occurs 0,
           matnr type mard-matnr,
           LABST type mard-LABST,
           LGORT TYPE MARD-LGORT,
          end of i_mard.
    SELECT  matnr
            dispo
            minbe from marc
            into corresponding fields of table i_marc
            where dispo EQ 'STR'.
    SORT I_MARC by MATNR.
    WRITE: /10  'Material',
            75  'MRP',
            80  'Reorder Qty.'.
    LOOP at i_marc.
    Write: /10  i_marc-matnr,
            75  i_marc-dispo,
            80  i_marc-minbe.
    ENDLOOP.
    write: /.
    SELECT  matnr
            MAKTX from makt
            into corresponding fields of table i_makt
            for all entries in i_marc
            where matnr = i_marc-matnr.
    LOOP at i_makt.
    Write: /10 i_makt-matnr,
            30 i_makt-maktx.
    ENDLOOP.
    SELECT  matnr
            LGORT
            LABST from mard
            into corresponding fields of table i_mard
            for all entries in i_marc
            where matnr = i_marc-matnr.
    LOOP at i_mard.
    Write: /10 i_mard-matnr,
            30 I_MARD-LGORT,
            40 i_mard-labst.
    ENDLOOP.
    move  i_mard-matnr to i_final-matnr.
    move  i_marc-dispo to i_final-dispo.
    move  i_marc-minbe to i_final-minbe.
    move  i_makt-maktx to i_final-maktx.
    move  i_mard-labst to i_final-labst.
    WRITE: /10  'Material',
            30  'Material Desc.',
            75  'MRP',
            80  'Reorder Qty.',
            105 'Current Stock'.
    LOOP at i_final.
    Write: /10  i_final-matnr,
            30  i_final-maktx,
            75  i_final-dispo,
            80  i_final-minbe,
            105 i_final-labst.
    ENDLOOP.
    *LOOP at i_mard.
    *Write: /10  i_mard-matnr,
           30  i_makt-maktx,
           75  i_marc-dispo,
           80  i_marc-minbe,
           105 i_mard-labst.
    *ENDLOOP.
    Regards,
    Vishal

    Change like this,
    SELECT matnr
    lgort
    labst FROM mard
    INTO CORRESPONDING FIELDS OF TABLE i_mard
    FOR ALL ENTRIES IN i_marc
    WHERE matnr = i_marc-matnr.
    LOOP AT i_mard.
       WRITE: /10 i_mard-matnr,
       30 i_mard-lgort,
       40 i_mard-labst.
    ENDLOOP.
    LOOP AT i_marc.
       READ TABLE i_mard WITH KEY matnr =  i_marc-matnr.
       READ TABLE i_makt WITH KEY matnr =  i_marc-matnr.
       MOVE i_mard-matnr TO i_final-matnr.
       MOVE i_marc-dispo TO i_final-dispo.
       MOVE i_marc-minbe TO i_final-minbe.
       MOVE i_makt-maktx TO i_final-maktx.
       MOVE i_mard-labst TO i_final-labst.
       APPEND i_final.
    ENDLOOP.
    WRITE: /10 'Material',
    30 'Material Desc.',
    75 'MRP',
    80 'Reorder Qty.',
    105 'Current Stock'.

  • Displaying data from multiple columns into a single line graph

    Post Author: hollowmatrix
    CA Forum: WebIntelligence Reporting
    Hey,I have an issue with the WEBI reporting.I have a data source that has multiple columns say ( month1, month2, month3, month4,.....month 12, month 13, ....month24) with the sales data for each month.Now say I call the month 1 to month 12 as "current year", and call month 13 - month 24 as "previous year".I want to put a prompt in the report which allows  me to select between "current year" and "previous year".Based on the prompt value we get a graph of the sales vs month ....as in if we select  "current year", then we get a graph of the sales Vs time( remember that the sales data for each month is in a different column.)and if we select  "previous year" then we get a graph of the sales Vs time for previous year..( sales vs time for Month 13, month 14, month 15....month 24).I am not able to pull data from multiple columns into a single object that I can use to populate the graphs.Any help on the same will be appreciated .   

    Hi,
    <p>
    please click
    here (asktom) and look for the words "how about the other way round"
    </p>

  • How to select data from a table by passing document number from another tab

    How to select data from a table by passing document number from another table.
    for eg:-
    I want to display name, adres, region from ADRC table
    by using field delivery document number
    Kind Regards,
    Shanbagavalli.S

    Hi Shanbagavalli,
    There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
    **Consider that you have a Internal table having document number from other table..
    SELECT NAME ADRES REGION FROM ADRC
           INTO IT_ADRC
           FOR ALL ENTRIES IN IT_DOC
           WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
    **Consider that you have 1 document number then
    SELECT NAME ADRES REGION FROM ADRC
         INTO IT_ADRC
         WHERE DOCUMENT_NO = W_DOCUMENT_NO.
    Hope this solves your problem.
    Regards,
    Kunjal

  • 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

  • How to submit data from multiple Input Ports in single SUBMIT button  click

    Hi,
    I am in SPS8.
    What exactly steps I need to perform to submit data from multiple Input Ports.
    I couldn't able to submit One input Form and one Input Table to BAPI data service in single SUBMIT button click.
    I debugged the VC application in SPS8.
    While debugging, I found that when I click the SUBMIT button in the Input Form, Only data in that Input
    form are being passed to the BAPI, But not the Table Form data.
    If I click on the SUBMIT button in another Input Table, Only data from that table is being passed to the BAPI, but not the Input form data.
    Essentially I need to submit both of them in one SUBMIT button.
    Thanks,
    Ramakrishna

    Ramakrishna,
    From the word document that you sent to me the steps you are missing to map the appropriate information into the BAPI is first you are not mapping all data rows into the table input port. To do this double click on the input table view and change your selection mode from single to multiple. Then when you click on your link between the BAPI and your input table you will see a new option appears under data mapping "Mapping Scope" select All Data Rows.
    That's the first part of the problem to get the BAPI to recognize both the inputs coming from the form and the table eliminate the submit button from the form. Drag and drop a link from the output port of the table view to the Input port of the BAPI. Double click on the link between the BAPI and the table view and open the expressions editor for the two fields:
    1/ Automatic Source
    2/ SKIP_ITEMS_WITH_ERROR
    On the hierarchical folder structure on the right expand expand the Data Fields node to find the fields from the form and map them accordingly.
    Now when you hit the submit button on your table it should pass the BAPI all the parameters from both the form and the table.
    Hope this helps,
    Cheers,
    Scott

  • Select data from another database

    Hi,
    Is it possible to retrieve data from a table from another database?
    For instance, I have two databases db_1 and db_2
    I login to the database db_1 using
    sqlplus username/psw@db1
    and to the database db_2 using
    sqlplus username/psw@db2
    In SQL> db1 I would like to use select statement from a table in the db2. Is it possible?
    Another question:
    I have two tablespaces TP1 and TP2 in the database db1
    The TP1 is my default tablespace.
    Can I switch from TP1 to TP2 tablespace in the sqlplus?
    If not, how can I select all tables obtained in the TP2? Or how can I select data from a table in the TP2?
    Thanks

    I don't know how to create a db link.<br>
    SQL Reference Guide - CREATE DATABASE LINK<br>
    There are some examples in the doc above.<br>
    <br>
    What about if db1 and db2 have the same table name?<br>No problem, exactly like when you have two same table name accross two schemas on same database. The table suffixed by the dblink name come from the other schema of other database (schema which you use to connect through the dblink to the other database).<br>
    <br>
    Nicolas.

  • Select data from DataBase

    Hi;
    I try to select data from DataBase, But I get the following error, Could anyone help? thanks.
    Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.
    OracleDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at Lookup.main(Lookup.java:12)
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class Lookup {
        public static void main(String[] args)
            throws SQLException, ClassNotFoundException {
            String dbUrl = "jdbc:oracle:thin:@augur.scms.waikato.ac.nz:1521:comp319";
            String user = "group029";
            String password = "group029";
            // Load the driver (registers itself)
            Class.forName("oracle.jdbc.driver.OracleDriver");
            Connection c = DriverManager.getConnection(dbUrl, user, password);
            Statement s = c.createStatement();
            //SQL code:
            ResultSet r =
                s.executeQuery("SELECT * " +"FROM movie");
         StringBuffer results= new StringBuffer();
            ResultSetMetaData metaData = r.getMetaData();
         int numberOfColumns = metaData.getColumnCount();
         for(int i=1; i<=numberOfColumns; i++)
             results.append(metaData.getColumnName(i)+"\t");
         results.append("\n");
         while (r.next()){
             for( int i=1; i <=numberOfColumns; i++)
              results.append(r.getObject(i)+"\t");
             results.append("\n");
         s.close();
    }

    It's a classpath problem. Either you mistyped the class name, or you don't have the class in your classpath. I think Oracle's drivers come in db12.zip or db12.jar or some such. Whatever that jar or zip file is, it has to be in your classpath, but it's not.
    Or it is in your classpath, but you're in an appserver context where the classloader that the container provides for your app uses something other than the classpath variable. For instance, in tomcat, the jar file would be uder webapps/yourApplication/WEB-INF/lib I think.

Maybe you are looking for

  • InDesign CS5 PDF export status

    It seems that now with CS5 we no longer receive a pdf export status bar. Export is running in background. When exporting large files, the only way I know it's still working or exporting is the error message when I try and close document... Saying tas

  • How to identify a Spool generated.

    Hi Guru's, I am working on a print program, once the program is exicuted i am saving the data into a Ztable. Now wat i want is that to save the o/p data only when a print is taken but not when only print preview is viewed. for this i am thinking of u

  • Internal links to list items (as in Microsoft Word)

    Hello, all! I am a switcher to Mac. Would be grateful if you could ease my switching Mic. Word has a great function for lawyers I always used: I make a document with multilevel numbers like: 1. 1.1. 1.1.1. 1.1.2. 1.2. 2. 2.1 etc. This one is availabl

  • Models in XI content for ESR in CE 7.1

    Hi, I have been installing the Discovery System and a seperate CE 7.1 system with the ESR. Now I downloaded the XI content "XI Content ESA ECC-SE 602" and imported it. All went well except that there are no models included. Is there any way of gettin

  • Firewalld package

    I am trying to install firewalld on an arch server with command pacman -S firewalld but it seems the dependencies are way to many... check the output below ..., do we really need  more than 400MB for a firewall package? pacman -S firewalld resolving