Capturing Enter key in ALV

Hi Experts,
Am using an editable alv. I want to perform some actions when Enter key is pressed.
I did this in DOMODIFY. But this makes the scroll bar in initial position. Kindly help me on this.
Regards,
Vijayakumar.

Hi vijayakumar,
You can refer this link for info about ENTER key event trigger. Could you please post what you want to perform when Enter key is pressed.
Link: [http://wiki.sdn.sap.com/wiki/display/ABAP/InteractiveEditableOOALVgridwithdynamicitab,FCATandENTERkeyeventtrigger]
Regards,
Anand G

Similar Messages

  • Capture ENTER event in alv

    Hi friends  ,
    I want capture "enter " event whenever user presses enter at ALV fields .
    Well i have used an event "handle data changed" but then it wont get triggered
    Unless data in ALV field is changed .
    Please suggest me how to capture event without data getting changed ,
    As i want validate data , when user presses enter on alv fields .
    Thanx in advance .

    If you want to trigger PAI for Enter key even when no data is changed, then you need to set I_APPL_EVENTS flag when creating the alv grid.
    create object alv_grid
      exporting
        i_parent = cust_ctrl
       i_appl_events = 'X'.
    But this may bring in more problems because you have to now call check_changed_Data in PAI which will trigger data_Changed, but there are workarounds.
    Regards,
    Rao A

  • 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

  • Capturing Enter Key Press

    Hi
      Is there a way where we can capture the Enter Key press of the Keyboard and call an event on the Enter Key Press??
    For fields such as input field there is onEnter field where an event can be called, but we have a requirement where in we need to call an event on click of enter key, irrespective of where the focus on the page is on.
    Any inpus on this will be helpful.
    Thanks & Regards,
    Gayathri Shanbhag

    Hi Gayathri,
    See if the following link helps:
    https://cw.sdn.sap.com/cw/docs/DOC-107045
    Regards,
    Himanshu

  • Capture ENTER key on numeric keypad

    I have several chemistry tutorials where users type something and then have it evaluated by pressing the ENTER key. This works fine for the ENTER key on the main part of the keyboard, but does not work for the ENTER key for the numeric keypad on keyboards with the two ENTER keys. How do I capture the ENTER key on the numeric keypad? In other words, how do I do the equivalent of the following for that key?  
    if the key = RETURN then
    Thanks

    Try checking:
    if _key.keyCode = 36 then ...

  • Capturing Enter key event from text box

    In my application, there are a number of text boxes. I want to create a feature where an enter key even is seen and specific function executed depending on which text box was in focus when the enter key was pressed. Currently I am able to capture an enter key event on the whole page. How do I do that specifically for a text box?
    This application is done in HTML, javascript and Adobe AIR.
    Thanks
    Binu
    www.verseview.info

    Hi
    That's true that Flex4.5 SDK under Flash builder Burito doesn't listen Enter key in Text Area for KeyUp or KeyDown event.
    Here I found a work around you can use.
    Add an eventlistener to the component in actionscript and set the useCapture=true next to eventlistener function. Now you can listen enter key for KeyUp or KeyDown Event
    Hope this helps
    Rush-me

  • Capture enter key press in h:inputtext

    hi,
    i have a h:inputText component in my jsf page. i need to capture the enter key pressed for this component. how can this be done.
    thanks in advance.

    You can use Javascript for this. In the onkeypress event, check if the keycode is 13 (the enter key) and handle accordingly.
    onkeypress="if (event.keyCode == 13) alert('Enter pressed!');"

  • Capture 'Enter' key event

    Hi,
    Is there any way we can capture the event when a user presses the enter key inside a text field?

    Hi andrewquay
    you can capture the enter key by adding the following code in the textfield's change event.
    if(xfa.event.change == "\u000a")
    xfa.host.messageBox("enter key is pressed");
    mail: [email protected]

  • Capturing ENTER key in WD4A

    Hi all,
    I m getting an input from the user in an Inputfield. I also have a table with two columns.
    The textfield is used to perform wildcard search (filter) for the table. That is, if i give a character like 'A', then the records which start with the character 'A' must be shown in the table when i press teh ENTER key..
    I have got this outptu when i click a button. But i want to get the same output, when i give 'A' and press ENTER key..
    How to acheive the same in WD4A?
    Regards,
    Shanthi

    hi Shanthi,
    for the corresponding Enter key , make a action say act in the EventPropery of the element.
    in the Onactionact,method in the Methods tab , write the same piece of code , which u r writting in the Button
    u wud be able to do it nw
    regards,
    amit

  • Problem capturing "Enter Key" within 2 paragraph in JSP

    I create a textarea for customer to enter their data. Something the data contain 2 paragraph with Enter Key involve. Then, i store the data into my database. Once i re-display the data back to customer, the data never show in 2 paragraph ?
    who know.... pls pls help..... in JSP how am i going to do, so that the data disply in 2 paragraph.

    Are you displaying the data again in TextArea? If not then you need to take care of '\r\n'. Split the data for '\r\n' and display the data in two paragraphs.
    String wholeData="Your_Paragraph1\r\nYour_Paragraph2";
    StringTokenizer st = new StringTokenizer(wholeData,"\r\n");
    while(st.hasMoreTokens()) our.print(st.nextToken()+"<br>");Hope this helps.
    Sudha

  • 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.

  • Enter Key Event in Editable ALV Grid

    Hi all,
    I am trying to create and editable ALV grid using the REUSE ALV FM.
    On the grid after changing a value, if I press enter key the pai is not triggered. I have tried the various example programs (BCALV*) but could not find anything relevant.
    Basically I need similar functionality to normal module pool programming as in validations on screen done when enter key is pressed after screen entry.
    Is it possible to capture the Enter keypress on the ALV grid?

    Hello Preet
    I can only tell you how I would solve this using the ALV grid control (CL_GUI_ALV_GRID) because I have abandoned using ALV function modules.
    The problem with running through PAI is whether the focus (i.e. the cursor) is still on the control or already on the (surrounding) main program. If the control has the focus, you do not run through PAI.
    I would add a "Refresh" button to the toolbar of the ALV list. Normally, this button is already there or you only have to make it visible.
    When the user pushes this button you catch the corresponding user-command and call the CHECK_DATA_CHANGED method to see if values have been changed on the editable grid. If so, the previous method will fire event DATA_CHANGED.
    Now, in the event handler method (e.g. HANDLE_DATA_CHANGED) you receive as input a data change object (CL_ALV_CHANGED_DATA_PROTOCOL). This object contains all changed values. These values you will need to make your checks.
    I assume that the logic will be similar using ALV function modules.
    Regards
       Uwe

  • 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

  • Action for ENTER KEY is not working in alv grid output (Classical)

    Hi Experts,
      I have searched SDN around 8 hours and could not get any help on my below issue.
      I am developing ALV report using function module (Classical ALV). ALV output has 4 input enable fields, if user enters data in any of those fields and clicks on enter button from key pad..the remaining fields needs to be filled automatically.
      I am facing the issue with enter key, even if i press enter key in the output there is no action and hence no user command triggered. May be i am using wrong funcion code in wrong way.
      Could any one tell me what function code can we assign for ENTER action in PF-STATUS?
    Regards,
    Murali Mohan

    Hi
    Try this simple code, it works fine:
    TYPE-POOLS: SLIS.
    DATA: BEGIN OF ITAB1 OCCURS 0,
           BUKRS LIKE T001-BUKRS,
           BUTXT LIKE T001-BUTXT,
          END OF ITAB1.
    DATA: GT_FIELDCAT   TYPE SLIS_T_FIELDCAT_ALV,
          GT_REPID    LIKE SY-REPID.
    START-OF-SELECTION.
      SELECT BUKRS BUTXT INTO TABLE ITAB1
         FROM T001.
    END-OF-SELECTION.
      GT_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          I_PROGRAM_NAME     = GT_REPID
          I_INTERNAL_TABNAME = 'ITAB1'
          I_INCLNAME         = GT_REPID
        CHANGING
          CT_FIELDCAT        = GT_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = GT_REPID
          I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
          I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
          IT_FIELDCAT              = GT_FIELDCAT
        TABLES
          T_OUTTAB                 = ITAB1.
    FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                          RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'ENTER'. MESSAGE I208(00) WITH 'Pressed ENTER key'.
        WHEN OTHERS.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    FORM SET_PF_STATUS  USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'LIST_ALV' EXCLUDING RT_EXTAB.
    ENDFORM.                    "SET_PF_STATUS
    Max

  • How to capture the enter even in alv

    hi, experts
    my requirement is that:
    i create an alv ,set it response to the enter even, if the content has changed, a class will be response it .
    the code like below:
        CALL METHOD g_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        CREATE OBJECT g_event_receiver.
        SET HANDLER g_event_receiver->handle_data_changed FOR g_grid.
    but if the alv content has no changed, nothing will be happen, i want to do something such as popup a message even if the content has not changed and user press enter.
    pls help me ,thanks

    I don't think this is possible.
    may be you can do is
    during the enter key is pressed
        call method cl_gui_cfw=>set_new_ok_code
                 exporting
                     new_code = 'DUMMY'.
    and in the user command
    if ok_code eq 'DUMMY'
        call method g_grid->check_changed_data
          importing
            e_valid = v_valid.
        if v_valid ne c_x.
          call function 'POPUP_TO_CONFIRM'
            exporting
              titlebar              = text-025
              text_question         = text-026
              text_button_1         = text-027
              text_button_2         = text-028
              display_cancel_button = ' '
            importing
              answer                = v_answer.
    endif.
    a®s
    Edited by: a®s on Jul 2, 2008 10:37 AM

Maybe you are looking for

  • Why does R/3 have no ABAP UML modelling tools integrated?

    I find it strange that SAP tout the benefits of OO programming and ABAP classes, then completely fail to provide a UML round trip modelling tool integrated into the ABAP workbench. Doesn't this display a lack of foresight on SAPs behalf? I mean, if y

  • Lost ical events with lion upgrade...how do I find them?

    Does anyone know how to get all ical events to appear in ical after a lion upgrade?

  • What is the current version number?

    Can you tell me what the current version number for acrobat.com is? One of my computers (XP Home SP3) shows version # 1.2.443, but I just intstalled it on another of my computers (actually, it automatically installed with acrobat 9 I think) (this com

  • Cisco VCS Microsoft Office 365 interop

    As I understand this in order to connect Cisco Telepresence endpoints to the MS Lync client a VCS gateway is required. This is supported for the on premises version of MS Lync. However I cannot find anything that details support or a road map of the

  • I keep getting duplicate photos when downloading from my card reader.

    In my PSE11 Camera and Card Reader preferences I have checked "Copy new files only".  Yet whenever I download a camera card that still contains photos that were previously downloaded, I end up with duplicate photos in PSE11.  I prefer to leave my pho