Best way to get data from multiple table

hi
i would like to know which is the best way of getting the data in the final table from multiple read statements which are inside loop.
for exm
loop at itab.
read ....
read....
read....
read ....
data into final_itab
endloop.
thanx
manoj

Hi.....
Say we are having two data base tables.. ZMODEL1 and ZMODEL2...
Now decalre intrenal tables and work areas and before that structures for these two and also declare one final output table for display the data...
>types: begin of ty_model1,
>       za(10),
>       zb type netwr,
>       zc(10),
>       zd(10),
>       ze(10),
>       zf(10),
>       end of ty_model1,
>       begin of ty_model2,
>       za1(10),
>       zb1(10),
>       zc1(10),
>       zd1(10),
>       za(10),
>       end of ty_model2,
>       begin of ty_output,
>       za(10),
>       zb type netwr,
>       zc(10),
>       zd(10),
>       ze(10),
>       zf(10),
>       za1(10),
>       zb1(10),
>       zc1(10),
>       zd1(10),
>       end of ty_output.
>
>data: t_model1 type standard table of ty_model1 initial size 0,
>      t_model2 type standard table of ty_model2 initial size 0,
>      t_output type standard table of ty_output initial size 0,
>      w_model1 type ty_model1,
>      w_model2 type ty_model2,
>      w_output type ty_output.
Now in the start of selection.. event...
>select <field names in the same order as in database table> from zmodel1 into table t_model1 where za in s_comp. (s_comp is select-option for that field)>
>if sy-subrc = 0.
>select <field names in the same order as in database table> from zmodel2 into table t_model2 for all entries in t_model1 where za = >t_model1-za.
>endif.
After that now fill the final output table...
>loop at t_model1 into w_model1.
>  w_output-za = w_model1-za.
>  w_output-zb = w_model1-zb.
>  w_output-zc = w_model1-zc.
>  w_output-zd = w_model1-zd.
>  w_output-ze = w_model1-ze.
>  w_output-zf = w_model1-zf.
>
>read table t_model2 into w_model2 with key za = w_model1-za.
>if sy-subrc = 0.
>  w_output-za1 = w_model2-za1.
>  w_output-zb1 = w_model2-zb1.
>  w_output-zc1 = w_model2-zc1.
>  w_output-zd1 = w_model2-zd1.
>endif.
> append w_output to t_output.
> clear w_output.
> end loop.
and now display the final out table...
This is the best way..
Thanks,
Naveen.I

