Multiple tables, only one focused!

No, that's not what's happening; it's what I want to happen. ;-)
I have a JFrame with a few JPanel-extensions on it. these extensions just add a JTable in a JScrollpane, and a JLabel header, to the panel (just in the constructor), so there is not unusual behaviour in the functioning of these components [JPanel extensions].
However, I want the user to be able to click on the tables one at a time ONLY: currently the user can go to each table on the main JFrame window and select it, while a row in another table is still currently selected; thus, each table on the JFrame can have a row selected, all at the same time!
How can I change this to the behaviour that I want?
Regards,
lutha

This isn't focus. The indicator for focus is on the individual cell which has focus. By default it's either a blue or black border depending on whether the cell is currently being edited. I think what you are talking about is selection. This is shown by change the background of the selected cells. Here's how I got rid of that.import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test3 extends JFrame implements FocusListener {
  Color selectedBackground;
  public Test3() {
    String[] head = {"One","Two","Three"};
    String[][] data = {{"R1-C1","R1-C2","R1-C3"},
                       {"R2-C1","R2-C2","R2-C3"},
                       {"R3-C1","R3-C2","R3-C3"}};
    JTable jt1 = new JTable(data, head), jt2 = new JTable(data,head);
    selectedBackground = jt1.getSelectionBackground();
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    content.setLayout(new GridLayout(1,2));
    content.add(new JScrollPane(jt1));
    content.add(new JScrollPane(jt2));
    jt1.addFocusListener(this);
    jt2.addFocusListener(this);
    setSize(300, 300);
    setVisible(true);
  public void focusGained(FocusEvent fe) {
    ((JTable)fe.getSource()).setSelectionBackground(selectedBackground);
  public void focusLost(FocusEvent fe) {
    ((JTable)fe.getSource()).setSelectionBackground(((JTable)fe.getSource()).getBackground());
  public static void main(String[] args) { new Test3(); }
}

Similar Messages

  • Adding data to multiple tables using one form in Access 2010?

    Hi All,
    I have a access database with two tables and I want to create a single form to enter data into that tables.
    How to adding data to multiple tables using one form in Access 2010?
    I don't have to much knowledge of access database?
    Please help me
    Thanks
    Balaji

    You really don't enter identical data into 2 tables.  You enter dat into one single table, and then you have an unique identifier that maps to another table (you have a unique relationship between two tables). 
    Maybe you need to read this.
    http://office.microsoft.com/en-001/access-help/database-design-basics-HA001224247.aspx
    Think about it this way...  What is you update data in 2 tables, and then the data in one of those tables changes, but the data in the other table does NOT change.  WHOOPS!!  Now, you've got a BIG problem.  For instance, you have a customer
    named Bill Gates.  In one Table you update Bill's address to 1835 73rd Ave NE, Medina, WA 98039 and in the other table you accidentally update Bill's address to 183 73rd Ave NE, Medina, WA 98039.  Now you have 2 addresses for Bill.  Why would
    you want that???  Which is right?  No one knows.  If you have one address, you just have to update one address and if there is a mistake, you just have to update one address, but you don't have to waste time trying to figure out which is right
    and which is wong...and then update the one that is wrong.
    Post back with specific questions.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Add to Multiple Tables from One Page

    Hello,
    I am building an application that handles hardware inventory (APEX 4.0). I have an input page that adds data to two or more tables all at once. The page has two forms on it that point to two separate tables. However when I try to run the page, it fails and returns an error:
    ORA-06550: line 1, column 437: PL/SQL: ORA-00904: "ORH_LAST_UPDATE_DATE": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
         Error      Unable to process row of table IDD_ID_DATA.
    So far as i can see within the App, that column is not at issue (I am not even doing anything to it and it is nullable). I have looked into the App itself as well as doing some online research but have found nothing helpful...
    So my question is this: Is it possible to add to multiple tables from one page? If so how do I do it?
    I am new to APEX so any help would be greatly appreciated!

    UPDATE:
    I received an email from the APEX Support Team:
    "The simple answer is that you will need to manually code the DML (and query) processes if you wish to maintain multiple tables from one page (There is a limit of one table when using the built-in processes).
    In order to do this I suggest you delete the processes generated by the wizards and create PL/SQL processes with insert, update, delete statements as necessary. Such coding is not difficult but is more time consuming than when you can use built-in processes."
    I have been playing around with PL/SQL code and the end result is this:
    begin
         INSERT INTO table1
         VALUES(
              :P2_Item_Field1,
              :P2_Item_Field2);
         INSERT INTO table2
         VALUES(
              :P2_Item_Field1,
              :P2_Item_Field2);
    end;
    I used this code in a custom PL/SQL Process in the Processing>Processes section of Page Processing and it seems to work fine now. The only downside to this method is if the name of a Page Item is changed the code will also have to be changed. Other than that i have had no problems.

  • Importing CSV files into Multiple Tables in One Database

     I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
    A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
    There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
    in to multiple tables in one database.
    Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
    The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
    I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
    My Concerns/Questions:
    1. Should I create 1 SSIS package or should there be 2, one for each program?
    2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
    folders or when i update an exsisting file?
    Can you provide an example with your suggestion please?
    I greatly appreciate the assistance!
    Y_Tyler

    Hello Vikash,
    Thank you! This will help me get started.
    There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
    paths since there will be two separate folders?
    Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
    Can you help clarify this for me?
    Thank you!
    Y_Tyler

  • Export multiple tables into one flat file

    I have data in multiple tables on a processing database that I need to move up to a production database. I want to export the data into a flat file, ftp it to the production server and have another job pick up the file and process it. I am looking for
    design suggestions on how to get multiple tables into one flat file using SSIS?
    Thank You.

    Hey,
    Without a bit more detail, as per Russels response, its difficult to give an exact recommendation.
    Essentially, you would first add a data flow task to your control flow.  Create a source per table, then direct the output of each into an union all task.  The output from the union all task would then be directed to a flat file destination.
    Within the union all task you can map the various input columns into the appropriate outputs.
    If the sources are different, it would probably be easiest to add a derived column task in-between the source and the union all, adding columns as appropriate and setting a default value that can be easily identified later (again depending on your requirements).
    Hope that helps,
    Jamie

  • ACCESSING MULTIPLE TABLES THRU ONE SELECT STATEMENTS

    How to access multiple tables through one single select statement and also using where condition in it for multiple fields which are from different tables. please give me any example from any tables ....thanks in advance

    See the below example code :
    REPORT ZMM_COST no standard page heading
                            line-size 255
                            message-id zwave  .
    type-pools
    type-pools : slis.
    Tables
    tables : mara,
             makt,
             mbew,
             konp,
             pgmi,
             marc,
             RMCP3,
             sscrfields,
             mvke.
    Internal Table for MARC and MARA
    data : begin of i_join occurs 0,
           matnr like mara-matnr, " Material #
           meins like mara-meins, " Unit of Measure
           werks like marc-werks, " Plant
           zzdept like marc-zzdept," Department
           end of i_join.
    Internal table for PGMI
    data : begin of i_pgmi occurs 0,
           werks like pgmi-werks, " Plant,
           nrmit like pgmi-nrmit, " Material #
           wemit like pgmi-wemit, " Plant
           end of i_pgmi.
    Internal Table for MBEW
    data i_mbew like mbew occurs 0 with header line.
    Internal Table for Output
    data : begin of i_output occurs 0 ,
           matnr like mara-matnr, " Material #
           maktx like makt-maktx, " Material Desc
           VPRSV like mbew-VPRSV, " Price Control Indicator
           VERPR like mbew-VERPR, " Moving Avg Price
           meins like mara-meins, " Base Unit of Measure
           STPRS like mbew-STPRS, " Standard Price
           LPLPR like mbew-LPLPR, " Current Planned Price
           ZPLPR like mbew-ZPLPR, " Future Planned Price
           VPLPR like mbew-VPLPR, " Previous Planned Price
           kbetr like konp-kbetr, " Sales Price
           KMEIN like konp-KMEIN, " Sales Unit
           margin(5) type p decimals 2,
           vmsta like mvke-vmsta, " Material Status.
           end of i_output.
    Internal Table for A004
    data : i_a004 like a004 occurs 0 with header line.
    Variables
    data : wa_lines type i,
           wa_maktx type makt-maktx,
           v_flag type c.
      ALV Function Module Variables
    DATA: g_repid like sy-repid,
          gs_layout type slis_layout_alv,
          g_exit_caused_by_caller,
          gs_exit_caused_by_user type slis_exit_by_user.
    DATA: gt_fieldcat    type slis_t_fieldcat_alv,
          gs_print       type slis_print_alv,
          gt_events      type slis_t_event,
          gt_list_top_of_page type slis_t_listheader,
          g_status_set   type slis_formname value 'PF_STATUS_SET',
          g_user_command type slis_formname value 'USER_COMMAND',
          g_top_of_page  type slis_formname value 'TOP_OF_PAGE',
          g_top_of_list  type slis_formname value 'TOP_OF_LIST',
          g_end_of_list  type slis_formname value 'END_OF_LIST',
          g_variant LIKE disvariant,
          g_save(1) TYPE c,
          g_tabname_header TYPE slis_tabname,
          g_tabname_item   TYPE slis_tabname,
          g_exit(1) TYPE c,
          gx_variant LIKE disvariant.
    data : gr_layout_bck type slis_layout_alv.
    Selection-screen
    selection-screen : begin of block blk with frame title text-001.
    parameters : p_werks like marc-werks default '1000' obligatory.
    select-options : s_dept for marc-zzdept obligatory,
                     s_matnr for mara-matnr,
                     s_mtart for mara-mtart,
                     s_vprsv for mbew-VPRSV,
                     s_PRGRP for RMCP3-PRGRP MATCHCODE OBJECT MAT2 ,
                     s_vmsta for mvke-vmsta.
    selection-screen: end of block blk.
    *SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    *PARAMETERS: p_vari LIKE disvariant-variant.
    *SELECTION-SCREEN END OF BLOCK b3.
    At slection screen events                                            *
    *-- Process on value request
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    PERFORM f4_for_variant.
    Initialization                                                       *
    Initialization.
      g_repid = sy-repid.
    sscrfields-functxt_01 = 'Clear Selection'.
    selection-screen function key 1.
    AT SELECTION-SCREEN.
    case sscrfields-ucomm.
    when 'Clear Selection' or 'FC01'.
    clear: s_matnr,
           p_werks.
    refresh: s_matnr,
             s_dept,
             s_mtart,
             s_vprsv,
             s_PRGRP,
             s_vmsta.
    endcase.
    Start-of-selection.
    start-of-selection.
    Clear the all data.
      perform clear_data.
    Get the data from PGMI Table
      perform get_pgmi.
    Get the data from MARC and MARA Table
      perform get_mara_marc.
    Get the data from MBEW Table
      perform get_mbew.
    Move the data into OUTPUT Table
      perform move_output_internal.
    *end-of-selection.
    end-of-selection.
      if not i_output[] is initial.
    ALV Function Module
        perform print_alv.
      endif.
    *&      Form  get_pgmi
          Select the data from PGMI Table
    FORM get_pgmi.
      clear v_flag.
    If Product group has a value at Selection-screen.
      if not s_prgrp is initial.
        select werks nrmit wemit from pgmi into table i_pgmi
                                 where prgrp in s_prgrp
                                 and   werks = p_werks
                                 and   wemit = p_werks.
        v_flag = 'X'.
      endif.
    ENDFORM.                    " get_pgmi
    *&      Form  get_mara_marc
          Select the data from MARA and MARC
    FORM get_mara_marc.
      if v_flag = 'X'.
        select amatnr ameins bwerks bzzdept into table i_join
               from mara as a inner join marc as b on amatnr = bmatnr
               for all entries in i_pgmi
                                         where a~matnr in s_matnr
                                         and   b~werks = p_werks
                                         and   b~zzdept in s_dept
                                         and   a~mtart in s_mtart
                                         and   a~matnr = i_pgmi-nrmit
                                         and   b~werks = i_pgmi-werks.
      else.
    Get the data from MARA and MARC Table
        select amatnr ameins bwerks bzzdept into table i_join
               from mara as a inner join marc as b on amatnr = bmatnr
                                         where a~matnr in s_matnr
                                         and   b~werks = p_werks
                                         and   b~zzdept in s_dept
                                         and   a~mtart in s_mtart.
      endif.
      clear wa_lines.
      describe  table i_join lines wa_lines.
      if wa_lines is initial.
        message i000(zwave) with 'List contains no data'.
        stop.
      endif.
      sort i_join by matnr werks zzdept.
    ENDFORM.                    " get_mara_marc
    *&      Form  get_mbew
          Select the data from MBEW Table
    FORM get_mbew.
    Get the data from MBEW.
      select * from mbew into table i_mbew
               for all entries in i_join
               where matnr = i_join-matnr.
      clear wa_lines.
      describe  table i_mbew lines wa_lines.
      if wa_lines is initial.
        message i000(zwave) with 'List contains no data'.
        stop.
      endif.
      sort i_mbew by matnr bwkey.
    ENDFORM.                    " get_mbew
    *&      Form  move_output_internal
         Final Results
    FORM move_output_internal.
      loop at i_join.
        clear wa_maktx.
      Compare the data with MVKE Table
        select single vmsta from mvke into mvke-vmsta
                                 where matnr = i_join-matnr
                                 and   vkorg = '0001'
                                 and   vtweg = '01'
                                 and   vmsta in s_vmsta.
        if sy-subrc ne 0.
          continue.
        else.
          i_output-vmsta = mvke-vmsta.
        endif.
        read table i_mbew with key matnr = i_join-matnr
                                   bwkey = i_join-werks
                                   binary search.
        if sy-subrc eq 0.
    Price Control Indicator
          i_output-VPRSV = i_mbew-VPRSV.
    Moving Average Price
          i_output-VERPR = i_mbew-VERPR / i_mbew-peinh.
    Standard Price
          i_output-STPRS = i_mbew-STPRS / i_mbew-peinh.
    Current Planned Price
          i_output-LPLPR = i_mbew-LPLPR / i_mbew-peinh.
    Future Planned Price
          i_output-ZPLPR = i_mbew-ZPLPR / i_mbew-peinh.
    Previous Planned Price
          i_output-VPLPR = i_mbew-VPLPR / i_mbew-peinh.
    Base Unit of Measure - Added by Seshu 01/09/2007
          i_output-meins = i_join-meins.
        else.
          continue.
        endif.
    Get the sales Price.
        perform get_sales_data.
        if i_mbew-VPRSV = 'V'.
    Get the Percentage of Margin
          if i_output-kbetr ne '0.00'.
            i_output-margin = ( ( i_output-kbetr - i_mbew-VERPR )
                               / i_output-kbetr ) * 100 .
          endif.
        else.
    Get the Percentage of Margin
          if i_output-kbetr ne '0.00'.
            i_output-margin = ( ( i_output-kbetr - i_output-stprs )
                               / i_output-kbetr ) * 100 .
          endif.
        endif.
    Get the material Description from MAKT Table
        select single maktx from makt into wa_maktx
                                 where matnr = i_join-matnr
                                 and   spras = 'E'.
        if sy-subrc eq 0.
          i_output-matnr = i_join-matnr.
          i_output-maktx = wa_maktx.
        endif.
        append i_output.
        clear : i_output,
                i_join,
                i_mbew.
      endloop.
    ENDFORM.                    " move_output_internal
    *&      Form  get_sales_data
          Get the Sales Price for each material
    FORM get_sales_data.
    Get the data from A004 table to get KNUMH
    Added new field Sales Unit - Seshu 01/09/2006
      refresh : i_a004.
      clear :   i_a004.
      data : lv_kbetr like konp-kbetr," Condition value
             lv_KPEIN like konp-kpein , "per
             lv_KMEIN like konp-KMEIN. " Sales Unit
      select * from a004 into table i_a004
                              where matnr = i_join-matnr
                              and   vkorg = '0001'
                              and   vtweg = '01'.
      if sy-subrc eq 0.
        sort i_a004 by DATAB descending.
    Get the Latetest Date
        read table i_a004 with key matnr = i_join-matnr
                                   vkorg = '0001'
                                   vtweg = '01'
                                   binary search.
    Get the Sales Value
        select single kbetr KPEIN KMEIN from konp
                 into (lv_kbetr,lv_KPEIN, lv_KMEIN)
                                 where knumh = i_a004-knumh
                                 and   kappl = i_a004-kappl
                                 and   kschl = i_a004-kschl.
        if sy-subrc eq 0.
          i_output-kbetr = lv_kbetr / lv_KPEIN.
          i_output-KMEIN = lv_KMEIN.
        endif.
      endif.
      clear : lv_kbetr,
              lv_kpein,
              lv_KMEIN.
    ENDFORM.                    " get_sales_data
    *&      Form  print_alv
          ALV Function Module
    FORM print_alv.
    Fill the Fiedlcat
      PERFORM fieldcat_init  using gt_fieldcat[].
      gr_layout_bck-edit_mode = 'D'.
      gr_layout_bck-colwidth_optimize = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
       I_INTERFACE_CHECK                 = ' '
       I_BYPASSING_BUFFER                =
       I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = g_repid
       I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = g_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                         = gr_layout_bck
          IT_FIELDCAT                       = gt_fieldcat[]
       IT_EXCLUDING                      =
       IT_SPECIAL_GROUPS                 =
       IT_SORT                           =
       IT_FILTER                         =
       IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
        I_SAVE                            = g_save
        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_ADD_FIELDCAT                   =
       IT_HYPERLINK                      =
       I_HTML_HEIGHT_TOP                 =
       I_HTML_HEIGHT_END                 =
       IT_EXCEPT_QINFO                   =
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER           =
       ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = i_output
       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.
    ENDFORM.                    " print_alv
    *&      Form  fieldcat_init
          Fieldcat
    FORM fieldcat_init USING  e01_lt_fieldcat type slis_t_fieldcat_alv.
      DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    Material #
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MATNR'.
      LS_FIELDCAT-ref_fieldname = 'MATNR'.
      LS_FIELDCAT-ref_tabname = 'MARA'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Material'.
      ls_fieldcat-seltext_M = 'Material'.
      ls_fieldcat-seltext_S = 'Material'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Material Description
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MAKTX'.
      LS_FIELDCAT-OUTPUTLEN    = 35.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Description'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Price Indicator
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'VPRSV'.
      LS_FIELDCAT-OUTPUTLEN    = 7.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Price Control Indicator'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Moving Avg Price
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'VERPR'.
      LS_FIELDCAT-OUTPUTLEN    = 11.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Moving Avg Price'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Base Unit of Measure
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MEINS'.
      LS_FIELDCAT-OUTPUTLEN    = 7.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Base Unit'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Standard Price
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'STPRS'.
      LS_FIELDCAT-OUTPUTLEN    = 11.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Standard Price'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Current Planned Price
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'LPLPR'.
      LS_FIELDCAT-OUTPUTLEN    = 11.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Current Planned Price'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Future Planned Price
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'ZPLPR'.
      LS_FIELDCAT-OUTPUTLEN    = 11.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Future Planned Price'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Previous Planned Price
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'VPLPR'.
      LS_FIELDCAT-OUTPUTLEN    = 11.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Previous Planned Price'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Sales Price
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'KBETR'.
      LS_FIELDCAT-OUTPUTLEN    = 13.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Sales Price'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Sales Unit
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'KMEIN'.
      LS_FIELDCAT-OUTPUTLEN    = 7.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Sales Unit'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    % of Gross Margin
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MARGIN'.
      LS_FIELDCAT-OUTPUTLEN    = 13.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = '% of Gross Margin'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Material Status
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'VMSTA'.
      LS_FIELDCAT-OUTPUTLEN    = 13.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      ls_fieldcat-seltext_L = 'Material Status'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    ENDFORM.                    " fieldcat_init
    **&      Form  f4_for_variant
          text
    *FORM f4_for_variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
            EXPORTING
                 is_variant          = g_variant
                 i_save              = g_save
                 i_tabname_header    = g_tabname_header
                 i_tabname_item      = g_tabname_item
              it_default_fieldcat =
            IMPORTING
                 e_exit              = g_exit
                 es_variant          = gx_variant
            EXCEPTIONS
                 not_found = 2.
    IF sy-subrc = 2.
       MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
       IF g_exit = space.
         p_vari = gx_variant-variant.
       ENDIF.
    ENDIF.
    *ENDFORM.                    " f4_for_variant
    *&      Form  clear_data
          Clear the Internal table
    FORM clear_data.
      clear : i_output,
              i_join,
              i_mbew,
              i_a004,
              i_pgmi.
      refresh :  i_output,
                 i_join,
                 i_mbew,
                 i_a004,
                 i_pgmi.
    ENDFORM.                    " clear_data
          FORM USER_COMMAND                                             *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                rs_selfield TYPE slis_selfield.                 "#EC CALLED
      CASE R_UCOMM.
        WHEN '&IC1'.
          read table i_output index rs_selfield-tabindex.
          SET PARAMETER ID 'MAT' FIELD i_output-matnr.
          SET PARAMETER ID 'WRK' FIELD p_werks.
          if not i_output-matnr is initial.
            call transaction 'MD04' and skip first screen.
          endif.
      ENDCASE.
    ENDFORM.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Left Outer Joining multiple tables to one source table FAILS with VLD-1511

    Hi all,
    Is it me, or is OWB unable to handle left outer joining 1 source table to multiple other tables?
    I want to load a fact table so I have 1 source table with measures. This table must be outer joined to some dimensions that have their FK in the fact table.
    The SQL statement would look like this (and is perfectly valid):
    select ...
    from input, dim1, dim2
    where input.c1 = dim1.c1(+)
    and input.c2 = dim2.c2(+);
    I put the where clause in the joiner operator and validate, but that gives me message VLD-1511: A table may be outer joined to at most one other table.
    Even splitting this up into one outer join per joiner still gives this message.
    A search and look around on the forum and on metalink shows there are related issues (like bug 3334035). Seemingly creating a view is the work-around to use.....? (ie downgrading owb to a simple gui tool) }-;
    Have other people experienced this problem of not being able to outer join one input table to multiple other tables?
    Thanks,
    Ed

    I have had some feedback from Oracle. It turns out this has to do with 2 issues. Below I have pasted the text that Support gave me:
    <---------- START QUOTE ---------->
    RESEARCH
    =========
    Bug 3437036 KEY LOOKUP DOES NOT DETECT ORA-1417 IN VALIDATE/GENERATE STEP
    Unpublished Bug 4211684 FORWARD PORT OF BUG 3437036
    shows:
    Some more development has been completed when this bug is fixed in Paris.
    The following are the details:
    1. If the join condition contains a full outer join such as
    tab1.c (+) = tab2.c (+) and tab2.c (+) = tab3.c
    then the new validations implemented for this bug do not apply since
    in OWB, full outer join triggers generation of joins in ANSI syntax.
    ANSI syntax does not have the original problem the base bug of this
    bug reported.
    2. If the join condition does not contain any full outer join condition,
    then the join is generated in Oracle join syntax, which is subject two
    several restrictions. The fix to this bug check two of the restrictions.
    3. The first restriction in Oracle syntax is that the outer join operator
    "(+)" can only directly be attached to a column name. If you attach it
    to an expression, such as the following:
    (tab1.c + 1) (+) = tab2.c
    Then there will be an ORA-936 error at the time of mapping deployment.
    For this case, I have added a validation message VLD-1512 to error out
    this situation.
    4. The second restriction in Oracle syntax is that a table can only be
    outer joined to exactly one other table.
    For example, this is an invalid join in Oracle syntax:
    tab1.c (+) = tab2.c and tab1.d (+) = tab3.d
    because tab1 is left outer joined to tab2 and tab3.
    But note that the following is still valid in Oracle syntax:
    tab1.c (+) = tab2.c and tab1.d = tab3.d (+)
    because tab1 is left outer joined to tab2 and right outer joined to tab3.
    So this latter case does not violate the restriction that "same oj" to
    more than 1 table is not allowed.
    If same oj to more than 1 table is specified in a join condition,
    VLD-1511 will be issued, and the map is made invalid.
    <---------- END QUOTE ---------->
    OWB does a partial validation, ie not all access paths are (can be) checked. A full check is only done by the database itself. So some scenarios (like checking whether multiple tables are outer joined the correct way) are not checked, and in this case are flagged with an error (even though it is actually a correct scenario).
    Seemingly this was not flagged with an error in earlier versions of OWB, so beware, OWB behaviour may change when upgrading...
    Alternative solutions are (1) using key lookups, (2) using a view with all outer joins in there, (3) using intermediate result tables between the joins.
    Hope this info helps some people prevent spending too much time on a false error message,
    Ed

  • Search a text in a multiple tables and one table has BLOB column

    Hi,
    I couldn't find a solution/examples for below scenario in oracle text documentation or related forums.
    I need to search a text in a multiple tables,in that one table has blob column which is used to store the documnents(pdf,doc,jpg..etc) and other tables have varchar2 columns,These tables have realation each other.
    Please provide a sample examples for above scenario.
    Thanks in advance..

    Have a look at my blog entry here:
    https://blogs.oracle.com/searchtech/entry/indexing_data_from_multiple_tables
    That describes two methods of achieving what you are looking for.

  • Selecting from multiple tables, into one internal table

    Hi,
    What is the best & most efficient method of selecting from multiple table (in my case 6,) into one internal table?
    Thanks,
    John
    Points will be rewarded and all responses will be highly appreciated.

    I have simple example :
    First one - Join 5 tables
    data : f1 type i,
              f2 type i,
              f3 type i.
    start-of-selection.
    get run time field f1.
    write the query 4 or 5 tables join.
    get run time field f2.
    f3 = f2 - f1 ( Total time).
    Second one - joins 3 table and use for all entries
    data : f1 type i,
              f2 type i,
              f3 type i.
    start-of-selection.
    get run time field f1.
    write the query 3 tables join and use for all entries
    get run time field f2.
    f3 = f2 - f1. ( Total time )
    Finally you can have time diffrence between the both sql statement.

  • Insert/update multiple tables from one form.

    I'm working on an app. that requires the user to fill out a form. The contents from the form is then used to either insert new records or update existing records in multiple tables. Is that possible? Can someone give a details example?

    You should create a form like you would create it having one table. Use row_id as primary key. The rest of the process are done by the triggers - those will take care of updating the right table depending which column was hit.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Inserting into multiple tables on one form using UIX

    We are developing an application using struts and UIX. We would like to be able to insert into three tables on one form(view). How can we accomplish this?

    This is more of an ADF question, you'll need to set up view object, than just drag it from the data control palette like normal.
    If it's not already set up as a view in the db (split into multiple tables), you'll need to create a view object that includes all the fields you want, based on multiple entity objects.

  • SQL performance - multiple tables or one bigger one?

    One product will have 5 different types of media that need to
    be
    associated with it.
    Some products will have, perhaps many items in one column
    while none in
    other columns
    For Example
    Product ID | ###
    images | photoID1, PhotoID2
    multimedia |
    testimonials |
    Pdfs | pdfid1
    INserts | insertid1, insertid2 insertid3
    Anyways, I am wondering if creating one table with multiple
    columns is
    better than many tables with just one of each of these
    categories?
    In other words, would it be better to have a table for
    multi-media, a
    table for pdfs and so on or one table for all of them. Some
    rows will be
    empty.
    does the server take a bigger hit accessing multiple tables
    win
    individual items or one table with more columns that are,
    perhaps empty?

    .oO(Lee)
    >One product will have 5 different types of media that
    need to be
    >associated with it.
    >
    >Some products will have, perhaps many items in one column
    while none in
    >other columns
    >
    >For Example
    >
    >Product ID | ###
    >images | photoID1, PhotoID2
    >multimedia |
    >testimonials |
    >Pdfs | pdfid1
    >INserts | insertid1, insertid2 insertid3
    >
    >Anyways, I am wondering if creating one table with
    multiple columns is
    >better than many tables with just one of each of these
    categories?
    >
    >In other words, would it be better to have a table for
    multi-media, a
    >table for pdfs and so on
    That would be one possible way.
    >or one table for all of them. Some rows will be
    >empty.
    Don't do that, at least not in the way you described above.
    But you
    could do it with a single table if you would add a column
    that describes
    the media type:
    productId
    mediaType
    mediaId
    There would be a record for every single associated media. A
    product
    with 3 PDFs and 5 images would have 8 records in the media
    table.
    Micha

  • Radio button in a Table -Only one row/radio button selection to be possible

    Hi experts,
    I have a requirement from customer to have a radio button inside a table of a WebDynpro ABAP application. For example, a table containing list of mobile numbers.
    The columns has
    Mobile Model, Cost, Company name, and a radio button named choice.
    Only one record and hence one radio button can be chosen at a given time.
    When the user clicks on the radio button choice corresponding to the row of the mobile of his choice, the row should get lead selected .
    When the user chooses a different choice radio button (corresponding to another mobile) the old radio button choice should get deselected, new row and its radio button should be lead selected.
    Can you give me the code how to deselect the remaining radio buttons when a user selects on one Radio button

    Hi Sandeep ,
    Have a look at the events of table UI element and its paramaters , Here's the link.
    [Link|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/content.htm]
    The event 'Onselect' or 'OnLeadSelect' provides 4 standard paramaters , out of which , OLD_LEAD_SELECTION/OLD_ROW_ELEMENT is one of them.
    So you could use this element and set the attribute value (Which is bound to the radio button) to abap_false.
    Although I am not sure as to which event ight trigger ( ON_LEAD_SELECT / ON_SELECT ).:)
    Thanks,
    Aditya.

  • Multiple administrators, only one can write to disk

    I recently got an used MacBook Pro which came with an admin account. I tried to import my settings from an external disk (using Time Machine) but 10.8 couldn’t read the disk. I tried creating another admin account, and import my settings from it, unsuccessfully. Finally I downloaded 10.9 and during install I told it to import the account from the external disk, which it did.
    I now have 3 admin accounts:
    The one with which I can write to the hard disk, the original.
    The second one which is useless.
    The one with which I can sync my iphone and create a security copy. Whenever I try to write to the HD it asks me for authentication and it won’t let the programs (e.g. iWork) create files. I can only save in the “shared” folder.
    I wish to maintain the third account, mostly because I really need to be able to save the contents of my external memory unit (AKA iPhone) and delete the other accounts, but the minus sign in Settings/User accounts is grayed out and I can only highlight the account that I logged in with. Also, it concerns me not being able to write to HD; I mean, I could just save to the shared folder but it just doesn’t feel right.
    Thanks you very much in advance!

    The first thing you should do with a second-hand computer is to erase the internal drive and install a clean copy of OS X. How you do that depends on the model. Look it up on this page to see what version was originally installed.
    If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc, which you can get from the Apple Store or a reputable reseller — not from eBay or anything of the kind. If the machine has less than 1 GB of memory, you'll need to add more in order to install 10.6. I suggest you install as much memory as it can take, according to the technical specifications.
    If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for some MacBook Air models. If you don't have the media, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To boot from an optical disc or a flash drive, insert it, then reboot and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    If the machine shipped with OS X 10.7 or later, you don't need media. It should boot into Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    Once booted from the disc or in Internet Recovery, launch Disk Utility and select the icon of the internal drive — not any of the volume icons nested beneath it. In the Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive, which is what you should do.
    After partitioning, quit Disk Utility and run the OS X Installer. When the installation is done, the system will automatically reboot into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    You should then run Software Update and install all available system updates from Apple. If you want to upgrade to a major version of OS X newer than 10.6, buy it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the previous owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed — you have to repurchase them.
    If the previous owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Apple customer service has sometimes issued redemption codes for these apps to second owners who asked.
    If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able toauthorize it under your ID. In that case, contact iTunes Support.

  • How to drop multiple tables in one statement

    I could used to run the below syntax to drop multiple tables in MS SQL, but it doesn't work in Oracle seems like, I am using free Oracle SQL Developer. Not a big deal but wanna know if this can be done. Thanks,
    DROP TABLE A, B, C, D, F

    I'm not so sure in 1 select statement is it possible or not but you can try to use in this manner to see what happens ->
    drop table &tab;
    Enter value for tab: A
    Table A Successfully dropped.
    Enter value for tab: B
    Table B Successfully dropped.Regards.
    Satyaki De.

Maybe you are looking for