OAF: Handling "ENTER" key

Hi,
If I have a requirement in OAF that:
I need to move the cursor to next item when the user hits the "ENTER" key on an text item, is it possible in OAF?
Please let me know.
Thanks,
Ashu.

How posting the same issue in two threads going to help ? it is not possible.
Tapash

Similar Messages

  • Handling 'enter key' event in alv using classes

    Hello all,
        i have a scenario where i have a grid from which i have to select a row and press 'enter' key, then the row would be added to grid on top of it. we have developed this grids using control and classes.
        please any one tell me how would i get the enter key code.
    Thanks,
    krishnam raju N

    HI Raju
    just go through these
    check the sample program.
    <b>BALV_POPUP_TO_SELECT
    ENTER is nothing but selecting the record.
    </b>
    Re: ALV  'ENTER' key
    and go through this code
    constants :
    C_PF_STATUS TYPE SLIS_FORMNAME VALUE 'F_SET_PF_STATUS'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = V_REPID
    I_CALLBACK_PF_STATUS_SET = C_PF_STATUS
    I_CALLBACK_USER_COMMAND = P_USER_COMMAND IS_LAYOUT = WA_LAYOUT
    IT_FIELDCAT = IT_FIELDCAT[]
    IT_EXCLUDING = IT_EXTAB[]
    IT_SORT = IT_SORT[]
    TABLES
    T_OUTTAB = P_ZBCAR50
    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.
    2.
    *& Form F_SET_PF_STATUS
    Set PF_STATUS STANDARD modifying the standard toolbar
    by excluding some buttons
    -->P_IT_EXTAB -- TABLE OF EXCLUDING FUNCTIONS
    FORM F_SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
    CLEAR : WA_EXTAB,
    IT_EXTAB.
    *--Set the Modified PF status for the ALV.
    SET PF-STATUS 'STATUS_01' EXCLUDING RT_EXTAB.
    ENDFORM. " SET_PF_STATUS
    3.
    *& Form f_user_command
    Handle user action on ALV toolbar
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    DATA : L_ANSWER TYPE C.
    RS_SELFIELD-REFRESH = C_X.
    IF R_UCOMM = 'ENTR'.
    Do your processing here.
    ENDIF
    and go through these links
    <b>how to identify pressing ENTER on ALV
    How to capture the event in ALV grid display?
    Re: ALV-Grid: No reaction to Enter-Button
    </b>
    IF IT HELPS REWARD WITH POINTS
    Regards Rk
    Message was edited by:
            Rk Pasupuleti

  • Handling Enter Key in Editable ALV Grid using REUSE_ALV_GRID_DISPLAY

    Hello All,
    I have seen a number of threads on captioned issue and everyone of them say to create FCODE for Enter in the Screen's PF Status and then handle the event.
    But the catch is when you hit Enter key in ALV Grid, it will not trigger any FCODE at all because the FCODE Enter you have created is for the screen and not for the GRID. Can anyone please let me know if SAP has given any standard utility in REUSE_ALV_GRID_DISPLAY FM for handling the Enter key event.
    Thanks and regards,
    Mahesh

    Hi,
    Set the PF-status for OK key and use the FCODE or u can usethe dynamic ok_code generated .
    Also try 'ENTE' .
    Hope thishelps.

  • Handling "enter" key while a user clicks a button being displayed in datagrid

    Hi,
    I have a datagrid of which one non editable column has an itemrenderer render a button while a row is hovered or selected. I am usinhg default tab handling of datagrid. I want to handle the button click event when a user presses enter key while the focus is on this tabbed column.
    Can anyone help me how to ahcieve this?

    This how my datagrid looks ..main file
    <?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/mx" minWidth="955" minHeight="600">
        <fx:Script>
            <![CDATA[
                import mx.controls.Alert;
                public function myKeyDownEvent(event:Event):void{
                    mx.controls.Alert.show("Selected " + myGrid.columns[0].popupIndex);
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XMLList id="transactions">
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Match</type>
                    <date>11-23-2009</date>
                    <payee>SAVINGS debit 323</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Savings</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-24-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>0</payment>
                    <deposit>20</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-23-2009</date>
                    <payee>SAVINGS debit 327</payee>
                    <payment>0</payment>
                    <deposit>10</deposit>
                    <account>My Savings</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Match</type>
                    <date>11-23-2010</date>
                    <payee>SAVINGS debit 323</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Savings</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-24-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>0</payment>
                    <deposit>20</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-23-2010</date>
                    <payee>SAVINGS debit 327</payee>
                    <payment>0</payment>
                    <deposit>10</deposit>
                    <account>My Savings</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2010</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
                <transaction>
                    <type>Unassigned</type>
                    <date>11-21-2009</date>
                    <payee>CREDITCARD debit 328</payee>
                    <payment>10</payment>
                    <deposit>0</deposit>
                    <account>My Visa</account>               
                </transaction>
            </fx:XMLList>
        </fx:Declarations>
        <mx:DataGrid id="myGrid" width="100%" height="100%" dataProvider="{transactions}" editable="true" allowMultipleSelection="true" rollOverColor="0x9BDFFA"
                     selectionColor="0x004B8D" textSelectedColor="white">
            <mx:columns>
                <mx:DataGridColumn headerText="Type" dataField="type" itemRenderer="TypeItemRenderer" editable="false"/>
                <mx:DataGridColumn headerText="Date" dataField="date" />
                <mx:DataGridColumn headerText="Payee" dataField="payee" />
                <mx:DataGridColumn headerText="Envelope" dataField="envelope" editable="false" />
                <mx:DataGridColumn headerText="Payment" dataField="payment" />
                <mx:DataGridColumn headerText="Deposit" dataField="deposit" />
                <mx:DataGridColumn headerText="Account" dataField="account" editable="false"/>
            </mx:columns>
        </mx:DataGrid>
    </s:Application>

  • How to handle 'ENTER' Key on ALV Editable Grid on sub screen (Tabstrips)

    Hello Experts ,
    I have 2 questions with ALV Editable grid;
    please help me if you have answers.
    I created ALV grid on one of sub screens on a Tab Strip,
    As soon as user types one of the columns of the ALV grid and press u2018ENTERu2019 key, it has to return corresponding details for that line.
    I tried to implement this logic in ALV grid event u2018handle_data_changedu2019, but ALV internal table is not getting populated with new entry entered in the grid. but u2018double_clicku2019 event working my purpose, but user might need enter key.
    and I thought I would do implement that logic in PAI event of the sub screen, u2018ENTERu2019 key not getting trigger on PAI event of the screen until cursor is on grid.
    Another question 2:  How do I control and not to be deleted a line on the grid (based on validation), where do I validate and by pass the delete function for a particular line, or suggest me to gray out only one line on the grid .
    I would like to have delete function to work as it is ,except for some validations..
    Can I implement using PAI event of the sub screen or any by ALV event.
    Please suggest me..
    Edited by: Ravindranath Arusam on May 13, 2010 2:42 PM

    In DATA_CHANGED event, you will get the modified row into the attribute MP_MOD_ROWS of the impoerting object ER_DATA_CHANGED. Since this MP_MOD_ROWS is the Object reference to Data, you need to have the field symbol to get the value.
      FIELD-SYMBOLS:  <lft_mod_output>  TYPE t_t_output.
      ASSIGN  er_data_changed->mp_mod_rows->* TO <lft_mod_output>.
    You can get the Value of the Cell by using the method GET_CELL_VALUE of the same ER_DATA_CHANGED object and use the method MODIFY_CELL To update the value back to ALV.
    To Restrict the row deletion:
    When the row is deleted it is being added to Attribute mt_deleted_rows of the object ER_DATA_CHANGED. You can put the data back to the table in the DATA_CHANGE_FINISHED event. Visit this post http://help-abap.blogspot.com/2008/10/alv-disable-delete-key-on-keyboard-in.html for more information.
    Regards,
    Naimesh Patel

  • Handling Enter key event in JTable

    Hi...
    This is particularly for the user "VIRAVAN"...
    I have followed your method ,and got results too.. but the
    processKeyBinding(.. method is called 4 times,same problem addressed by you before, but I didn't understood it...
    Please help me...
    Here is my code...
    protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,int condition, boolean pressed)
    System.out.println("Wait");
    if (ks == KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0))
    int selRow = getSelectedRow();
    int rowCount = getRowCount();
    int selCol = getSelectedColumn();
    String val =(String)getValueAt(selRow,selCol);
    boolean b= getCellEditor(selRow,selCol).stopCellEditing();
    System.out.println(b);
    System.out.println(rowCount-1 + " "+ selRow + " " + getSelectedColumn());
    if((!val.equals("")) && selRow==rowCount-1)
    System.out.println(rowCount-1 + " "+ getSelectedRow()+ " " + getSelectedColumn());
    blank1 = new String[columns];
    for(int p=0;p<columns;p++)
    blank1[p]="";
    Diary.this.datarows.addElement(blank1);
    // dataModel.fireTableStructureChanged();
    //dataModel.fireTableDataChanged();
    Diary.this.dataModel.fireTableChanged(null);
    else if(ks ==KeyStroke.getKeyStroke(KeyEvent.VK_1,0))
    System.out.println("One One One One ");
    return super.processKeyBinding(ks,e,condition,pressed);

    It's been a while since I looked at the code, but essentially there are three key event types:
    1) key pressed,
    2) key typed,
    3) key released.
    So I would expect the processKeyBind to see all three of them. However, ks==KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0) is true only when a key typed event is detected (the other types can be ignored by passing it up the food chain where they will eventually be consumed). Now...., if I understand you correctly, you want to terminate edit on the present of Enter key, right? Here is how I'd suggest you do:
       protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
          if (isEditing()) {
             Component editorComponent=getEditorComponent();
             editorComponent.stopCellEditing();
             return true;
          return super.processKeyBinding(ks,e,condition,pressed);
       }Ok.... now, it appears that you want to do something else also... i.e., add a new row to the table if the editing row is the last row and the editing column is the last column of the last row. You can't do that in the same thread (i.e., you must wait until the update in the current thread is completed). So, what you must do is use the SwingUtilities.InvokeLater, like this:
       protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
          if (isEditing()) {
             Component editorComponent=getEditorComponent();
             editorComponent.stopCellEditing();
             if (getEditingRow()+1==getRowCount() && getEditingColumn()+1==getColumnCount()) {
                SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
    // put the code for adding new row here
             return true;
          return super.processKeyBinding(ks,e,condition,pressed);
       }OK?
    ;o)
    V.V.
    PS: posted code is untest but should work!

  • 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

  • Handling Enter key in JTable

    Hi...
    What I m trying is to add a blank row to the table,if and only if
    the user presses ENTER in the last row(with some data in cell,not blank)
    Unfortunately,I m not able to do so . Also I want that the focus
    should go to the cell in the next row & previous column.Please help
    me with the code...
    My code is as follows....
    tableView.addKeyListener(ka = new KeyAdapter(){
    public void keyPressed(KeyEvent e)
    if(e.getKeyCode()==KeyEvent.VK_ENTER)
    int selRow = tableView.getSelectedRow();
    int rowCount = tableView.getRowCount();
    int selCol = tableView.getSelectedColumn();
    String val =(String)tableView.getValueAt(selRow,selCol);
    System.out.println(rowCount-1 + " "+ selRow + " " + tableView.getSelectedColumn());
    if((!val.equals("")) && selRow==rowCount-1)
    System.out.println(rowCount-1 + " "+ tableView.getSelectedRow()+ " " + tableView.getSelectedColumn());
    blank1 = new String[columns];
    for(int p=0;p<columns;p++)
    blank1[p]="";
    datarows.addElement(blank1);
    //dataModel.fireTableDataChanged();
    dataModel.fireTableChanged(null);
    I do get the desired result ,but the second time I press Enter
    in the same cell...
    Please help me to get out of this annoying problem.....
    Thanx in advance...
    Piyush

    Hi...
    First of all thanks both of u....
    But my problem is not completely solved...
    I have four columns in my table.What I want is when the user presses
    ENTER in the last row and 2nd or 4th column new row should be appended
    and the input focus should be at (selectedRow+1,selectedCol-1),that is,
    diagonally...
    But when I press ENTER fot the first time,nothing happens...
    Again when I come back to the same cell(second time) and press ENTER,
    I get the desired results...
    I think the cellEditor's stopCellEditing() method should be called,
    but it throws exception....
    Here's my _enterKeyHit() method....
    private void _enterKeyHit()
    // Enter hit on last row... do stuff
    int selRow = tableView.getSelectedRow();
    int rowCount = tableView.getRowCount();
    int selCol = tableView.getSelectedColumn();
    String val =(String)tableView.getValueAt(selRow,selCol);
    //-- Throws Exception....
    boolean res=tableView.getCellEditor().stopCellEditing();
    if((!val.equals("")) && selRow==rowCount-1 && (selCol==1 || selCol==3))
    System.out.println(rowCount-1 + " "+ tableView.getSelectedRow()+ " " + tableView.getSelectedColumn());
    blank1 = new String[columns];
    for(int p=0;p<columns;p++)
    blank1[p]="";
    datarows.addElement(blank1);
    dataModel.fireTableChanged(null);
    tableView.editCellAt(selRow+1,selCol-1);
    if(!val.equals("") && selRow!=rowCount-1)
    if(selCol==1 || selCol==3)
    tableView.editCellAt(selRow+1,selCol-1);
    else
    tableView.editCellAt(selRow,selCol+1);
    if((!val.equals("")) && selRow==rowCount-1 && (selCol==0 || selCol==2))
    tableView.editCellAt(selRow,selCol+1);
    }

  • Handling Enter ey of keyBoard

    hi all
    does any body know how to handle Enter key.
    infact in my OA framework pages when i press nothing happens..so ultimately i have to click the button on the page..
    i want to five some default behavior when i press enter ..
    pls give me an idea...
    thanking 4 ur kindness..
    regards,
    naveen

    i didnt get u ..
    why should i put this in processRequest ..why not in processFormRequest...
    see my controller code looks like
    /*===========================================================================+
    | Copyright (c) 2001, 2003 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package igate.oracle.apps.icx.irep.client.server.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import java.io.Serializable;
    * Controller for ...
    public class igteupdatedbmpCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    String instancename;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    TransactionUnitHelper.startTransactionUnit(pageContext, "empUpdateTxn");
    instancename = pageContext.getParameter("InstanceName");
    pageContext.putTransactionValue("InstanceName", instancename);
    Serializable[] params = { instancename };
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("initDetails1",params);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Apply") != null)
    am.invokeMethod("apply");
    OAViewObject vo = (OAViewObject)am.findViewObjec("getcreatemappingVO1");
    TransactionUnitHelper.endTransactionUnit(pageContext, "empUpdateTxn");
    MessageToken[] tokens = { new MessageToken("INS_NAME",instancename)};
    OAException confirmMessage = new OAException("ICX",
    "ITE_IREP_INST_UPDATED", tokens,
    OAException.CONFIRMATION, null);
    pageContext.putDialogMessage(confirmMessage);
    pageContext.forwardImmediately("OA.jsp?page=/ite/oracle/apps/icx/irep/client/server/webui/igte_databasemapping",
    null,OAWebBeanConstants.KEEP_MENU_CONTEXT,null,null,true,OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    else if (pageContext.getParameter("Cancel") != null)
    am.invokeMethod("rollbackEmployee");
    TransactionUnitHelper.endTransactionUnit(pageContext, "empUpdateTxn");
    pageContext.forwardImmediately("OA.jsp?page=/ite/oracle/apps/icx/irep/client/server/webui/igte_databasemapping",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    so my page has cancel and apply button..i want to give enter and apply button same functionality..
    can u give me an idea now...
    pls
    regards
    naveen

  • Submitting a form with enter key causing strange problems

    I am having a very strange problem with a webapp I am currently developing. I am using JSF 1.2 along with Facelets and RichFaces. I have coded a workflow/wizard 4-step process, and on some pages I have 4 submit buttons that all call different actions on the page. The users thought it would be useful to have the enter key submit the form, so I followed some online resources to trap a keypress using javascript, looking for the enter keycode and calling document.getElementById("elementName").click(). This works fine most of the time. Sometimes, though, it seems as if an entire new session is being created, and odd behavior starts happening. For example, my page will only include 2 of the 4 facelets on the screen -or- I will get NullPointerExceptions for objects that I know have been created in the session bean I am currently using -or- I will get a duplicate form Id after trying to re-submit the page. Could the javascript click simulation not be submitting all of the form elements or is the enter key also acting like its default action (the form submission) in addition to the "click"? I'm really at my wit's end here (plus it's nearly 3 AM, that never helps things). All of the buttons being clicked are standard h:commandButtons. There is some setTimeout logic included to disable the buttons on the page to prevent double clicks (I cannot disable them onsubmit because disabled buttons don't pass the right values, perhaps that's causing it, but if so, clicking the buttons with the mouse would cause that issue too, right?)
    I am not posting the code (yet), but if anyone wants to take a look see and see if I am doing something really abhorrently wrong, I'm more than willing to, I'm just curious if anyone has had problems regarding javascript submission of forms via the click() method. Clicking the button does not exhibit this type of behavior. Just as a side note: I am doing different things with the enter key depending if a modal window is open (the enter key closes the modal if it's up, and if not, it submits the form via a button click).
    Any help is much appreciated, if anyone has any inkling about where I should start looking for answers it would be really helpful.
    Thank you.

    edfrost wrote:
    Could the javascript click simulation not be submitting all of the form elements or is the enter key also acting like its default action (the form submission) in addition to the "click"?My guess is the second of these. You need to suppress the event handling after programmatically clicking the button.

  • Need help on tips of Enter Key form Default Action!

    Hi
    In Iplanet-Jato-Tips
    Enter Key Form Action Default Command i had a problem.
    Is there any way to avoid the Enter action.
    I need the same functionality which they specified in the tips,but not while
    enter on a text field.
    I need that functionality(default command child) ,but that action should
    happen only at onclick,onFocus etc.So how to do for that.
    My Ultimate question is
    I need a default handler method which should handle my request if i submit a
    page thru javascript having document.form.submit().
    Please help needed,i was exhausted in asking this question in so many ways.
    Thanks
    Awaiting for reply.
    Jaya

    Hi,
      <a href="/people/sap.user72/blog/2005/05/09/have-you-played-blindfold-chess's</a> how to create a dynamic table, though I think you have already done this.
      Do look at the comment that Armin Reichert has put in. Now in the source code that he has provided, the last line should be
    table.setOnLeadSelect(wdThis.wdGetLeadSelectAction());
    Have you done something similar to this?
    Have you set the initializeLeadSelect property of the datasource node to true?
    Regards,
    Satyajit.
    Message was edited by: Satyajit Chakraborty

  • Lose of focus (mouse click/enter key)

    Hello,
    we have a problem customers are complaining about for quite a while now, but despite our efforts, we can not fix it or at least determine with certainty the problem cause.
    We have an application launching forms apps, and from time-to-time we completely lose the focus on this form (generally after typing ENTER in a filter), I mean by focus, we cannot click anymore (cursor seems to stay on a object), we cannot press enter anymore (we get a 'Not defined key function') and so on...
    I heard somewhere that it could be due to 'KEY-OTHERS' trigger not handling correctly the ENTER-KEY. But I need this trigger for my filters, or is there another way? KEY_ENTER does only navigate from field to another.
    I found something which was able to remove focus lost (kind of a hack while trying to fix this on an on), but the problem is I had to remove this, because it blocks the opening of new windows or popups. It was a mouse-click trigger on forms triggers level:
    Go_Record(:System.Mouse_record);
    Go_Item(:System.Mouse_Item);
    But this blocks any window opening, and it also blocks some other tools we have developed.
    Thanks,
    Best regards,
    G.
    EDIT: Forms 11g, and I am pretty sure we had not that much problems with 10g
    EDIT2: I read the same kind of topics in the forum, but no patch seems to help
    AND we use JRE 1.7....
    Edited by: lakers on Jan 14, 2013 11:56 PM
    Edited by: lakers on Jan 14, 2013 11:59 PM

    this problem occurs with some of versions of JRE. Try with JRE JInitiator 1.3.1.22. Also unstalled all others JRE if exists.
    A file called fmrpcweb.res has also been provided which gives the Microsoft Windows client/server keyboard mappings. To use this file, rename fmrpcweb.res to fmrweb_orig.res, and copy fmrpcweb.res to fmrweb.res. Alternatively, use the term parameter as described above.
    By default, whether deploying client/server or over the Web pressing the ENTER key takes the cursor to the next navigable item in the block. To override this default behavior it is necessary to modify the forms resource file to revise the key mapping details.
    Modify fmrweb.res and change the Forms Function Number (FFN) from 27 to 75 for the Return Key. The line should be changed to the following:
    10 : 0 : "Return" : 75 : "Return"
    By default, the line is displayed with an FFN of 27 and looks as follows:
    10 : 0 : "Return" : 27 : "Return"
    This line should NOT fire the Key-Enter trigger since the Return or Enter key is actually returning the Return function represented by the FFN of 27. The FFN of 75 represents the Enter function and fires the Key-Enter trigger.
    http://docs.oracle.com/cd/E24269_01/doc.11120/e24477/configure.htm#i1077054
    please mark correct/helpful if problem is solved..
    Edited by: Askdineshsinghminhas on Jan 15, 2013 5:28 AM

  • Unexpected behaviour upon pressing the 'Enter' key on dialog screen

    Hi.
    I have two dialog screens that exhibit unexpected behaviour when i pressed the 'Enter' key.
    Screen 1: When I pressed the 'Enter' key, the focus shifted to another input field and the content of the previous input field is cleared. The thing is, I did not have any codes in PAI for 'Enter'. Why is this happening?
    Screen 2: On load, some of the fields on this screen will be disabled. However, when I pressed the 'Enter' key, all the disabled fields become enabled. Again, I did not have any codes that handle the 'Enter' key in PAI. Why is this happening?
    Any help is appreciated.

    Hi Atish.
    Yes, I have used CHAIN... END CHAIN.
    I thought that CHAIN... END CHAIN allows my input fields to be re-activated after an error message is displayed.
    How would CHAIN... END CHAIN cause the unexpected behaviour?
    Thanks.

  • 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

  • MouseClicked event = enter key doesnt work

    Hello,
    when I make some JButoon and add to it MouseClicked event (witch handles some code) everything works fine. But when I mark it with TAB then press ENTER button wont "doClick".
    So I found out that actionPerformed might be the right handler, but I dont understand why there is also mouseClicked event?
    Is actionPerformed event what I need (to work either with LMB or ENTER key) ?
    Are there any disatvantages of actionPerformed event comparing to mouseClicked event?

    The spacebar, not the Enter key, is the default keyboard trigger for a button that has the focus (and not just in Java).
    If you really want the focused button to respond to the Enter key, search this forum for"DefaultButtonFollowsFocus".
    db

Maybe you are looking for