Fields on selection field frm different tables

Dear Techis
I want to shw my selection screen with filds from different tables so hw i use select statement i dont want to use join statement so will anybody pls tell me alternative soln with example
Thanks

Hi,
U can use for all entries see the example.
i am using tow table like ekko ,ekpo.
REPORT  z_sn_report                             .
TYPE-POOLS: SLIS.
TABLES: ekko , ekpo.
types: BEGIN OF ty_ekko,
        ebeln TYPE ekko-ebeln,
        bukrs TYPE ekko-bukrs,
        lifnr TYPE ekko-lifnr,
      END OF ty_ekko.
types: BEGIN OF ty_ekpo,
        ebeln TYPE ekpo-ebeln,
        ebelp TYPE ekpo-ebelp,
        matnr TYPE ekpo-matnr,
        menge TYPE ekpo-menge,
        netpr TYPE ekpo-netpr,
      END OF ty_ekpo.
types: BEGIN OF ty_final,
        ebeln TYPE ekko-ebeln,
        bukrs TYPE ekko-bukrs,
        lifnr TYPE ekko-lifnr,
        ebelp TYPE ekpo-ebelp,
        matnr TYPE ekpo-matnr,
        menge TYPE ekpo-menge,
        netpr TYPE ekpo-netpr,
      END OF ty_final.
data: it_ekko type standard table of ty_ekko with header line,
      it_ekpo type standard table of ty_ekpo with header line,
      it_final type standard table of ty_final with header line.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
selection-screen: begin of block b1 with frame title text-001.
select-options: s_ebeln for ekko-ebeln.
parameters: p_bukrs like ekko-bukrs.
selection-screen: end of block b1.
select ebeln
       bukrs
       lifnr
       from ekko
       into table it_ekko
       where ebeln in s_ebeln
       and bukrs = p_bukrs.
if not it_ekko[] is initial.
select ebeln
       ebelp
       matnr
       menge
       netpr
       from ekpo
       into table it_ekpo
       for all entries in it_ekko
       where ebeln = it_ekko-ebeln.
       endif.
loop at it_ekpo.
read table it_ekko with key ebeln = it_ekPo-ebeln.
if sy-subrc  = 0.
it_final-ebeln = it_ekko-ebeln.
it_final-bukrs = it_ekko-bukrs.
it_final-lifnr = it_ekko-lifnr.
it_final-ebelp = it_ekpo-ebelp.
it_final-menge = it_ekpo-menge.
it_final-netpr = it_ekpo-netpr.
append it_final.
clear it_final.
endif.
endloop.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
   I_PROGRAM_NAME               = sy-repid
   I_INTERNAL_TABNAME           = 'IT_FINAL'
  I_STRUCTURE_NAME             =
  I_CLIENT_NEVER_DISPLAY       = 'X'
   I_INCLNAME                   = SY-REPID
  I_BYPASSING_BUFFER           =
  I_BUFFER_ACTIVE              =
  CHANGING
    ct_fieldcat                  = IT_FIELDCAT[]
EXCEPTIONS
  INCONSISTENT_INTERFACE       = 1
  PROGRAM_ERROR                = 2
  OTHERS                       = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
    I_INTERFACE_CHECK                 = ' '
    I_BYPASSING_BUFFER                = ' '
    I_BUFFER_ACTIVE                   = ' '
     I_CALLBACK_PROGRAM                = 'Z_SN_REPORT'
    I_CALLBACK_PF_STATUS_SET          = ' '
    I_CALLBACK_USER_COMMAND           = ' '
    I_CALLBACK_TOP_OF_PAGE            = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    I_CALLBACK_HTML_END_OF_LIST       = ' '
    I_STRUCTURE_NAME                  =
    I_BACKGROUND_ID                   = ' '
    I_GRID_TITLE                      =
    I_GRID_SETTINGS                   =
    IS_LAYOUT                         =
     IT_FIELDCAT                       = IT_FIELDCAT[]
    IT_EXCLUDING                      =
    IT_SPECIAL_GROUPS                 =
    IT_SORT                           =
    IT_FILTER                         =
    IS_SEL_HIDE                       =
    I_DEFAULT                         = 'X'
     I_SAVE                            = 'X'
    IS_VARIANT                        =
    IT_EVENTS                         =
    IT_EVENT_EXIT                     =
    IS_PRINT                          =
    IS_REPREP_ID                      =
    I_SCREEN_START_COLUMN             = 0
    I_SCREEN_START_LINE               = 0
    I_SCREEN_END_COLUMN               = 0
    I_SCREEN_END_LINE                 = 0
    IT_ALV_GRAPHICS                   =
    IT_HYPERLINK                      =
    IT_ADD_FIELDCAT                   =
    IT_EXCEPT_QINFO                   =
    I_HTML_HEIGHT_TOP                 =
    I_HTML_HEIGHT_END                 =
  IMPORTING
    E_EXIT_CAUSED_BY_CALLER           =
    ES_EXIT_CAUSED_BY_USER            =
    TABLES
      t_outtab                          = IT_FINAL
  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.

