ENTER instead of pressing a JButton

Currently I add text from a JTextField into a JTextArea when I press a JButton.
Now I want this also when I press the ENTER-button instead of clicking on the JButton.
How does this work?

HI,
Hope this piece of code will help :
yourButton.registerKeyboardAction(
new ButtonEnterKeyListener,
KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false),
JComponent.WHEN_FOCUSED);
* Causes any Button it is attached to to respond to the Enter Key
* selection.
private class ButtonEnterKeyListener implements ActionListener
public void actionPerformed(ActionEvent event)
Object source = event.getSource();
if (source instanceof AbstractButton)
AbstractButton button = (AbstractButton) source;
if (button.isEnabled())
button.doClick();
Hope this helps
--j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Default button being clicked multiple times when enter key is pressed

    Hello,
    There seems to be a strange difference in how the default button behaves in JRE 1.4.X versus 1.3.X.
    In 1.3.X, when the enter key was pressed, the default button would be "pressed down" when the key was pressed, but wouldn't be fully clicked until the enter key was released. This means that only one event would be fired, even if the enter key was held down for a long time.
    In 1.4.X however, if the enter key is pressed and held for more than a second, then the default button is clicked multiple times until the enter key is released.
    Consider the following code (which is just a dialog with a button on it):
    public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
    private JButton jButton1 = new JButton("button");
    public SimpleDialog()
    this.getContentPane().add(jButton1);
    this.getRootPane().setDefaultButton(jButton1);
    jButton1.addActionListener(this);
    this.pack();
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == jButton1)
    System.out.println("button pressed");
    public static void main(String[] args)
    new SimpleDialog().show();
    When you compile and run this code under 1.3.1, and hold the enter key down for 10 seconds, you will only see one print line statement.
    However, if you compile and run this code under 1.4.1, and then hold the enter key down for 10 seconds, you will see about 100 print line statements.
    Is this a bug in 1.4.X or was this desired functionality (e.g. was it fixing some other bug)?
    Does anyone know how I can make it behave the "old way" (when the default button was only clicked once)?
    Thanks in advance if you have any advice.
    Dave

    Hello all,
    I think I have found a solution. The behaviour of the how the default button is triggered is contained withing the RootPaneUI. So, if I override the default RootPaneUI used by the UIDefaults with my own RootPaneUI, I can define that behaviour for myself.
    Here is my simple dialog with a button and a textfield (when the focus is NOT on the button, and the enter key is pressed, I don't want the actionPerformed method to be called until the enter key is released):
    package focustests;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
    private JButton jButton1 = new JButton("button");
    public SimpleDialog()
    this.getContentPane().add(new JTextField("a text field"), BorderLayout.NORTH);
    this.getContentPane().add(jButton1, BorderLayout.SOUTH);
    this.getRootPane().setDefaultButton(jButton1);
    jButton1.addActionListener(this);
    this.pack();
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == jButton1)
    System.out.println("button pressed");
    public static void main(String[] args)
    javax.swing.UIManager.getDefaults().put("RootPaneUI", "focustests.MyRootPaneUI");
    new SimpleDialog().show();
    and the MyRootPaneUI class controls the behaviour for how the default button is handled:
    package focustests;
    import javax.swing.*;
    * Since we are using the Windows look and feel in our product, we should extend from the
    * Windows laf RootPaneUI
    public class MyRootPaneUI extends com.sun.java.swing.plaf.windows.WindowsRootPaneUI
    private final static MyRootPaneUI myRootPaneUI = new MyRootPaneUI();
    public static javax.swing.plaf.ComponentUI createUI(JComponent c) {
    return myRootPaneUI;
    protected void installKeyboardActions(JRootPane root) {
    super.installKeyboardActions(root);
    InputMap km = SwingUtilities.getUIInputMap(root,
    JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (km == null) {
    km = new javax.swing.plaf.InputMapUIResource();
    SwingUtilities.replaceUIInputMap(root,
    JComponent.WHEN_IN_FOCUSED_WINDOW, km);
    //when the Enter key is pressed (with no modifiers), trigger a "pressed" event
    km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
    0, false), "pressed");
    //when the Enter key is released (with no modifiers), trigger a "release" event
    km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
    0, true), "released");
    ActionMap am = SwingUtilities.getUIActionMap(root);
    if (am == null) {
    am = new javax.swing.plaf.ActionMapUIResource();
    SwingUtilities.replaceUIActionMap(root, am);
    am.put("press", new HoldDefaultButtonAction(root, true));
    am.put("release", new HoldDefaultButtonAction(root, false));
    * This is a copy of the static nested class DefaultAction which was
    * contained in the JRootPane class in Java 1.3.1. Since we are
    * using Java 1.4.1, and we don't like the way the new JRE handles
    * the default button, we will replace it with the old (1.3.1) way of
    * doing things.
    static class HoldDefaultButtonAction extends AbstractAction {
    JRootPane root;
    boolean press;
    HoldDefaultButtonAction(JRootPane root, boolean press) {
    this.root = root;
    this.press = press;
    public void actionPerformed(java.awt.event.ActionEvent e) {
    JButton owner = root.getDefaultButton();
    if (owner != null && SwingUtilities.getRootPane(owner) == root) {
    ButtonModel model = owner.getModel();
    if (press) {
    model.setArmed(true);
    model.setPressed(true);
    } else {
    model.setPressed(false);
    public boolean isEnabled() {
    JButton owner = root.getDefaultButton();
    return (owner != null && owner.getModel().isEnabled());
    This seems to work. Does anyone have any comments on this solution?
    Tjacobs, I still don't see how adding a key listeners or overriding the processKeyEvent method on my button would help. The button won't receive the key event unless the focus is on the button. There is no method "enableEvents(...)" in the AWTEventMulticaster. Perhaps you have some code examples? Thanks anyway for your help.
    Dave

  • Keyboad without numeric keypad - How to produce "enter" instead of "return"

    Sorry, no forum on keyboards, so I used this one ... Sometimes, "enter" and "return" has the same effect but in certain circumstances they don't. For instance, in Excel, in a cell "enter" will paste what you've copy, "return" will change the current cell. Sorry for this silly question but how do you get "enter" instead of "return" on the little keyboard with no numeric keypad ???

    I'm not sure if this answers your question...
    In Excel, pressing enter or return will only paste data if the CutCopy mode is active (or true), having just cut or copied data from a cell; in other words the clipboard has data waiting to paste.
    Moving from one cell to another when pressing enter is an option that can be set by the user.
    Pressing the single enter/return key will do both but it depends on the previous action performed, if any.
    That said, I create VBA excel programs using a laptop exclusively and notice no difference in the singe enter/return key.

  • Only 0 serial numbers entered instead of 30

    Hi Experts,
    I am facing one problem during Usage decision in QA32 TRANSACTION,
    After saving the Usage decision , the system saying that +'Only 0 serial numbers entered instead of 30'+,
    due to that i am unable to save the usage decision so that goods are not moving from Quality block to unrestricted stocks,
    Inception type is 1 in QM set up view, Inspection type 03  is extra added which is not required for this material, is it causing any problem ?.
    I have tried to remove this 03 Inspection type but system not allowing as there are stocks exists,
    Work scheduling and Gen Plant 1/2 storage view also activated by mistakenly for this material, in these views Serial profile is assigned, which is not there for previous plant ( Rolled out to new plant), now the problem is with new plant material inspection lots, not for all, few of the lots are creating the problem(Only 0 serial numbers entered instead of 30)
    I have tried to send the material return to Vendor from Quality block but not success in that,
    Can I deactivate views,
    Can problem be solved If i remove the Serial number profile 
    Can I delete inspection type 03 from the material master QM set up view
    Can anybody suggest how to trouble shoot the problem
    Thanks in advance !!

    First check whether serial numbers are attached to the inspection lot or not.
    Please check the configuration of the serial number profile in transaction code OIS2.
    Yes problem can be solved by Turn off serial number profile
    refer
    Serial Numbers in QA11 Record Usage Decision

  • Keydown method to enter on key presses issue

    I can't ever get the keydown method to enter on key presses
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/halo"  width="100%" height="100%" >
        <s:keyDown>
            <![CDATA[
            if (event.charCode == Keyboard.ESCAPE)
            //show the button if leaving full screen
            if(fullScreenState == StageDisplayState.FULL_SCREEN){
            toggleFullScreen();
            ]]>
        </s:keyDown>

    Hi,
    I think there is anther way. like
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/halo"  width="100%" height="100%"  keyDown="application1_keyDownHandler(event)">
    <fx:Script>
            <![CDATA[
                protected function application1_keyDownHandler(event:KeyboardEvent):void
                    // your code
            ]]>
        </fx:Script>
    </s:Application>

  • Pressing enter instead of clicking on a button

    Hey all, this is rather simple but the search term 'enter' is very common so i'm having a hard time searching for my solution!
    I'm basically writing a search program that finds customers, at the moment I have a screen where the user types in a name then clicks on a button I have which executes the search.
    I'd like to be able to have it search by pressing enter as well as being able to click on the button.
    I tried debugging to see what the sy-ucomm was when I pressed enter but apparently that doesn't change.
    Can anyone direct me to what I should be researching to implement this?
    Just a few basics to get me on my way would be great,
    Thanks

    Hi Mate
    In your PAI okcode module you can include '/00' or 'ENTE' to capture the enter keypress. 
    This will solve your problem.
    Regards
    Gareth

  • When the printer dialog shows up is there a way to print by pressing enter instead of using the mouse?

    Right now, I have to click with the mouse: I don't have to do in in Firefox: Just press enter!

    I just tried it in Thunderbird and it worked for me.
    Try holding the shift key while you start Thunderbird to disable add-ons and see if that could be the cause.

  • Why do I have to click the green arrow on the location bar instead of pressing ENTER to prompt the new webpage to load?

    When entering a web page (e.g., www.aol.com) I would normally hit the ENTER key on my keyboard and the aol webpage would open. However, using Firefox 4.0.1 on my desktop, I have to enter the webpage (e.g., www.aol.com) and then use the mouse to right-click on the green arrow tab located to the right of the location bar. This is not the case on my wife's laptop, however. And she is using the same version of Firefox.

    This was very very helpful and I resolved the issue. The problem ended up being an extension from my AVG firewall that I had to disabled, once I disabled the ext Firefox worked properly again.

  • Code to call a function when enter key is pressed

    hi all,
    In a table control program i need to call a function when i press enter key...
    but im not able to do that since the function is always called when i press a push button on the screen.... can any one help me in this.. please....

    Hi John,
          You are not getting any value in SY-UCOMM when you press "Enter",because the function code is not set for 'Enter" key in "Function Key" of the GUI-STATUS..
    First define some fucntion code say 'ENT' for the Enter button available in "Fucntion key" of the GUI status.Once you done and activate the program and test it.The function code which u defined will be coming to SY-UCOMM field when you press 'ENTER" button and you can handle the various fucntionality whichevcer you want on "ENTER" .
    Eg:
    case sy-ucomm.
    When 'ENT'.
    Endcase.
    Regards,
    Vigneswaran S

  • Process PBO and PAI when Enter key is pressed

    Hello everyone,
    I am making a program where there is a I/O Box component. When the user enters data in this field and hits the 'ENTER' key I want to process the PBO and the PAI of that screen.
    The problem is what should i assign in the ok_code for this?
    Please advise.
    Thanks in advance,
    Karan

    >
    Karan Kappal wrote:
    > Hello everyone,
    > I am making a program where there is a I/O Box component. When the user enters data in this field and hits the 'ENTER' key I want to process the PBO and the PAI of that screen.
    > The problem is what should i assign in the ok_code for this?
    >
    > Please advise.
    >
    > Thanks in advance,
    > Karan
    You want to Go when user Press enter.
    In PBO we will set the status,
    SET PF-STATUS 'STATUS'. " double click on it or Go to SE41
    here activate the Function code for the ENTER button.
    in the FUnction keys you can see in the Beginning First Function (Green Tick mark) Give the Function code say ENTER , and give all necessary details and Activate .
    Now Test your application.
    When your enter the data and press enter, First it Goes to PAI
    here you do what ever required based on the action code...
    in PAI
    case ok_code.
    when 'ENTER'.
    "your code here...
    endcase.
    and once it is done, Control backs to PBO ..

  • Enter instead of Tab

    Hi.
    Tell me, please,
    I need to replace pressing Enter on pressing TAB.
    How best to do this using the ADF?
    (I need to move between the components by pressing the enter key)
    Thanks.

    User, please tell us your jdev Version!
    You can use javascript for this. Write a function which exchange the enter key with the tab key. This method you call from each text field. A smoke for such a method you find here
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/march2011-otn-harvest-351896.pdf
    Look for 'How-to filter table filter input to only allow numeric input' in the doc.
    You have to change the method to your needs but get the picture.
    Timo

  • Editable ALV - handling Enter key  when pressing enter on keyboard

    Hi folks.
    Now I have searched - and found a lot of threads - in this forum about my little problem.
    I'm using the <b>Function Module: REUSE_ALV_GRID_DISPLAY - NOT THE OO-version</b>!!!!!
    I have a editable list as result of finding some data. My problem is.
    When I change the value in one of the cells, and press the Enter key (not a click with the mouse on the Green button with the checkmark!) nothing happens!
    I have
        i_callback_pf_status_set  = 'SET_PF_STATUS'
        i_callback_user_command   = 'USER_COMMAND'
    And when I put a breakpoint in the USER_COMMAND form nothing happens - <b>ONLY IF I CLIKS WITH MY MOUSE ON THE Green button with the checkmark</b>!!
    Hope U have some idea!
    Best regards
    Carsten :o)

    Hi,
    Following the sample program for EDITABLE BLOCK ALV report.
    REPORT  YMS_EDITBLOCKALV.
    TABLES : rmmg1,MCHB, mkpf.
    DATA: BEGIN OF t_mseg OCCURS 0,
            zeile LIKE mseg-zeile,
            menge LIKE mseg-menge,
            meins LIKE mseg-meins,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
            charg LIKE mseg-charg,
            bwart LIKE mseg-bwart,
    END OF t_mseg.
    DATA:BEGIN OF t_mchb OCCURS 0.
    INCLUDE STRUCTURE mchb.
    data flag type c.
    matnr LIKE mchb-matnr,
    charg LIKE mchb-charg,
    werks LIKE mchb-werks,
    clabs LIKE mchb-clabs,
    DATA END OF t_mchb.
    TYPE-POOLS slis.
    data: progname like sy-repid,
    fieldcattab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    data tabindex type i.
    data wa_matnr LIKE mchb-matnr.
    progname = sy-repid.
    SELECTION-SCREEN BEGIN OF BLOCK b_b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS s_docno FOR mkpf-mblnr OBLIGATORY.
    PARAMETERS p_docyr LIKE mkpf-mjahr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b_b1.
    START-OF-SELECTION.
    SELECT zeile
    menge
    meins
    matnr
    werks
    charg
    bwart
    FROM mseg
    INTO TABLE t_mseg
    WHERE mblnr IN s_docno AND mjahr = p_docyr.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 1.
    fieldcattab-fieldname = 'ZEILE'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Item'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 2.
    fieldcattab-fieldname = 'MENGE'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Quantity'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 3.
    fieldcattab-fieldname = 'MEINS'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Unit'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 4.
    fieldcattab-fieldname = 'MATNR'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Material'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 5.
    fieldcattab-fieldname = 'WERKS'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Plant'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 6.
    fieldcattab-fieldname = 'CHARG'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Batch No'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 7.
    fieldcattab-fieldname = 'BWART'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Inventory'.
    fieldcattab-hotspot = 'X'.
    APPEND fieldcattab.
    end-of-selection.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = PROGNAME
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USERCOMMAND1'
    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 = fieldcattab[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_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 = fieldcattab
    IT_HYPERLINK =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = t_mseg
    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.
    FORM usercommand1 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
    slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    tabindex = rs_selfield-tabindex.
    read table t_mseg INDEX tabindex.
    select * from mchb into table t_mchb where matnr = t_mseg-matnr.
    clear fieldcattab.
    CLEAR fieldcattab[].
    fieldcattab-col_pos = 1.
    fieldcattab-fieldname = 'FLAG'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Check Box'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    fieldcattab-checkbox = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 2.
    fieldcattab-fieldname = 'MATNR'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Material'.
    fieldcattab-emphasize = 'C1'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    fieldcattab-checkbox = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 3.
    fieldcattab-fieldname = 'CHARG'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Batch No'.
    fieldcattab-emphasize = 'C2'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 4.
    fieldcattab-fieldname = 'WERKS'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Plant'.
    fieldcattab-emphasize = 'C30'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 5.
    fieldcattab-fieldname = 'CLABS'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Stock'.
    fieldcattab-emphasize = 'C601'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = PROGNAME
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USERCOMMAND2'
    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 = FIELDCATTAB[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_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 =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = t_mchb
    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.
    endcase.
    endform.
    FORM usercommand2 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
    slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    IF rs_selfield-sel_tab_field = 'T_MCHB-MATNR'.
    CALL FUNCTION 'ZALV2'
    EXPORTING
    CTU = 'X'
    MODE = 'E'
    UPDATE = 'A'
    GROUP =
    USER =
    KEEP =
    HOLDDATE =
    NODATA = '/'
    MATNR_001 = '200-200'
    KZSEL_01_002 = 'X'
    IMPORTING
    SUBRC =
    TABLES
    MESSTAB =
    SET PARAMETER ID 'RID' FIELD RMMG1-MATNR.
    CALL TRANSACTION 'MM03' and skip first screen.
    ENDIF.
    ENDCASE.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = progname
    i_callback_user_command = 'USERCOMMAND3'
    it_fieldcat = fieldcattab[]
    TABLES
    t_outtab = t_mchb
    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.
    endcase.
    ENDFORM.
    Thanks,
    Sankar M

  • How do i create a GUI which links to other GUI's by pressing a JButton

    hi;
    i am trying to write a small program which reads a text file and which can update and save to the
    file as well as just view it. This i can do, but, i intend to create a main GUI from which you can
    select JButtons which will bring up different GUI's depending on which JButton has been pressed.
    i.e. one GUI for viewing certain data, another for updating the file etc....
    is this possible? and if so, how?
    cheers
    IK

    I did something similar. I had a Dialog which used the BorderLayout, the North was a title/section info, the Center part was to be changed on a button click to a different panel, the South was navigation like Next, Back, and Cancel/Finish. I got everything to work, but when I clicked the button and the method updated the center panel, it would not change to the new panel. I never figured out why it didnt do it.

  • Why I cannot tab to enter instead of using enter key?

    For example. When I want to log in a website that I have an account. After typing username and password, I can not tab  by trackpad to enter. I have to use enter key to login. Why? Have how to fix that?

    Does your cursor work? I take it this is only a problem at login. You can move the cursor,but nothing happens when you try clicking on it? Have you tried a pram reset. Command/Option/P/R keys at startup for three chimes.

  • Can I use Siri instead of pressing accept?

    My screen is broken and I can't view anything. I want to backup my phone on iTunes on a new computer, but I can't see or press the button that accepts the new computer on my phone. Can I use Siri to accept?

    No.

Maybe you are looking for

  • Convert morethan one file at a time?

    Can i convert 1000 files at a time? or want to use another service?

  • Connect String for the front end app to access Lite Database in the Client

    Hi, I have been using an app developed in VB.net for accessing the Oracle Lite Database from the client machine. Can anyone please help me out how to set the Connect String in the config file of my front end app to access the Oracle Lite Database fro

  • Currency validation

    Can anyone please help me to validate a currency input from the user, like it should not accept 1,0,0,0,0.00. appreciate your kind help......

  • Setting objects to fill the screen

    I'm trying to have my background with various color panels to sit behind text so that when I change the subject I can change the color. Also if the the text extends or shortens I would like to go in and pull up or pull or down this box to cover the e

  • Multiple key figures in a report painter or writer

    I would like to bring GL account balances  in the form of a P&L and also bring statistical key figues. I need to perform a formula of dividing the dollar value by the SKF. Is this achievable? The column in the painter does not permit more than one ke