Similar Messages

  • Best way to import data to multiple tables in oracle d.b from sql server

    HI All am newbie to Oracle,
    What is the Best way to import data to multiple tables in Oracle Data base from sql server?
    1)linked server?
    2)ssis ?
    If possible share me the query to done this task using Linked server?
    Regards,
    KoteRavindra.

    check:
    http://www.mssqltips.com/sqlservertip/2011/export-sql-server-data-to-oracle-using-ssis/
          koteravindra     
    Handle:      koteravindra 
    Status Level:      Newbie
    Registered:      Jan 9, 2013
    Total Posts:      4
    Total Questions:      3 (3 unresolved)
    why so many unresolved questions? Remember to close your threads marking them as answered.

  • Jdbc getting data from multiple tables

    hi guys
    how can i get data from multiple tables in MSAccess
    please help

    >
    here is code thata i want to do
    i have 3 tables in my MSAccess databace
    Stud_O which consist name,surname fields
    Stud_I consist address,tel
    Stud_E department,faculty fields
    Based on this I would guess that you are missing a key field. There is no way to connect the tables.
    I make the class to insert data to the tables. But
    cant do getting datas from this tables.
    can anybody help me in making query
    and method that displays reultset strings to the
    textBoxes
    A select ...
    select name,surname from Stud_O. Use the executeQuery() method.

  • Fastest way to get data from Multiple lists across multiple site collections

    HI
    I need to get data from multiple lists which spread across 20 site collections and need to show it as list view.
    I have searched on internet about this and got some info like options would be to use search core APIs or BCS . I can't use search because I want real time data. Not sure of any other ways.
    if anybody can provide ideas it would be help.

    Might LINQ be an option for you?  Using
    LINQPad and the
    SharePoint Connector, you should be able to write a query that'll retrieve this data, from which you can tabulate it.  I'm not sure how you'd be able to automate this any further so that it's then imported in as list.
    For something more specific, I used a third party tool called the
    Lightning Tools Lightning Conductor, which is essence a powerful content roll-up tool.  In one of my solutions, I created a calculated column that gave an order / ranking on each item, so that when lists were combined, they'd still have some form of
    order.  The web part is also fairly customisable and has always proven a useful tool.
    Hope that helps.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Which is the best way to get data from user difine tables with condition

    Hi everyone,
    I would like using SBO DIAPI to get UDT data rows, there is a method of UserTable.getbykey can get one row information, but I like to get a list of rows from UDT, and the get list have its condition such as: field1="Type_A" ect.
    also I want to avoid using doquery get data from DB, because there is direct access DB potential Suspect.
    I am using SBO 2005 PL09 & visual studio(VB.net) 2005 and I only using DIAPI do not using UIAPI.
    Thanks for any advice.
    Kathy

    Hi Kathy,
    Unfortunately SBObob.GetObjectKeyBySingleValue only works for the B1 business objects as listed in the documentation.
    So, when you don't know the keys (= Code) of the records you want to get from your UDT - there's no way around using Recordset object's DoQuery method!
    Sorry,
    Frank

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

  • Best way To get data from another application using NDDE lbrary

    My vb.net application gets data from another application using NDDE Library. I got stocks prices (open,high,low,close,volume,change......(about 15 records for each stock)) (about 200 stocks) . I don't know if there is a problem in my code.
    This is my code:
    l : is the list of stocks.
    This Sub connects to server and requests the data :
    Public Shared Sub GetQuotes()
    Try
    client1 = New DdeClient(server, topic)
    client1.Connect()
    For i As Integer = 0 To l.Count - 1
    client1.StartAdvise("QO." & l(i).t & ".TAD$last", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$open", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$high", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$low", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$pclose", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$volume", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$date", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$time", 1, True, 60000)
    Next
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    and then I get the data from Client_advise sub (called each time a value changed )and fill the list. What I know is that client advise gets only one record for single stock each time is called..
    Example: for stock AAPL. 1st time enters client_Advise I get open price for AAPL, 2nd time I get high price for AAPL,3rd time I get low price..... and I update the value in the List (l)
    This the client_Advise Sub:
    Private Shared Sub client1_Advise(ByVal sender As Object, ByVal e As NDde.Client.DdeAdviseEventArgs) Handles client1.Advise
    For q As Integer = 0 To l.Count - 1
    If l(q).t = w(1) Then
    Dim item() As String = e.Item.Split("$")
    If l(q).Open = "#" Then
    l(q).Open = "0"
    End If
    If l(q).hi = "#" Then
    l(q).hi = "0"
    End If
    If l(q).lo = "#" Then
    l(q).lo = "0"
    End If
    If l(q).Close = "" Or l(q).Close = "#" Then
    l(q).Close = "0"
    End If
    If l(q).pclose = "#" Then
    l(q).pclose = "0"
    End If
    If item(1) = "open" Then
    l(q).Open = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "last" Then
    l(q).Close = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "high" Then
    l(q).hi = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "volume" Then
    l(q).Volume = Val(e.Text)
    ElseIf item(1) = "low" Then
    l(q).lo = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "pclose" Then
    l(q).pclose = Format(Val(e.Text), "0.00")
    If l(q).pclose <> "" And l(q).pclose <> "#" And l(q).Close <> "" And l(q).Close <> "#" Then
    l(q).c = Format(l(q).Close - l(q).pclose, "0.00")
    l(q).cp = Format(((l(q).Close - l(q).pclose) / l(q).pclose) * 100, "0.00")
    End If
    l(q).flag1 = 2
    ElseIf item(1) = "date" Then
    l(q).Date1 = e.Text
    ElseIf item(1) = "time" Then
    l(q).Time = e.Text
    End If
    Exit For
    End If
    Next
    End Sub
    Am I doing something wrong which inreases CPU usage to 80 or 90 % ?
    Thanks in advance.

    Hi MikeHammadi,
    According to your description, you'd like to get data from another app using NDDE library.
    When using the NDDE library, the CPU usage is high. As the NDDE library is third-party library, it is not supported here. I suggest you checking if the problem is caused by the NDDE library.
    If you'd like to get data from another app. I suggest you could save the data in the dataBase, and then read it in another application if necessary.
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What is the best way to get data from a spreadsheet into an HTML table?

    I am using libreoffice, and I have it set to collate all the information I enter and output it to a simple table within the program like this:
    http://imageshack.us/a/img717/5144/spreadsheeta.jpg
    I want to get this information after sorting it and put it into the following html table within dreamweaver:
    http://imageshack.us/a/img28/8872/htmls.jpg
    what is the best method for getting the info from A to B?

    before:
    <table id="tbl-m">
              <tr class="tbl-hd">
                <td class="tbl-pos-width">pos</td>
                <td class="tbl-team-width">team</td>
                <td class="tbl-p-w-d-l-p">pld</td>
                <td class="tbl-p-w-d-l-p">won</td>
                <td class="tbl-p-w-d-l-p">drwn</td>
                <td class="tbl-p-w-d-l-p">lost</td>
                <td class="tbl-p-w-d-l-p">pts</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">1</td>
                <td class="tbl-team-width">Team Name 1</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">2</td>
                <td class="tbl-team-width">Team Name 2</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">3</td>
                <td class="tbl-team-width">Team Name 3</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">4</td>
                <td class="tbl-team-width">Team Name 4</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">5</td>
                <td class="tbl-team-width">Team Name 5</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">6</td>
                <td class="tbl-team-width">Team Name 6</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">7</td>
                <td class="tbl-team-width">Team Name 7</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">8</td>
                <td class="tbl-team-width">Team Name 8</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">9</td>
                <td class="tbl-team-width">Team Name 9</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">10</td>
                <td class="tbl-team-width">Team Name 10</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">11</td>
                <td class="tbl-team-width">Team Name 11</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">12</td>
                <td class="tbl-team-width">Team Name 12</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">13</td>
                <td class="tbl-team-width">Team Name 13</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">14</td>
                <td class="tbl-team-width">Team Name 14</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">15</td>
                <td class="tbl-team-width">Team Name 15</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">16</td>
                <td class="tbl-team-width">Team Name 16</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
            </table>
    after:
    <table>
              <tr>
                <td>Pos</td>
                <td>Team</td>
                <td>Pld</td>
                <td>Won</td>
                <td>Drwn</td>
                <td>Lost</td>
                <td>Pts</td>
              </tr>
              <tr>
                <td>1</td>
                <td>Team 1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>2</td>
                <td>Team 2</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>3</td>
                <td>Team 3</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>4</td>
                <td>Team 4</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>5</td>
                <td>Team 5</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>6</td>
                <td>Team 6</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>7</td>
                <td>Team 7</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>8</td>
                <td>Team 8</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>9</td>
                <td>Team 9</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>10</td>
                <td>Team 10</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>11</td>
                <td>Team 11</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>12</td>
                <td>Team 12</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>13</td>
                <td>Team 13</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>14</td>
                <td>Team 14</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>15</td>
                <td>Team 15</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>16</td>
                <td>Team 16</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
            </table>

  • Getting data from 7 tables

    I am converting a servlet based application to struts framework.I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .
    I have heard of composite design pattern .Please let me know the best way to query the tables.Here are the queries.
    Select a.proj_id , a.proj_nm
    From stn_proj_et a, stn_proj b
    Where a.proj_id = b.proj_id
    And a.sftwr_id = 24
    And b.stn_id = 56602;
    Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
    From stn_loc_hist
    Where stn_id ='56602'
    And cur_use_cd = 1
    select data_tp_cd
    from data_coll_summ
    where stn_id ='56002'
    And rownum < 2;
    select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
    from stn_et
    where stn_id = '56002';
    select
    distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
    from stn_et;
    select
    distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
    from stn_et;
    select distinct PROJ_NM from stn_proj_et where sftwr_id=24;
    Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
    From stn_alias_nm a, alias_orgn_et b
    Where a.alias_orgn_id = b.alias_orgn_id
    And b.alias_orgn_tp = 0
    And stn_id = '56002';

    adithiananya wrote:
    I am converting a servlet based application to struts framework.How well do you know Struts?
    I have a screen which gets data from 7 tables.I cannot use a stored procedure so has to manage using SQL queries.I thought i will query each table and set it to my struts form.The screen has lot of drop down boxes .You don't need a stored procedure to query a database.
    I have heard of composite design pattern .This ain't it.
    Please let me know the best way to query the tables.Here are the queries.
    Select a.proj_id , a.proj_nm
    From stn_proj_et a, stn_proj b
    Where a.proj_id = b.proj_id
    And a.sftwr_id = 24
    And b.stn_id = 56602;What are those hard-wired magic numbers in the WHERE clause?
    >
    Select round(utm_x,3) utm_x, round(utm_y,3) utm_y, stn_id
    From stn_loc_hist
    Where stn_id ='56602'
    And cur_use_cd = 1What are those hard-wired magic numbers in the WHERE clause?
    >
    select data_tp_cd
    from data_coll_summ
    where stn_id ='56002'
    And rownum < 2;What are those hard-wired magic numbers in the WHERE clause?
    >
    select lat_no,long_no,pnt_loc_dsc,srce_id,mthd_dtrmn_cd,ctrl_dtm_cd
    from stn_et
    where stn_id = '56002';
    select
    distinct sjr_utils.getcatalogvalue(mthd_dtrmn_cd)
    from stn_et;
    select
    distinct sjr_utils.getcatalogvalue(ctrl_dtm_cd)
    from stn_et;
    select distinct PROJ_NM from stn_proj_et where sftwr_id=24;What are those hard-wired magic numbers in the WHERE clause?
    Select a.stn_alias_nm stn_alias_nm, b.alias_orgn_nm alias_orgn_nm
    From stn_alias_nm a, alias_orgn_et b
    Where a.alias_orgn_id = b.alias_orgn_id
    And b.alias_orgn_tp = 0
    And stn_id = '56002';What are those hard-wired magic numbers in the WHERE clause?
    Do you really want to execute different requests given input from the users? (e.g., enter a value in a text box and see the drop down list boxes change)
    %

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

  • How to get data from COSP table, field HRKFT as the key to data from PM?

    Dear ladies and gentlemen!
    I need to get data from COSP table, field HRKFT as the key to data from PM tables (AFKO and AUFK).
    The problem is that it is a key field to the COSP, and all non-key fields as an alternative to HRKFT are not suitable for this task.
    All this is necessary for the extractor, which loads the data from the R \ 3 systems in the BW-system. I need to perform SELECT from a table COSP and maybe also JOIN, most likely between tables COSP and AUFK.
    What should I do in this case?
    Thank you very much in advance!

    From information on help.sap.com I've made a conclusion that one of possible solutions in theory is to modify standard extractor PM_OM_OPA_1 in order to make HRKFT field available for work, because by default it is hidden by SAP and not available for use as a key field.
    Of course, it's not a very good solution, but for now I know no other way to solve this problem.
    Maybe someone knows better ways? In this case I will be very grateful for any help!
    Moderator: You'd better post it on BI forums

  • Whats the easiest way to get data from R/3 from XI

    Hi there
    I would like to know if there is a way to to access a database table in the R/3 system in a user defined function in Message Mapping? I have to map some fields where I have to get data from a table. What would be the easiest way?
    Thanks,
    Jan

    This article provides details on the usage of Generic Lookup API used for calling RFC from user defined functions.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    RFC Lookup.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439

  • Update On data from multiple Tables

    How can i update data from multiple tables(Using a Join)
    using a single update statement.

    Hii
    Suppose i have following tables
    create table emp_mas(empno number primary key,name varchar2(30));
    create table emp_grad(empno number primary key,grade varchar2(1));
    SQL> select * from emp_grad;
    EMPNO G
    100 A
    101 A
    102 B
    SQL> select * from emp_mas;
    EMPNO NAME
    100 GREG
    101 THOMAS
    102 SAM
    I would like to update information of employee 'GREG' Using a single update statement as
    UPDATE (SELECT E.EMPNO,E.NAME,G.GRADE FROM EMP_MAS E,EMP_GRAD G WHERE E.EMPNO=G.EMPNO) J
    SET J.NAME='GREG THOMAS',J.GRADE='B' WHERE EMPNO=100
    Then i am getting Error message like this.
    ERROR at line 2:
    ORA-01776: cannot modify more than one base table through a join view
    How can i achieve the result

  • POWL accessing data from multiple tables/objects

    Hello,
    I have a query on the POWL applications.
    If the powl application has to access data from multiple tables/objects, then the solution would be creating a data structure of those tables/objects and referring to that structure in GET_OBJECT_DEF methods.
    Is there any other soln? or I am right here?
    The queries which are saved for a particular user are transportable? if not, how can they be made transportable?
    Thanks & regards,
    Ravish

    you are right, you can do in get_objects method.
    POWL_QUERIES are transportab;e, you can save them in POWL_QUERY transaction.
    Best regards,
    Rohit
    http://wiki.sdn.sap.com/wiki/display/WDABAP/POWL

  • Getting Result from multiple table using code table.

    I am having hard time getting data from different table not directly connected.
    

    The data model is not proper. Why should you store the game details in separate tables?
    IMO its just matter of putting them in same table with additional field gamename to indicate the game. That would have been much easier to query and retrieve results
    Anyways in the current way what you can do is this
    SELECT p.ID,p.Name,c.CategoryName AS [WinnerIn]
    FROM GameParticipants p
    INNER JOIN (SELECT ParticipantID, Value AS ParticipantName,'CGW Table' AS TableName
    FROM CGWTable
    UNION ALL
    SELECT ParticipantID, Value AS ParticipantName,'FW Table' AS TableName
    FROM FWTable
    SELECT ParticipantID, Value AS ParticipantName,'WC Winner' AS TableName
    FROM WCWinner
    ... all other winner tables
    )v
    ON v.ParticipantID = p.ID
    AND v.ParticipantName = p.Name
    INNER JOIN Category c
    ON c.TableName = v.TableName
    If you want you can also add a filter like
    WHERE p.Name = @Name
    to filter for particular player like Henry in your example
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Maybe you are looking for