Similar Messages

  • Selecting from 2 different tables

    is this possible?
    i just want to select from two different tables in one select statement and they have the same WHERE clause

    SELECT
      a.pkggrp,
      a.pkgtype,
      a.area,
      a.process,
      a.ww,
      count(a.ww) as LOTSGATED,
      sum(a.samplesize) as SUMSAMPLESIZE,
      sum(a.total_defects) as SUMTOTALDEFECTS,
      sum(case a.auditresult when 'pass' then 1 else 0 end) COUNTPASS,
      sum(case a.auditresult when 'fail' then 1 else 0 end) COUNTFAIL,
      case sum(case a.auditresult when 'fail' then 1 else 0 end)
        when 0 then 0
      else round(sum(case a.auditresult when 'fail' then 1 else 0 end) / count(a.ww) * 100,2)
        end LRR,
      case sum(case a.auditresult when 'fail' then 1 else 0 end)
        when 0 then 0
      else round(sum(case a.auditresult when 'fail' then 1 else 0 end) / sum(a.samplesize) * 1000000,0)
        end PPM,
      count(c.itrnum)
    FROM
      t_prodproc_monitoring a, t_itr c
    WHERE
      a.ww=c.ww
      and a.ww between 1 and 50
      and c.ww between 1 and 50
    GROUP BY
      a.pkggrp,
      a.pkgtype,
      a.area,
      a.process,
      a.ww
    ORDER BY
      a.pkggrp,
      a.pkgtype,
      a.area,
      a.process,
      a.ww ascthis gave me a
    "c". "ww": invalid identifier

  • How to get different field in two are more different table using open sql

    Dear all,
              This SenthilMani am very new into sap abap am having doubt in reports how get the different fields from different tables like mara,marc,mard using open sql and native sql program give me some tips to get the data .
    with regards,
    senthil

    HI ,
      1) If u want to select data from more the two table then u can use FOR ALL ENTRIES.
             EX ..Open sql
                       select matnr from mara into table t_mara.
                      select matnr werks from marc into table t_marc for all entries in t_mara where matnr = t_mara-matnr.
      2) U can join more than one table.
               ex:
                   select mara~matnr
                              marc~werks
                    from mara join marc into table t_maramarc
                     on maramatnr = marcmatnr
    3) Using  native sql  ...only u can use JOIN statement

  • 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

  • Selecting Cells in Different Tables

    I've created three tables on a Numbers 09 spreadsheet - let's call them tables "A", "B" and "C".
    I want to select a cell on Table A and another cell on Table B then Sum them in another cell on Table C.
    The problem is, I cannot figure out how to select the cells on tables A and B simultaneously so that I can drag the Sum function for them to a cell on table C.

    Marty,
    In the English mode, the range identifier is the colon, not the comma. So, to SUM cells A1, B1 and C1, one would write: =SUM(A1:C1).
    This may be what is tripping you up. The comma delimits multiple ranges, so if you wanted the sum of A1, B1, C1 including as well X1, Y1 and Z1, one would write: =SUM(A1:C1, X1:Z1). Of course, the comma can also be used to delimit single-cell ranges, as in: =SUM(A1, X2, Z3)
    Further, and more to the point of your original question; to select multiple arguments for the SUM function, one at a time from different tables, type =SUM() in the cell where the result goes, and place the cursor between the parentheses, then hold down the Command key while you click in any Table, any cell, for as many tables and cells as you like, and the references will all appear in your expression properly formatted.
    Hope this helps.
    Jerry
    Additional comment about Command Key

  • Select name1 frm kna1 table on basis of customer number

    hi below is my PAI code
    my requiremnt is to select name1 field from kna1 table where
    kan1-kunnr = t_ZCUST_EM_create-ship_to
    where to code it pls suggest and how it will be displayed in the screen 200 ie when user press enter the name1 should automatically populate and display on the screen...
    PROCESS AFTER INPUT.                                                                               
    MODULE CANCEL_200 AT EXIT-COMMAND.                                                                               
    LOOP WITH CONTROL TABLE_ZCUST_EM_CREATE ."AT T_AIMS_OPN_CREATE ." .".
       MODULE USER_COMMAND_0200.                                                                               
    CHAIN.                                                                               
    FIELD t_ZCUST_EM_create-ship_to .                                                                               
    MODULE set_field_validation ON CHAIN-REQUEST.

    hi anji
    here is my code i ahve written in PAI event but facing problem that whne i save entering the third firled in table zcustemal which has ship_to ship to name
    and email id, kunnr is matched against kna1 table and eror msg comes if the kunnr in not in kna1 table it is working ok
    now also name 1 is being populated in the field in the screen as per my code
    but problem is
    1) when just typing kunnr and email id ( and press save without enter the data for all three is saved ie kunnr name1 ( which is selected from table kna1) and e mail id
    2) but whne i press enter after entering kunnr number on screen and then enter email id an dsave email id is not saved only kunnr and name1 is saved pls suggest
    where should i code dont know pls suggest??????
    CODe in screen
    PROCESS BEFORE OUTPUT.
      LOOP   WITH CONTROL TABLE_ZCUST_EM_CREATE."AT T_ZCUST_EM_CREATE
        MODULE STATUS_0200.
      ENDLOOP.
    *Process after input
    PROCESS AFTER INPUT.
      MODULE CANCEL_200 AT EXIT-COMMAND.
      LOOP WITH CONTROL TABLE_ZCUST_EM_CREATE ."AT T_zcust_em_CREATE ." .".
        CHAIN.
          FIELD t_ZCUST_EM_create-ship_to .
          MODULE set_field_validation ON CHAIN-REQUEST.
        ENDCHAIN.
        MODULE USER_COMMAND_0200.
      ENDLOOP.
      module read_table_value_0200.
    <b>MODULE set_field_validation INPUT.</b>
    nv added for  three email id and ship_to name
      select single * from zcustemail   where ship_to eq
      t_zcust_em_create-ship_to
      and ship_to_name = t_zcust_em_create-ship_to_name
      and email_id = t_zcust_em_create-email_id.
      if sy-subrc eq 0.
        t_gui1-fcode = 'BACK'.
        append t_gui1.
        t_gui1-fcode = 'EXIT'.
        append t_gui1.
        t_gui1-fcode = 'SAVE'.
        append t_gui1.
        SET PF-STATUS 'AIMS_200' excluding t_gui1.
        message e001 with 'Record already Exists in Zcusteamil'(001).
      else.
    *nv
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                 INPUT         = t_zcust_em_create-ship_to
              IMPORTING
                  OUTPUT       = t_zcust_em_create-ship_to.
         select single kunnr from kna1 into v_kunnr
         where kunnr = t_zcust_em_create-ship_to.
        if sy-subrc = 0.
           select single name1 from kna1 into t_zcust_em_create-ship_to_name
           where kunnr = t_zcust_em_create-ship_to.
          SET PF-STATUS 'AIMS_200'.
           else.
           message E001 with 'customer number does not exists'.
       endif.
    *nv
      endif.
    ENDMODULE.                 " set_field_validation  INPUT
    *Setting it for select/deselect entries
      move:t_zcust_em_create to t_zcust_em_create_sel.
      append t_zcust_em_create_sel.
      clear:t_zcust_em_create_sel.
    *Getting internal table t_zcust_em_create with control
      read table t_zcust_em_create
             with key ship_to = t_zcust_em_create-ship_to.
    *Getting internal table for create entries: screen-200
      if sy-subrc ne 0 and t_zcust_em_create-ship_to ne space .
        append  t_zcust_em_create     .
        move:t_zcust_em_create to t_zcust_em_create_tmp.
        append t_zcust_em_create_tmp .
        clear:t_zcust_em_create_tmp  ,
              t_zcust_em_create      .
      endif.
      clear:t_cols.
    *Getting the value of  w_fill_200.
      describe table t_zcust_em_create lines w_fill_200.

  • No hide fields or select fields in SAP Query Extractor?

    HI Gurus,
    I want to generate a data source, extraction data from SAP Query.
    Now I want to hide some fields or to mark some fields as relevant for selection.
    But after saving my settings are unavaiable...?
    Does somebody have an idea? Is this standard when extracting from Query or is this maybe an OSS...?
    Thanks

    Hello,
    Just logoff and Login again, then check it.
    Also see
    SAP Note 1014073 DFG: Changes to the DataSource are displayed incorrectly
    SAP Note 1073714 DataSource in RSA6: Unable to display/change customer fields
    SAP Note 925398 RSA6: DataSource enhancement only visible after restart
    Thanks
    Chandran

  • Can't get table field from two different tables if named same

    select c.notes, o.notes
    from cusomters c, orders o
    :does not work in getting the RS.
    :if i change database to:
    select c.customer_notes, o.order_notes
    from cusomters c, orders o
    :then it works.
    :i make PURE DYNAMIC META SQL database
    applicaitons, and i need for abstract SQL tables.
    i have the same problem in getting
    the max values:
    select
    max(height),
    max(weight),
    max(age)
    from person_stats
    group by geographical_area

    When you select from 2 different tables you need to join them on some condition, otherwise it has no idea how to associate the 2 tables together.
    try select c.notes, o.notes from cusomters c, orders o where c.customer_id = o.customer.id or whatever the join fields are.
    For the group by I believe you have to include the field that you group by:
    select geopraphical_area, max(height), max(weight), max(age) from person_stats group by geographical_area
    give them a try
    Jamie

  • Not able to select Field only option

    Dear All,
    I created a generic datasource based on a infoset query and enhanced the extract structure with a component zzvalov (amount). The idea is to fetch the amount from a different table writinga n user exit.
    Now, the filed ZZVALOV is by default in Hide mode in the extractor field selections. When I try to uncheck the Hidel field and select Field only option and save , I get an error message that OLTP has still some errors.
    Can anyone help to overcome this error. Is it mandatory to have the exit in place before I uncheck the Hide filed and select Field only ioption ? I did not get any warnings while activating the extract structure as well.
    Thanks in advance
    Regards,
    Srinivas

    Hi Srinivas,
    Please check:
    ['The OLTP Source still has errors|'The OLTP Source still has errors]
    [Re: OLTP error when appending a data source .|Re: OLTP error when appending a data source .]
    [Generic Datasource Error: The OLTP source still has errors|Generic Datasource Error: The OLTP source still has errors]
    [Re: The OLTP source still has errors  Message no. R8417|Re: The OLTP source still has errors  Message no. R8417]
    [Re: OLTP Contains still has errors.|Re: OLTP Contains still has errors.]

  • TO display pop_up on selection screen And chosse that field in 'SELECT' sta

    Hello,
    I want a pop up on selection screen when user clicks the push button on selection screen pop up should come on selection screen and display the all field of YTLEA table. when user checks few or all field from pop up then data for that field is selected from the YTLEA table.

    DDIF_TABL_GET

  • Fields for Selection on selection screen - Data Dictionary

    Hi,
    I have an issue while selecting the required fields for selection on the Standard table.
    VBAK --> Settings > Fields for Selection> Select required fields and save it as a variant.
    It looks good for that day but it again changes to the standard selection fields on the selection screen.
    Is there any way that i can keep the Fields for selection on the selection screen ?
    Any suggestion will be appreciated!
    Regards,
    Kittu

    Hi Kittu,
    The SE16 tool generates Selection Screens automatically for the Table and chosen fields therein the user selects. Unfortunately the tool is User Independent, thus other users can change the fields for selection thus rendering any Variants created useless. This is because of internal numbering identifiers for fields instead of field names making up the variant. SE16 has always being regarded as a development tool hence its limited functionality.
    I however may suggest that you could utilise ABAP Queries instead by way of transaction SQ01/SQ02 or SQVi. These may offer you a better solution.
    Best of luck,
    Derrick Hurley
    ABAP Development Workbench
    SAP
    Edited by: Derrick Hurley on Mar 31, 2011 4:01 PM
    Edited by: Derrick Hurley on Mar 31, 2011 4:01 PM

  • Selection Field in Report Painter Report

    Dear All,
    Could any one tell me the procedure to add new field at selection screen for the report painter report ? To change the report painter selection screen i have to change the Report group or Report of the report group?
    Thank in stack

    In general data selection, i have already cost center, but it is not apprearing at selection screen. Only three field are appearing (Year + Period + Forecast),  and i want to add cost center at the selection screen. How to make cost center field at selection field from General data selection option. Please guide me
    Thank in stack
    Nilesh Shete

  • How to make SAP Query additional field as one of the selection field ?

    Hi experts,
    I'm working on a AdHoc query. I added some Additional fields to the infoset. I put Abap code to populate this additional fields as output fields but I want to make these fields as selection fields also.
    How can I accomplish this ?
    I'd appreciate any answer or suggestion.
    Thanks in advance.

    See Extended / Quick Search capability with attributes in the following SAP notes.
    [482338 - Using Extended Search in ISA B2B, ver. 30|https://service.sap.com/sap/support/notes/482338]
    [792556 - Quick search using several attributes|https://service.sap.com/sap/support/notes/792556]
    [888528 - ISA R/3 4.0: Extended catalog search not consistent|https://service.sap.com/sap/support/notes/888258]

  • Build group of configured fields for selection

    Dear All,
                 Please let me know what is the usage of field under "Build groups of configured field"  where the grouped field has to be used as Selection field.
    Besides i also see that we don't have any Search help option which can be configured for grouped configured field. If possible please quote some examples.
    Thanks,
    Shubh,

    Dear Daniel,
                         Thanks for your response. "Where the grouped field has to be used as Selection field", I mean to ask , when we configure grouped field for web interface , it gives us the option as whether the Conf field type is for selection , or display or for Event Message.
                         Now i want to create the grouped field as selection field for providing it as a search criteria. Now suppose i have grouped first name and last name. How will the the selection field behave ?
    Thanks,
    Shubh.

  • How can I use create/createInsert for two different tables

    Hi All,
    I am showing different fields in the UI from different tables. I am able to fetch the data from all the tables and able to modify and save the data.
    Now, the problem when I want to create/insert some data into those columns(from different tables) I am facing issues.
    How can I proceed further??

    Hi Shay,
    Thank you very much for your quick response.
    Actually I am totally new in ADF world and I am trying to implement some applications in ADF.
    I created an UI based on some 3 tables(there is foreign key relation between them) and some other tables. I am able to modify and save my application if there is any data in all the tables.
    My Actual issues are
    1) I removed all the data from the tables. There is a submit(CreateInsert) button, what I expected is on click of the button I should see all the fields in editable mode. But I was able to see only few fields and also in readonly mode. So here my issue is how can i create and save these data.
    2) Consider on my landing page I have just CommandLink/CommandButton. After clicking that page I should get the above screen in create mode(I mean to say all fields in editable mode). How can achieve this?
    Thanks & Regards,
    Ravi.

Maybe you are looking for

  • Acrobat 9 Pro won't let me print to a printer

    Whenever I try to print, whether through the icon or the drop down menu, the printer dialog box will pop up, but after I click OK it just sends me to the print to file/save as dialog box. This happens whether I try to print a file through Chrome, Fir

  • Unequal size of X, Y, Z axis for 3D graph

    Hi, I have different size of array in X, Y and Z axis. What graph should I use best? I tried using 3D surface graph but it consume all my memory. My data is X = 1 X 41 array Y = 1 X 32768 array Z = 41 X 32768 array/matrix Thanks a lot...

  • Photoshop's FLASH web gallery - let's make it better

    hello there, I have spent many hours trying to solve this problem so any time you could spare to take a look at this would be great - i'm out of ideas/knowledge. Photoshop can produce flash web gallerys through it's automate function. These look grea

  • How to insert data in table UI elements

    Hi Guys, Here is my questions. How to insert data in table UI elements. Here i try to insert data by using Add button data:     Node_Item                           type ref to If_Wd_Context_Node.     Node_Item = wd_comp_controller->get_data_node( ).

  • Improve VM IOPs performance vs. physical server

    Hi there, Need some advice on VM configuration and improving IOPs - were testing out VM IOPs performance on our EMC SAN vs. physical server attached to the same SAN testing for migration. Server setup - we have a 4-Way 32-Core (X7550CPU) HP DL580  fr