How to fetch data from different tables

I have a view created based on Emp table. while querying the employee details i want to display the dept_ description from dept table. how can i do that ??
Regards Abin

you mean when you click on a emp table row you want to display dept. description?
Use the following query in the view so you have all the required information. In the table selectionlistener get the dept. description and display it.
SELECT distinct E.empno, E.ename, E.sal, D.dname
FROM dept D, emp E
WHERE E.deptno = D.deptno
ORDER BY E.empno;

Similar Messages

  • Fetch data from different tables print them is assigned places

    Hi Friends,
    I have designed one SMART-Form (Receipt).
    I need to fetch data from different tables and the data must be print in assigned places. Please help me how to achieve this requirement. Thanks for your help.
    Best regards,
    Manju.
    Edited by: Alvaro Tejada Galindo on Feb 12, 2008 10:20 AM

    U're right.
    When it creates a smartform it needs to decide when the main data have to be extracted:
    - or in driver program
    - or in smartforms
    The difference can be in the performance, because the program can select the data only once, the smartforms needs to extract them everytime it's called.
    I prefer to use a complex structure for the smartform interface as so all data I need are in only one structure, the problem is the complex structure is harder to be managed.
    Max

  • How to fetch data from PTREQ tables

    I need to display  data in the customised webdynpro application from PTREQ tables.
    Can anyone help me out how to fetch data from these tables.

    use the standard modules like
    PT_ARQ_REQUEST_CHECK
    PT_ARQ_REQUEST_EXECUTE
    PT_ARQ_REQUEST_PREPARE

  • How to fetch data from cluster tables

    hi
    i need to know  how to fetch data from cluster tables please update me if any
    i know that we cannot use joins in cluster table we use view etc
    but i need detailed inforation on methods for fetching data from cluster tables
    regards
    Nishant

    Hi,
        Check the following links
    http://fuller.mit.edu/hr/cluster_tables.html
    The specified item was not found.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33

  • Hey guys how to fetch data from db table using subroutine

    hi guys,
                   I am fetching data from db table "mcha". now in the follwing code i get it in "HSDAT1_DATE."
                   now when i read out_tab with key "HSDAT1". it wont come in out_tab-value.plz tell me what is wrong whether some key condition in out_tab or any thing else.
    and what should i write in changing && in script.
    thanks in advance
    FORM DATE_MGF TABLES IN_TAB STRUCTURE ITCSY
                         OUT_TAB STRUCTURE ITCSY.
    tables :MCHA ,QALS.
      DATA : WERKS1 LIKE QALS-WERK.
      DATA : HSDAT1 LIKE MCHA-HSDAT.
      DATA : DATE(2),
             MONTH(2),
             YEAR(4).
    DATA : HSDAT1_DATE(10).
      READ TABLE IN_TAB WITH KEY 'QALS-WERK'.
      LOOP AT IN_TAB.
        IF SY-TABIX EQ 1.
          WERKS1 = IN_TAB-VALUE.
          IF WERKS1 NE SPACE.
            EXIT.
          ENDIF.
        ENDIF.
      ENDLOOP.
      SELECT SINGLE HSDAT INTO HSDAT1
                          FROM MCHA
                                    WHERE  WERKS = WERKS1.
      DATE = HSDAT1+6(2).
      MONTH = HSDAT1+4(2).
      YEAR = HSDAT1+0(4).
      CONCATENATE DATE '.' MONTH '.' YEAR INTO HSDAT1_DATE.
      READ TABLE OUT_TAB WITH KEY 'HSDAT1' .
      IF SY-SUBRC = 0.
        OUT_TAB-VALUE = HSDAT1.
        MODIFY OUT_TAB INDEX SY-TABIX.
      ENDIF.

    Hi,
    Let me understanf clearly what you want.
    initally mine out_tab is blank
    According to you, your table out_tab is blank. And you need to add out_tab-value = HSDAT1_date.
    READ TABLE OUT_TAB WITH KEY 'HSDAT1' .
      IF SY-SUBRC = 0.
        OUT_TAB-VALUE = HSDAT1.
        MODIFY OUT_TAB INDEX SY-TABIX.
      ENDIF.
    So, if your table is blank, then read statement will fail.
    Please let me know if your table out_tab in blank when you are reading the table and if this table contains any field called HSDAT.
    Basically i would like to know your internal table out_tab declaration.
    Thanks,
    Archana

  • How to fetch data from 2 tables

    Hi Experts,
    I am using 2 Ztables.Let us assume that there are 2 fields in Table1 as a and b and 2nd Table contain c as field.I want to retrive data from these tables by combining the fields of Table1 with that of 2.
    Eg: I want to compare a+b with c and fetch records.
    Is there any logic to combine 2 fields and compare with 3rd field using a single select statement?
    Regds,
    Sam.

    Hi Sam,
    if the tables have one or more common key fields, you can use a JOIN condition for the tables, i.e.
    data:
    begin of ls_target,
      a like ztable1-a,
      b like ztable1-b,
      c like ztable2-c,
    end of ls_target,
    lt_target like table of  ls_target.
    select ztable1~a ztable1~b ztable2~c
      into corresponding fields of table lt_target
      from ztable1
      join ztable2 ON  ztable2~key = ztable1~key
      where <your condition>.
    Note ahead:
    1)  some people say select into corresponding fields is not good for performance. I think it is good to avoid errors and nobody ever gave a perfomance proof.
    2) Most developers always use an alias such as ztable1AS a, ztable2 AS b. This is due to the fact that after table joins were introduced with release 3.1, the ABAP sample programs an documentation always used the ALIAS clause although it is not necessary nor does it establish transparency.
    Kind regards
    Clemens

  • How to Fetch Data From Standard Table MARA and Display using BOPF ?

    Hello All,
    In BOPF creation of Quey to a node fetches data from the Data Base Table attached to that Node,
    But in my requirement I have to fetch data Present in a Standard table and Display it in the FPM List Using FBI.
    **  Can we Fetch the data From Standard Table and fill the Node in BOPF, Is this possible as the standard Table do not contain KEY field which BOPF uses for Data Fetching ?
    Kindly share your Idea's .
    Thanks in Adv.

    Hi Dhivya,
    Thanks For your Response.
    In my Requirement I want to make ROOT Node as Transient Node.
    When I create a Sub Node to a Root Node, I am able to get this option to make this sub node as a Transient Node .
    By selecting   'Standard<-->Extended' option in the Menu item 'GoTo' I am able to get this Transient Node check box field for the Sub Nodes.
    I want to make a ROOT Node as a Transient Node.
    (Which Version you are using, and which transaction you are using to create BO . we are using BOBX Transaction, Version Ehp 6 )
    Kindly Guide me .
    Thanks,
    Kranthi Kumar.

  • How to fetch data from different standard table to own customize table.

    Hi Experts,
    I want to develope an INVENTORY TURN OVER REPORT in SAP R/3.As I dont know much about Inventory.I want some one here to guide me regarding this with example so i can develope Inventory Report in R/3.
    Also guide me which filed from which table i shud use.What is Inventory Turnover in details and how it is calculated.
    Plz reply guys.
    Thanks.
    Edited by: abhishek.chaturvedi on Aug 9, 2010 8:42 AM

    Hi,
    Even iam not sure about it but after looking at your query even i have done some research and got some information for you.
    nventory Turnover is a prominent KPI in a lot of businesses. This post will give you some understanding on the concept. In another post I will give details on how the SAP report MC44 can be used to measure inventory turns and what data is used to calculate this ratio.
    Formula
    Inventory Turnover = Cost of Goods Sold (COGS) / Average Inventory at value
    If you are not familiar with the term Cost of Goods Sold, this is the cost of your revenues.
    Average Inventory is measured in value and not in volume.
    If you divide both elements you know how often you sold youu2019re average inventory.  u201CSo what?u201D you ask. I will explain next.
    Concept and use
    I will present you with two business scenariou2019s to point out the significance of the Inventory Turnover ratio.
    Scenario 1
    You sell one product. You invest 10.000 EUR as starting stock. You run your business for one year and at then end of the year you are completely sold out. Your revenue accumulates to 12.500 EUR.  For simplicity sake your gross profit is 2.500 EUR (12.500 u2013 10.000).
    Revenue = 12.500
    COGS = 10.000
    Average Inventory = 5.000 (10.000 starting stock + 0 end stock / 2 = 5.000 average stock)
    Inventory Turnover = 2 (10.000 / 5.000)
    ROI = 50% > 2.500 (R-C) earned out of 5.000 (A)
    Scenario 2
    Again you sell one product. But this time you invest 5.000 EUR in starting stock. After 6 months you sold your stock and you replenish your stock again for 5.000 EUR. After another 6 months youu2019re sold out. Your revenue is again 12.500 EUR. Your gross profit is 2.500 EUR (12.500 u2013 5000 u2013 5000).
    Revenue = 12.500
    COGS = 10.000
    Average Inventory = 2.500 (5.000 starting stock + 0 end stock / 2 = 2.500 average stock)
    Inventory Turnover = 4 (10.000 / 2.500)
    ROI = 100% > 2.500 (R-C) earned out of 2.500 (A)
    cheers,
    bhavana

  • How to fetch data from different sources into one source (like into Ztable)

    hi friends,
    As per our client requirements they want to develope an Inventory and an Ontime delivery report in BO on top of Oracle database.
    Situation is some thing like they have ECC 6.0.and they want to collect all inventory and ontime delivery data at one place.According to me that could be one Ztable in which we can gather all data.Apart from that they are going to use Data Integrator in which they can directly fetch the data from R/3 system(They dont want to have BI system) and put all data in Oracle DB.On top of ORacle BO person can develop BO reports.
    My question is how to fetch all data at one place and what are the tables going to be use.
    kindly help me out as its very important project.
    Thanks
    Abhishek

    The following is my standard reply to those who need to get old data from a backup in one account and add it to another account.  The method described here may be applied to your case.  It would be a bit of a long process, though.
    When connected to the account you want to GET data from, Go to Settings>iCloud and turn all data that is syncing with iCloud (contacts, calendars, etc.) to Off. 
    When prompted choose to keep the data on the iPhone. 
    After everything is turned off, scroll to the bottom and tap Delete Account.  Next, set up a new iCloud account using a different Apple ID and turn iCloud data syncing for contacts, etc. back to On.  When prompted, choose Merge.  This will upload the data to this new account.
    Note that this only affects the "Apple data" like contacts, calendars, reminders, etc.  Many third party apps also use iCloud to store data files there.  These files may be lost in the process, unless the apps also keep the data locally on the device.
    NOTE:  Photos in the photo stream (if you use it) will not transfer to the new account.  It is advised that you save the photos to a computer before performing the account switch. 

  • How to fetch data from CDHDR Table based on Order Number

    Hi,
    I need to fetch the data from CDHDR just based on the Order number .I found there is a field called 'OBJECTID' in table 'CDHDR'. But the  last part of OBJECTID contains order number.suppose my order number is 90506210 the objectid field contains '51030000090506210'.510 is login client,don't know what 30 is and last part is order number i.e 000090506210.i have to concatenate all and fetch data .i can do it for one order number but here order number is declared as select-options.how do i ?
    HERE IS THE CODE FOR ONE ORDER NUMBER.HOW CAN DO FOR RANGE OF ORDER NUMBERS.
    PARAMETER : S_OBJECT FOR  /BEV1/RBVBAK-AUFNR  OBLIGATORY.
    DATA : IT_CDHDR TYPE STANDARD TABLE OF CDHDR WITH HEADER LINE,
                 WA_CDHDR LIKE LINE OF IT_CDHDR,
                 S_OBJECT1 LIKE CDHDR-OBJECTID.
    CONCATENATE  sy-mandt  '30'  S_OBJECT INTO S_OBJECT1.
    SELECT * FROM CDHDR INTO TABLE IT_CDHDR WHERE OBJECTID = S_OBJECT1.

    P838355 wrote:>
    > Hi,
    >  I need to fetch the data from CDHDR just based on the Order number .I found there is a field called 'OBJECTID' in table 'CDHDR'. But the  last part of OBJECTID contains order number.suppose my order number is 90506210 the objectid field contains '51030000090506210'.510 is login client,don't know what 30 is and last part is order number i.e 000090506210.i have to concatenate all and fetch data .i can do it for one order number but here order number is declared as select-options.how do i ?
    >
    > HERE IS THE CODE FOR ONE ORDER NUMBER.HOW CAN DO FOR RANGE OF ORDER NUMBERS.
    >
    >
    > PARAMETER : S_OBJECT FOR  /BEV1/RBVBAK-AUFNR  OBLIGATORY.
    >
    > DATA : IT_CDHDR TYPE STANDARD TABLE OF CDHDR WITH HEADER LINE,
    >              WA_CDHDR LIKE LINE OF IT_CDHDR,
    >              S_OBJECT1 LIKE CDHDR-OBJECTID.
    >
    > CONCATENATE  sy-mandt  '30'  S_OBJECT INTO S_OBJECT1.
    >
    > SELECT * FROM CDHDR INTO TABLE IT_CDHDR WHERE OBJECTID = S_OBJECT1.
    You need to loop through the select option and concatenate with required data then select using 'in' instead of equal or select one by one.
    or
    select sales order numbers from VBAK for the selection into internal table then loop through the internal table and concatenate then select from CDHDR.
    for better performance use objectclass in where clause. the value for sales order for objectclass is VERKBELEG.
    in my system the object id is just an order number there is no other additions to it but in CDPOS the tabkey contains the order number with client and other information also.
    the 30 may be your item number... check it
    go ahead and change sales order and see what you can find in CDHDR
    Good luck
    Edited by: Sampath Kumar on Oct 21, 2009 9:02 AM

  • How to Select Data from different Tables Using Linq

    Hi,
    I have two different tables, I just want to collect data from tables using Linq to SQL Queries.
    The tables looks like This 
    ID Name ImageUrl 
    Other Table is
    ID EmpID CheckInTime CheckOutTime 
    What I want to Collect data from CheckInTime and want to place it in a that is in a list view
    Same thing I want to do it for CheckOutTime And One thing I want to tell is both tables are joined by a FK EmpID with ID.
    What Are the suggestions for me 
    I have Used this code
    var data = from emp in db.Employees
    join chk in db.CheckInCheckOuts on emp.ID equals chk.EmpID
    select new EmployeeCheckInOut
    Name = emp.Name,
    ImageUrl = emp.ImageUrl,
    CheckIn = emp.CheckInCheckOuts,
    CheckOut = emp.CheckInCheckOuts
    Here the CheckInCheckOuts is another table, I don't how do I access fields of the Other table "CheckInCheckOuts"
    Thank you
    Ali

    Mitja,
    Kind of Tables, I don't Know but I can Tell you that these are Two table, first Table Have Data in It, Name, ImageUrl I have filled this table with names and ImageUrls And are string type.Other Table is for the CheckInTime And CheckOutTime of the employee.
    What I need that when I click on the Image button it Should displays The Current Datetime into the label below the Image button.
    So I have Problem accessing my CheckInCheckOut Table because I may not have Idea about.Did you understand what I need to do, if you have more question please ask to me.
    Thanks
    Ali

  • How to fetch data from a table?

    I am newbie and I have no idea how to do this. I have a table
    (Excel File) about 1000 rows and 3 columns.
    I want to load this table to the Flash and then be able to
    fetch data by referring to the first column.
    I am grateful for a tip to how to this simply. Thanx.

    Flash does not read Excel tables on local dirve. Flash can
    read an XML or LoadVars file from local drive.
    So if you can get the data exported into a text file using
    either XML or LoadVars data structures, Flash has built-in classes
    in its library to consume the data.
    You can on a more advanced level use DCOM on a Windows IIS
    server plus something like OLEDB to open an Excel table or any app
    but it is not real practical for a production app involving more
    than one user at a time.

  • How to show data from different tables in database in ADF Jdeveloper 11g R2

    Hi,
    My requirement is to display the data in the grid (html > table), the data is to be displayed from more than one table in a single grid and thereafter I am supposed to display the sum of some of the records in another table, I am confused about this, plz help.
    Rajat

    The view link is generally used to relate two view objects together in the AMs data model, for example in a master-detail relationship. If you use them properly, ADF takes care of coordinating master/detail records - for example, ensuring that the detail record has the correct FK to the master record.
    Have you read the Fusion Developers Guide for ADF? [url http://docs.oracle.com/cd/E26098_01/web.1112/e16182/bcquerying.htm#CEGJCAHC]This section, for example?
    John

  • How to fetch data from item table

    Hi,
    Can some one give me the code to get the details from the item table details into  MI client.
    Thanks and Regards
    Manohar

    hi,
    are you on MI7.0 or MI7.1? And you have the data already on the client and just want to see the details?
    If it is MI7.0 - send me a mail and I send you a few codelines that will do that for you.
    Regards,
    Oliver

  • Fetch data from different database tables

    Hi...
    How can i fetch data from different database tables and put it into a internal table and then display it??? Can provide simple short codes as i'm new to ABAP. Thanks.

    Hi,
    Check this sample code..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              is_layout          = s_layout
              it_fieldcat        = t_fieldcatalog
              i_tabname_header   = 'ITAB'
              i_tabname_item     = 'ITAB1'
              is_keyinfo         = s_keyinfo
         TABLES
              t_outtab_header    = itab
              t_outtab_item      = itab1
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Naren

Maybe you are looking for