"SELECT" problem

Hi everybody,
select s012matnr sum( s012menge ) sum( s012wemgm ) from s012 into corresponding fields of table it1 group by s012matnr.
i am having problem with the query mentioned above.
grouping by matnr is successful but summing of menge and wemge dont take place.
it comes as 0 in these two fields.
can somebody kindly let me know the right way of summing these two fields grouped by the material?
thanks,
max

Hi max
Try like this
DATA : BEGIN OF IT1 OCCURS 0,
MATNR LIKE S012-MATNR,
MENGE LIKE S012-MENGE,
WEMNG LIKE S012-WEMGM ,
END OF IT1.
SELECT S012MATNR SUM( S012MENGE ) SUM( S012WEMGM ) FROM S012 INTO TABLE IT1 GROUP BY S012MATNR.
LOOP AT IT1.
  WRITE : / IT1-MATNR,
            IT1-MENGE,
            IT1-WEMNG.
ENDLOOP.
if its useful reward points
Thanks
senthil

Similar Messages

  • Selection Problem with JTable

    Hello,
    i have a selection problem with JTable. I want to allow only single cell selection and additionally limit the selection to the first column.
    I preffered the style from MS Outlook Express where you can select the email accounts to edit.
    It is a table like this:
    Account name  |   Type  |   ...
    --------------|---------|---------------------
    Hotmail       |   POP3  |
    GMX           |   IMAP  |The selection should be only avaibable at 'Hotmail' or 'GMX' - not at 'POP3', 'IMAP' or as complete row selection.
    Please help me!
    Thanks.
    Warlock

    Maybe this will helpimport java.awt.*;
    import javax.swing.*;
    public class Test3 extends JFrame {
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        String[] head = {"One", "Two"};
        String[][] data = {{"R1-C1", "R1-C2"}, {"R2-C1", "R2-C2"}};
        JTable jt = new JTable(data, head);
        jt.getColumnModel().setSelectionModel(new MyTableSelectionModel());
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        jt.setCellSelectionEnabled(true);
        jt.setRowSelectionAllowed(false);
        jt.setColumnSelectionAllowed(false);
        setSize(300, 300);
        setVisible(true);
      public static void main(String[] arghs) { new Test3(); }
    class MyTableSelectionModel extends DefaultListSelectionModel {
      public void setSelectionInterval(int index0, int index1) {
        super.setSelectionInterval(0, 0);
    }

  • Select Problem For 'Back Menus' - Zen V P

    Just got the Zen V Plus and tried to set the time/date. Followed the 'guide' and after the time/date screen pressed the 'back button'. Got the Set Alarm/Date/Time (etc) menu but when I selected an option (moved joystick down to desired option then pressed the joystick) the time/date display came up and I was NOT ABLE to set the date. Same thing occurred trying to set the date (tried it several times and it worked once .... then attempted again - several times (4) but it only worked once). Turns out I have the same problem with any option in ANY 'back' menu. Suggestion?
    Do I have a defecti've unit (can't be the 'operator' who is defecti've! haha)? Should I return it and try another?
    Actually not that interested in playing music .... it's more for playing .wma(DRM) book files.

    Latest ... updated my firmware (to ZENVPlus_PCFW_P4S_L2___0.exe) and it fixed the select problem for SET DATE/TIME etc however
    the SELECT procedure doesn't always work for 'back button' menus. Example: tried to set a bookmark... following procedure in 'guide', pressed 'back button' and held it, from 'NOW PLAYING' screen - works 2 out of 5 times. Most of the time, pressing and holding takes you back to the previous menu - not to the 'back' (or in this case the SET BOOKMARK) menu. Sounds like something for the next version of firmware ... the code doesn't always set an internal timer correctly (am a programmer of 30 years ... part of that time pgmmng firmware).

  • Print selection problem

    when i select a page to be print from my pc the page select in

    Hello. I feel your pain and frustration with the print selection problem in safari, especially in Snow Leopard. I have spent hours trawling help pages and forums etc. BUT YEE HAA (sorry got a bit excited, but it really was hours) I found the answer. So here goes.
    Click on Safari
    Scroll down to services then slide to right
    Scroll down to services preferences and click
    Scroll down to the Text section
    If you Tick the Text box it will choose all options for you. Or if you don't want all options in the Text list, then untick Text box and tick options you do want.
    BUT for your print selection problem make sure you tick NEW TEXT EDIT WINDOW CONTAINING SELECTION.
    Then when you want to select something in a web page you want to print (including pictures etc) then highlight it, then Right click. And low and behold, in the list is NEW TEXT EDIT WINDOW CONTAINING SELECTION. Click that, Then press cmd+p and your printing.
    I really hope that helps with your problem
    I can now go to sleep.

  • At Line selection problem

    hi,
    iam stuck up with AT LINE-SELECTION problem ie i designed a screen where they need month list on clicking F4. i got the month list using month_names_get in the screen but while clicking the relevant month no.it's not entering into the required parameter. i have attached the codings,
    MODULE MONTH_DIS OUTPUT.
      SUPPRESS DIALOG.
      LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
      SET PF-STATUS SPACE.
      NEW-PAGE NO-TITLE.
      WRITE:/ 'SELECT MONTH' COLOR COL_HEADING.
      ULINE.
      DATA: T_MNTH LIKE T247 OCCURS 12 WITH HEADER LINE.
      refresh t_mnth.
      CALL FUNCTION 'MONTH_NAMES_GET'
       EXPORTING
         LANGUAGE                    = SY-LANGU
    IMPORTING
      RETURN_CODE                 =
        TABLES
          MONTH_NAMES                 = T_MNTH
       EXCEPTIONS
         MONTH_NAMES_NOT_FOUND       = 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.
      loop at t_mnth.
        write:/ t_mnth-mnr, t_mnth-ltx.
      endloop.
      CLEAR T_MNTH-MNR.
    ENDMODULE.                 " MONTH_DIS  OUTPUT
    AT LINE-SELECTION.
      p_period = t_mnth-mnr.
      CHECK NOT p_period IS INITIAL.
      LEAVE TO SCREEN 0.
    here in the AT LINE-SELECTION, the selected month is not coming to the required parameter.
    pls help me in this issue,
    Thanks in advance,
    Premnath.

    You need to set a "Hide" after the write... I suggest you also set your own dialog PF-STATUS too so you can have just a PF2 "pick" button and a Cancel button ( this will look better to the user).
    loop at t_mnth.
      write:/ t_mnth-mnr, t_mnth-ltx.
      hide: t_mnth.  "needs this
    endloop.
    clear: t_mnth.

  • Weird BGP path selection problem

    Hi, all,
    I am seeing a weird BGP path selection problem on 4948 switch running cat4500-entservicesk9-mz.122-46.SG.bin code, this switch has two uplinks to the same ISP's different edge router, one circuit is primary the other one is strict backup, only default route is accepted from ISP. I am setting both local preference and weight to the default route advertised over backup link, however neither one is taking effect, BGP still thinks the backup link is better, what could be wrong?
    rtr#sh ip bgp 0.0.0.0/0
    BGP routing table entry for 0.0.0.0/0, version 105
    Paths: (3 available, best #2, table Default-IP-Routing-Table, not advertised to EBGP peer)
      Not advertised to any peer
      17675, (received & used)
        203.169.8.37 from 203.169.8.37 (61.211.160.150)
          Origin IGP, localpref 100, valid, external
          Community: 65001:0 no-export
      17675
        203.169.8.45 from 203.169.8.45 (61.211.160.151)
          Origin IGP, localpref 90, weight 90, valid, external, best <====
          Community: 65001:0 no-export
      17675, (received-only)
        203.169.8.45 from 203.169.8.45 (61.211.160.151)
          Origin IGP, localpref 100, valid, external
          Community: 65001:0 no-export
    Thanks

    Hi,
    On cisco routers , weight is having highest preference to decide best path. By default for received route, weight is 0 but you are setting weight 90 to backup path and that is why it is getting preferred (higher is better). Please remove weight and let local preference be 90 (lesser than route on primary path)
    --Pls dont forget to rate helpful posts--
    Regards,
    Akash

  • Certificate selection problem in Safari

    Hi ,
    I have certifcates A,B,C,D for the same site , whenever i use the Mozilla it is asking which one to select , but somehow i dont know why Safari is asking the same option.
    It is forcing me to accept Certifcate A to that paricular site. How to solve this problem in safari.
    Regards
    Vikranth

    Hello. I feel your pain and frustration with the print selection problem in safari, especially in Snow Leopard. I have spent hours trawling help pages and forums etc. BUT YEE HAA (sorry got a bit excited, but it really was hours) I found the answer. So here goes.
    Click on Safari
    Scroll down to services then slide to right
    Scroll down to services preferences and click
    Scroll down to the Text section
    If you Tick the Text box it will choose all options for you. Or if you don't want all options in the Text list, then untick Text box and tick options you do want.
    BUT for your print selection problem make sure you tick NEW TEXT EDIT WINDOW CONTAINING SELECTION.
    Then when you want to select something in a web page you want to print (including pictures etc) then highlight it, then Right click. And low and behold, in the list is NEW TEXT EDIT WINDOW CONTAINING SELECTION. Click that, Then press cmd+p and your printing.
    I really hope that helps with your problem
    I can now go to sleep.

  • Selection problem on ADRC Table.

    Dear Exparts.
    please see the Query:
    select country city1 from adrc
      into CORRESPONDING FIELDS OF wa_country
      where
    country = p_country
      and
    city1 = p_city.
      append wa_country to it_country.
      endselect.
    In this selection, when I send p_country = AE and p_city = Dubai I cannot get any data. But there have data In DB.
    But when I send p_country = DE and p_city = Berlin I can get porper data.
    Can anybody solve this problem.
    Your regards
    rayhan

    Just paste the below code and check either getting value or not
    DATA wa_country TYPE adrc.
    PARAMETERS: p_city TYPE adrc-city1 DEFAULT 'Dubai',
                p_countr TYPE adrc-country DEFAULT 'AE'.
    SELECT SINGLE * FROM adrc INTO wa_country WHERE country = p_countr
    AND city1 = p_city.
    IF sy-subrc = 0.
      WRITE : / wa_country-city1, / wa_country-country.
    ENDIF.
    Kanagaraja L

  • Selection problem in JTable

    Hello everyone,
    I've a JTable,which I'm rendering using my own renderer.When the background of any cell within the table is rendered,that particular row does not get highlighted on mouseclick.However,when only the foreground is set (without setting the background),the row is highlighted.Can anyone suggest anything on this problem.I want the row to be highlighted on mouse click even if the background of the cell is rendered.
    thanx in advance.
    J.C

    Maybe u can use this, but you might want to extend your cell renderer.
    [qouote from API docs]
    setSelectionBackground
    public void setSelectionBackground(Color selectionBackground)
    Sets the background color for selected cells. Cell renderers can use this color to the fill selected cells.
    The default value of this property is defined by the look and feel implementation.

  • Selection problem in a JList !!!!

    I am using a JList and on the selection of an item in this JList - I enable and disable some buttons.
    I have currenlty added a ListSelectionListener that allows me to trap the valuechanged event and thus if any item in the list is selected / deselected, i can enable/ disable the buttons.
    Now the abuv works fine with click and Ctrl clicking (to deselect),
    However if i come into the JList from another control (a JCombo) by tabbing and then use the arrow keys once the control is in the JList, the up and down arrow keys allow me to change the selection in the list.
    But, the valueChanged event does not come in the above case and hence the buttons do not enable/disable !!!
    Can you tell me what can be the problem?????

    Add a key listener and handle the KeyEvent
    Sachin

  • Selection problem in rendered JtextArea.

    I create a jtable by rendering one column using jTextarea. While selecting the row, color of selection not geting to the rendered Jtextarea. How can i solve this problem.
    please help me

    Do you include code in your getTableCellRendererComponent method to change
    the color depending on if the row is selected or not? You'll need something like
         if ( isSelected ) {
              setForeground( table.getSelectionForeground() );
              setBackground( table.getSelectionBackground() );
         } else {
              setForeground( table.getForeground() );
              setBackground( table.getBackground() );
         }: jay

  • Selection problem in JTextArea

    hi all
    i have a TextArea in which i have some coded charecters in a group of ten charactes i treet these ten characters as a single character ,so when i delete or insert these charactes all these charactes r deleted and no other character r inserted in between , i do it with the caretListener,
    But the problem which i face is on the selection i want to select these characters as when we select some part of the URL then it is selected completely.
    help in the prob.

    this might work
    paste some text into the textArea (ensure it contains a sequence "12345")
    click anywhere in area of 12345
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    class Testing extends JFrame
      String specialChars = "12345";
      boolean settingCaret = false;
      public Testing()
        setSize(200,200);
        setLocation(300,200);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        final JTextArea ta = new JTextArea(10,10);
        JScrollPane sp = new JScrollPane(ta);
        sp.setPreferredSize(new Dimension(175,150));
        JPanel jp = new JPanel();
        jp.add(sp);
        getContentPane().add(jp);
        pack();
        ta.addCaretListener(new CaretListener(){
          public void caretUpdate(CaretEvent ce){
            if(settingCaret == false)
              int startPos = ta.getText().indexOf(specialChars);
              if(startPos > -1)
                if(ta.getCaretPosition() >= startPos && ta.getCaretPosition() <= startPos+specialChars.length())
                  settingCaret = true;
                  ta.setSelectionStart(startPos);
                  ta.setSelectionEnd(startPos+specialChars.length());
                settingCaret = false;
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • Selection problem with JFormattedTextField

    I encounter a problem to select the content of a JFormattedTextField.
    Here is a class for a dialog containing 2 JFormattedTextFields :
    * Created on 7 juin 2005
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package cimpa.smartndtkit.dialog;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.FocusAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.text.DecimalFormat;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    import cimpa.smartndtkit.utilities.Texts;
    import cimpa.smartndtkit.utilities.basic_classes.MyButton;
    import cimpa.smartndtkit.utilities.basic_classes.MyFormattedTextField;
    import cimpa.smartndtkit.utilities.basic_classes.MyLabel;
    import cimpa.smartndtkit.utilities.basic_classes.MyPanel;
    * @author st08051
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    public class ChangePaletteLimitsDialog extends MyDialog {
         private boolean isOK = false;
         private float minValue, maxValue;
         private MyButton bOK, bCancel;
         private MyFormattedTextField txtMin, txtMax;
         public ChangePaletteLimitsDialog(JFrame parent, float minValue, float maxValue){
              super(parent, "Modification des limites", true);
              setResizable(false);
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              getContentPane().setLayout(new GridBagLayout());
              /** Constantes */
              Insets leftComponentInsets = new Insets(15,30,0,5);
              Insets rightComponentInsets = new Insets(15,5,0,30);
              Insets buttonsInsets = new Insets(8,5,8,5);
              int txtWidth = 60;
              int txtHeight = 22;
              DecimalFormat format = Texts.formatFactory("###0.###");
              /** Cr�ation des composants */
              MyLabel labelMin = new MyLabel("Valeur minimale :");          
              txtMin = new MyFormattedTextField(format);
              txtMin.setHorizontalAlignment(JTextField.RIGHT);
              txtMin.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
              txtMin.setSizes(txtWidth, txtHeight);
              txtMin.setText(""+minValue);
    //          txtMin.setValue(new Float(minValue));
              txtMin.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent ke) {
                        keyPressed_actionPerformed(ke);
              txtMin.addFocusListener(new FocusAdapter() {
                   public void focusGained(FocusEvent arg0) {
                        txtMin.selectAll();
    //               public void focusLost(FocusEvent arg0) {
    //          txtMin.addActionListener(new ActionListener() {
    //               public void actionPerformed(ActionEvent arg0) {
    //                    txtMin.selectAll();
              MyLabel labelMax = new MyLabel("Valeur maximale :");
              txtMax = new MyFormattedTextField(format);
              txtMax.setHorizontalAlignment(JTextField.RIGHT);
              txtMax.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
              txtMax.setSizes(txtWidth, txtHeight);
              txtMax.setText(""+maxValue);
    //          txtMax.setValue(new Float(maxValue));
              txtMax.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent ke) {
                        keyPressed_actionPerformed(ke);
              txtMax.addFocusListener(new FocusAdapter() {
                   public void focusGained(FocusEvent arg0) {
                        txtMax.selectAll();
    //               public void focusLost(FocusEvent arg0) {
    //          txtMax.addActionListener(new ActionListener() {
    //               public void actionPerformed(ActionEvent arg0) {
    //                    txtMax.selectAll();
              MyPanel panel = new MyPanel();
              bOK = new MyButton("OK");
              bOK.setSizes(60,25);
              bOK.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent ae) {
                        bOK_actionPerformed();
              bCancel = new MyButton("Annuler");
              bCancel.setSizes(60,25);
              bCancel.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent ae) {
                        bCancel_actionPerformed();
              /** Contraintes */
              GridBagConstraints constraints = new GridBagConstraints();
              constraints.anchor = GridBagConstraints.CENTER;
              /** Agencement des composants */
              constraints.gridx = 1;
              constraints.gridy = 0;
              constraints.gridwidth = 2;
              constraints.insets = leftComponentInsets;
              getContentPane().add(labelMin, constraints);
              constraints.gridx = 3;
              constraints.insets = rightComponentInsets;
              getContentPane().add(txtMin, constraints);
              constraints.gridx = 1;
              constraints.gridy = 1;
              constraints.insets = leftComponentInsets;
              getContentPane().add(labelMax, constraints);
              constraints.gridx = 3;
              constraints.insets = rightComponentInsets;
              getContentPane().add(txtMax, constraints);
              constraints.gridx = 0;
              constraints.gridy = 0;
              constraints.gridwidth = 1;
              constraints.insets = buttonsInsets;
              panel.add(bOK, constraints);
              constraints.gridx = 1;
              panel.setLayout(new GridBagLayout());
              panel.add(bCancel, constraints);
              constraints.gridx = 0;
              constraints.gridy = 3;
              constraints.gridwidth = 6;
              constraints.anchor = GridBagConstraints.CENTER;
              getContentPane().add(panel, constraints);
              this.pack();
              setLocationRelativeTo(parent);
              txtMin.requestFocus();
    //          getRootPane().setDefaultButton(bOK);
              setVisible(true);
          * @return
         public boolean isOK() {
              return isOK;
         public void bOK_actionPerformed(){
              isOK=true;
              minValue = new Float(txtMin.getText()).floatValue();
              maxValue = new Float(txtMax.getText()).floatValue();
              dispose(); //st11870 : � faire en dehors ou l�?
         public void bCancel_actionPerformed(){
              escapeActionPerformed();
         private void keyPressed_actionPerformed(KeyEvent ke) {
              if (ke.getKeyChar() == KeyEvent.VK_ESCAPE) {
                   escapeActionPerformed();
              else if (ke.getKeyChar() == KeyEvent.VK_ENTER) {
                   bOK_actionPerformed();
         protected void escapeActionPerformed() {
              isOK=false;
              dispose();
         public float getMaxValue() {
              return maxValue;
         public float getMinValue() {
              return minValue;
    }The problem is that the first time I pass through a textfield, it selects its content. But once, it has been selected, it can't be selected anymore...
    And if I make a setValue() during the initialization, it cannot be selected at all!
    Does anyone know how to fix this?
    Thanks!

    Should work now...
    package cimpa.smartndtkit.dialog;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.FocusAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.text.DecimalFormat;
    import javax.swing.JFrame;
    import javax.swing.JTextField;
    public class ChangePaletteLimitsDialog extends JDialog {
         private boolean isOK = false;
         private float minValue, maxValue;
         private JButton bOK, bCancel;
         private JFormattedTextField txtMin, txtMax;
         public ChangePaletteLimitsDialog(JFrame parent, float minValue, float maxValue){
              super(parent, "Modification des limites", true);
              setResizable(false);
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              getContentPane().setLayout(new GridBagLayout());
              /** Constantes */
              Insets leftComponentInsets = new Insets(15,30,0,5);
              Insets rightComponentInsets = new Insets(15,5,0,30);
              Insets buttonsInsets = new Insets(8,5,8,5);
              int txtWidth = 60;
              int txtHeight = 22;
              DecimalFormat format = formatFactory("###0.###");
              /** Cr�ation des composants */
              JLabel labelMin = new JLabel("Valeur minimale :");          
              txtMin = new JFormattedTextField(format);
              txtMin.setHorizontalAlignment(JTextField.RIGHT);
              txtMin.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
              txtMin.setSize(txtWidth, txtHeight);
              txtMin.setText(""+minValue);
    //          txtMin.setValue(new Float(minValue));
              txtMin.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent ke) {
                        keyPressed_actionPerformed(ke);
              txtMin.addFocusListener(new FocusAdapter() {
                   public void focusGained(FocusEvent arg0) {
                        txtMin.selectAll();
    //               public void focusLost(FocusEvent arg0) {
    //          txtMin.addActionListener(new ActionListener() {
    //               public void actionPerformed(ActionEvent arg0) {
    //                    txtMin.selectAll();
              JLabel labelMax = new JLabel("Valeur maximale :");
              txtMax = new JFormattedTextField(format);
              txtMax.setHorizontalAlignment(JTextField.RIGHT);
              txtMax.setAlignmentX(JTextField.RIGHT_ALIGNMENT);
              txtMax.setSize(txtWidth, txtHeight);
              txtMax.setText(""+maxValue);
    //          txtMax.setValue(new Float(maxValue));
              txtMax.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent ke) {
                        keyPressed_actionPerformed(ke);
              txtMax.addFocusListener(new FocusAdapter() {
                   public void focusGained(FocusEvent arg0) {
                        txtMax.selectAll();
    //               public void focusLost(FocusEvent arg0) {
    //          txtMax.addActionListener(new ActionListener() {
    //               public void actionPerformed(ActionEvent arg0) {
    //                    txtMax.selectAll();
              JPanel panel = new JPanel();
              bOK = new JButton("OK");
              bOK.setSize(60,25);
              bOK.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent ae) {
                        bOK_actionPerformed();
              bCancel = new JButton("Annuler");
              bCancel.setSize(60,25);
              bCancel.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent ae) {
                        bCancel_actionPerformed();
              /** Contraintes */
              GridBagConstraints constraints = new GridBagConstraints();
              constraints.anchor = GridBagConstraints.CENTER;
              /** Agencement des composants */
              constraints.gridx = 1;
              constraints.gridy = 0;
              constraints.gridwidth = 2;
              constraints.insets = leftComponentInsets;
              getContentPane().add(labelMin, constraints);
              constraints.gridx = 3;
              constraints.insets = rightComponentInsets;
              getContentPane().add(txtMin, constraints);
              constraints.gridx = 1;
              constraints.gridy = 1;
              constraints.insets = leftComponentInsets;
              getContentPane().add(labelMax, constraints);
              constraints.gridx = 3;
              constraints.insets = rightComponentInsets;
              getContentPane().add(txtMax, constraints);
              constraints.gridx = 0;
              constraints.gridy = 0;
              constraints.gridwidth = 1;
              constraints.insets = buttonsInsets;
              panel.add(bOK, constraints);
              constraints.gridx = 1;
              panel.setLayout(new GridBagLayout());
              panel.add(bCancel, constraints);
              constraints.gridx = 0;
              constraints.gridy = 3;
              constraints.gridwidth = 6;
              constraints.anchor = GridBagConstraints.CENTER;
              getContentPane().add(panel, constraints);
              this.pack();
              setLocationRelativeTo(parent);
              txtMin.requestFocus();
    //          getRootPane().setDefaultButton(bOK);
              setVisible(true);
          * @return
         public boolean isOK() {
              return isOK;
         public void bOK_actionPerformed(){
              isOK=true;
              minValue = new Float(txtMin.getText()).floatValue();
              maxValue = new Float(txtMax.getText()).floatValue();
              dispose();
         public void bCancel_actionPerformed(){
              escapeActionPerformed();
         private void keyPressed_actionPerformed(KeyEvent ke) {
              if (ke.getKeyChar() == KeyEvent.VK_ESCAPE) {
                   escapeActionPerformed();
              else if (ke.getKeyChar() == KeyEvent.VK_ENTER) {
                   bOK_actionPerformed();
         protected void escapeActionPerformed() {
              isOK=false;
              dispose();
         public float getMaxValue() {
              return maxValue;
         public float getMinValue() {
              return minValue;
         public static DecimalFormat formatFactory(String pattern){
              DecimalFormat format = new DecimalFormat(pattern);
              DecimalFormatSymbols dfs = new DecimalFormatSymbols();
              dfs.setDecimalSeparator('.');
              format.setDecimalFormatSymbols(dfs);
              return format;
    }

  • Selection problem with my JList

    Ok the problem is when i write this:
    myJlist.setEnabled(false);
    i set now the list in light grey but i can still select it someone knows why? Or i'm crazy :P

    After thorough investigation, yes, you are crazy!!!

  • Selection problem on click-to-edit multiple select table

    We have a af:table with following properties:
    - rowSelection="multiple"
    - editingMode ="clickToEdit"
    If you click on a row to select it, then scroll down so new data is being fetched, then press shift and click on an other row (to select multiple rows), only the last row is selected.
    Did anybody have the same problem? How can it be fixed?
    Version: 11.1.1.6.0

    I've been looking into this issue.
    If you click on the first row to select it, then scroll down to the last row so new data is being fetched, then press shift and click on an other row (to select multiple rows), only the last row is selected.
    This behavior can be reproduced in a simple ADF Table based on the Employees Table.
    In both 11.1.1.6 and 11.1.1.7 the first row and the last row are selected. All rows in between are not.
    If you surround the table with a panelCollection, the footer of the panelCollection shows "1 row selected".
    However, in getSelectedRowKeys() all keys are present. Looks like the rows are being selected but the UI does not reflect this !
    Very annoying for end users.
    If I change clickToEdit to editAll it works perfectly and all selected rows are highlighted.
    The footer of the panelCollection shows "107 rows selected".
    Looks like a bug right ?

  • Joining/Selection problem...

    I have created this view:
    - First it selects the Lowest and Highest date which should be taken in DATES
    - Then it selects every first of the month between the Lowest and Highest date and stores that in MONTHS
    - Then it selects the ID, FirstOfTheMonth, (intakes UP TO FirstOfTheMonth), (Outgoing UP TO FirstOfTheMonth) from TWO tables without matching any id field...
    Now If I run the view in SQL Developer, it works nicely. If I use the view in Crystal Reports i get an error message saying a subquery returns more than 1 row...
    I have a feeling that my CALCULATIONS table is wrongly setup. The problem is that I need to select the PNM_AUTO_KEY from Parts_master and use this Key in the two subqueries... The way i did that is probably wrong.... My guessing is I should use a OUTER JOIN in stead of the way I did it now...?_
    CREATE OR REPLACE FORCE VIEW "VIEW_STOCK_COUNT" ("PNM_AUTO_KEY", "COUNT_DATE", "QTY_RECEIVED", "QTY_USED", "QTY_BALANCE") AS
    with
    DATES as
    (select (select min(REC_DATE) from STOCK) as FROM_DT, (select max(CHANGE_DATE) from STOCK_ADJUST) as TO_DT from DUAL),
    MONTHS as
    (select add_months(trunc(FROM_DT,'MM'),ROWNUM-1) as DT from DATES connect by ROWNUM <= months_between(TO_DT, FROM_DT)+1),
    CALCULATIONS as
    (select
    PNM.PNM_AUTO_KEY PNM_KEY,
    MONTHS.DT DT,
    NVL((select sum(stm.qty_rec) from stock stm WHERE STM.REC_DATE < MONTHS.DT AND STM.PNM_AUTO_KEY = PNM.PNM_AUTO_KEY GROUP BY pnm_auto_key),0) INCOMING,
    NVL((select sum(saj.qty_adj) from stock_adjust saj
    inner join stock stm on saj.stm_auto_key = stm.stm_auto_key
    inner join parts_master pnm on stm.pnm_auto_key = pnm.pnm_auto_key where SAJ.CHANGE_DATE < MONTHS.DT AND STM.PNM_AUTO_KEY = PNM.PNM_AUTO_KEY group by pnm_auto_key),0) OUTGOING
    from MONTHS, PARTS_MASTER PNM)
    SELECT
    CALCULATIONS.PNM_KEY PNM_AUTO_KEY, CALCULATIONS.DT COUNT_DATE,CALCULATIONS.INCOMING QTY_RECEIVED, CALCULATIONS.OUTGOING QTY_USED, (CALCULATIONS.INCOMING + CALCULATIONS.OUTGOING) QTY_BALANCE
    FROM
    CALCULATIONS;

    Hi,
    user574699 wrote:
    I have created this view:
    - First it selects the Lowest and Highest date which should be taken in DATES
    - Then it selects every first of the month between the Lowest and Highest date and stores that in MONTHS
    - Then it selects the ID, FirstOfTheMonth, (intakes UP TO FirstOfTheMonth), (Outgoing UP TO FirstOfTheMonth) from TWO tables without matching any id field...
    Now If I run the view in SQL Developer, it works nicely. If I use the view in Crystal Reports i get an error message saying a subquery returns more than 1 row...
    Sorry, I don't know anything about Crystal Reports. I would expect the view to be handled entirely by the database. What is the query that you're running when you get the error?
    Will Crystal Reports run a very simple query on this view?
    I have a feeling that my CALCULATIONS table is wrongly setup. The problem is that I need to select the PNM_AUTO_KEY from Parts_master and use this Key in the two subqueries... The way i did that is probably wrong.... My guessing is I should use a OUTER JOIN in stead of the way I did it now...?_That's easy to test. Replace the scalar sub-queries with literals, and see if Crystal Reports will run it.
    If not, that's not the problem.
    If you do decide to re-write the calculations sub-query, and you need help, post some sample data and what calculations should contain given that data.
    Could the WITH-clause be causing the problem? (Again, it's hard to see why the front-end tool would care how the view was defined.)
    It looks like you could use in-line views instead of WITH, if necessary.
    CREATE OR REPLACE FORCE VIEW "VIEW_STOCK_COUNT" ("PNM_AUTO_KEY", "COUNT_DATE", "QTY_RECEIVED", "QTY_USED", "QTY_BALANCE") AS
    with
    DATES as
    (select (select min(REC_DATE) from STOCK) as FROM_DT, (select max(CHANGE_DATE) from STOCK_ADJUST) as TO_DT from DUAL),
    MONTHS as
    (select add_months(trunc(FROM_DT,'MM'),ROWNUM-1) as DT from DATES connect by ROWNUM <= months_between(TO_DT, FROM_DT)+1),
    CALCULATIONS as
    (select
    PNM.PNM_AUTO_KEY PNM_KEY,
    MONTHS.DT DT,
    NVL((select sum(stm.qty_rec) from stock stm WHERE STM.REC_DATE < MONTHS.DT AND STM.PNM_AUTO_KEY = PNM.PNM_AUTO_KEY GROUP BY pnm_auto_key),0) INCOMING,
    NVL((select sum(saj.qty_adj) from stock_adjust saj
    inner join stock stm on saj.stm_auto_key = stm.stm_auto_key
    inner join parts_master pnm on stm.pnm_auto_key = pnm.pnm_auto_key where SAJ.CHANGE_DATE < MONTHS.DT AND STM.PNM_AUTO_KEY = PNM.PNM_AUTO_KEY group by pnm_auto_key),0) OUTGOING
    from MONTHS, PARTS_MASTER PNM)
    SELECT
    CALCULATIONS.PNM_KEY PNM_AUTO_KEY, CALCULATIONS.DT COUNT_DATE,CALCULATIONS.INCOMING QTY_RECEIVED, CALCULATIONS.OUTGOING QTY_USED, (CALCULATIONS.INCOMING + CALCULATIONS.OUTGOING) QTY_BALANCE
    FROM
    CALCULATIONS;Don't post unformatted code

Maybe you are looking for

  • How can I open links from mail in the background?

    I receive a lot of digest emails with lots of links. I would like to be able to click all of the links in a given email, have Safari open those pages in the background, and then when I'm done selecting the links I can switch to Safari and read them a

  • HT201303 how can i change my security question to a new one

    How can I change my sercurity question to a new?

  • What Compressor Settings for the web?

    I have a 1min40 sequence with the Settings: PAL, Frame Size: 1280x720, 25fps, Compressor HDV720p25. What Compressor Settings would you recommend please: 1) to put it in a website 2) for Broadcast: would Apple ProRes HQ be a good choice? Thanks in adv

  • Navigation Attributes & Planning Characteristics

    Hi, We plan to maintain some of the characteristics as Navigation Attributes. We understand that there are performance issues if we use navigation attributes in planning area. I have a query: If we do not navigate data based on navigation attribute i

  • TURNING OFF UNSAFE WARNING MESSAGE

    Hi Can anyone help, i need to turn off a message that comes up in Powerpoint in the Mac, when i link 2 presentations together i get a warning message - Potentially Unsafe Do You Want To Continue ? i can click it but it looks poor when you are present