OK_CODE for ENTER Button

Hello Friends ,
i used the command : field XXXX module YYYY , to call the module when the data is given in the field. Now my boss told me that he wants to execute the filling of the table ( that is waht my program makes) even if i do not fill any field.
How do i get the ok_code when i press the enter button?
Best Regards!

When you press the ENTER key the PAI will be called but the OK_CODE will be empty.  If you specifically trap for OK_CODE = '' you can fill the table whenever the ENTER key is pressed.
PROCESS AFTER INPUT.
MODULE USER_COMMAND.
*Call to USER_COMMAND MODULE
MODULE USER_COMMAND INPUT.
  IF OK_CODE = ''.
*   Fill table when the ENTER key is pressed
  ENDIF.
ENDMODULE.
Whenever the user presses the ENTER key the same code will be called so it could affect the speed of your program--depending on the size of the table you want to populate.
If I'm not even close on my response to your question, I apologize.

Similar Messages

  • Code  for  'enter' button in user command.

    hi experts,
                       i have developed a initial screen as selection screen for table control.
    data is displayed in second screen(table control).
    <b></b>when user enters inputs in selection screen and presses enter on keyboard
    it should execute to second screen. code for enter button. <b></b>

    Hello,
    in the PBO process should you have the next code:
    for example:
    case sy-ucomm.
    when 'ENTER'.
        CALL SCREEN 0200. " The second window
    when 'SAVE'.
    when ...
    endcase.
    You should have all conditions in the case statement, otherwise you have a error.
    Regards,

  • OK_CODE for Enter

    Hi
    What is the OK_CODE for enter?
    I have ALV Grid Report with one fld in edit mode. If I enter wrong input it should goto selection screen.
    I have ONLI/ENTR/ENTE/space but not working.
    Please help me

    if u want control over selection if u give wrong I / P..
    i don't know whether it is useful but,we use like this.
    when ever YOUR using 2 blocks ,based on first block selection,2nd has to enable or disable.
    like
    after parameters:...
    <b>AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'ABC'.
    IF VAL = 1 .
    SCREEN-INPUT = O.
    SCREEN-INVISIBLE = 1.
    MODIFY SCREEN.
    ELSE.
    VAL = 2 .
    SCREEN-INPUT = 1.
    MODIFY SCREEN.
    ENDIF.
    ENDIF.
    ENDLOOP.</b>
    after AT SELECTION-SCREEN ON P_KUNNR(OR ANY OTHER)
    SELECT SINGLE * FROM KNA1 WHERE KUNNR = P_KUNNR.
    <b>IF SY-SUBRC <> 0.
    MESSAGE I000(0) WITH ' ENTER CORRECT I/P '.
    EXIT.
    ELSE.
    VAL = 2.
    ENDIF.
    (HERE CONTROL GOES TO SCREEN-INPUT = 1 )</b>

  • OK_CODE For ENTER and Scroll key

    Hi,
    when ever i press ENTER button in the module pool screen i need to capture the action code for that, because i suppose to do some action.
    i need the same for scroll button also.
    Kindly help me in this .
    reg,
    Hariharan.

    Hi Hariharan.
    Pressing ENTER returns empty function code in PAI, so you can just check OK_CODE = space . This is why you need to (at the beggining of PAI) save value of OK_CODE and then clear it. It can still hold value of previous action and if you later ENTER was pressed, the value would be incorrect. Do the following:
    - create a screen, go to Element list tab type OK_CODE in empty field (column NAME) next to value OK (column TYPE).
    - in program declare corresponding data object with name OK_CODE, so the value will be transported between screen and program
    "in program
    data: ok_code like sy-ucomm. "this OK_CODE var will hold function code of triggered action on screen
    - write PBO and PAI modules in screen flow logic and corresponding ones in ABAP program
    "in screen flow logic
    PROCESS BEFORE OUTPUT.
      MODULE PBO.
    PROCESS AFTER INPUT.
      MODULE PAI.
    "in ABAP program
    MODULE PBO OUTPUT.
       "here you can set your GUI status
       SET PF-STATUS space.  "using  SPACE will set default GUI status
    ENDMODULE.
    "now in PAI
    MODULE PAI INPUT.
       "here you need to capture ok_code value in order to know what was the action
       data: save_ok like sy-ucomm. "our help var
        save_ok = ok_code. "first remeber what was triggered
        clear ok_code.    "now clear the contenet of ok_code to be able to catch ENTER action (as mentioned above)
        "now check if empty
         if save_ok = space.   "ENTER was hit
            "react here accordingly
         endif.  
    ENDMODULE.
    For more information please refer [Reading Function Codes|http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm]
    Regards
    Marcin

  • Dynamic Action with KeyCode check for ENTER button pressed

    Hi,
    I want to create a dynamic action which executes if the ENTER button of field P1_NAME is pressed.
    I thought about this type of DA:
    Event: Key Press
    Selection Type: Item(s)
    Item(s): P1_NAME
    Condition: Javascript expression
    Value: this.triggeringElement.keyCode == 13
    That unfortunately doesn't work! Dynamic action doesn't get executed...
    Hope for help! :)
    Tobias

    I found the solution in my own blog: :)
    Event: Key Press
    Selection Type: Item(s)
    Item(s): P1_NAME
    Condition: Javascript expression
    Value: this.browserEvent.keyCode == 13

  • For enter

    how to use enter button instead of pushbutton for calling another screen?

    >
    Ankur Parab wrote:
    > Hi,
    > normally the ok_code for Enter is 'ENTR'. So check sy-ucomm value equal to 'ENTR' and then call the required screen.
    >
    > Regards,
    > Ankur Parab
    Sorry but this is not true. Normally pressing ENTER doesn't place any function code in sy-ucomm . This is one of the reason why you in PAI we should store ok_code in some save_code variable and then clear it. Simply after pressing ENTER in next screen without first clearing content of ok_code we might still have previous function code there, hence program logic would be wrong.
    Refer for proof [Reading Function Codes|http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm]
    @ Priya.R
    If you want to catch your ENTER, simply do the following
    data: ok_code like sy-ucomm,  "ok_code assigned to screen
              save_code like sy-ucomm.
    MODULE pai INPUT.
       save_code = ok_code. 
       clear ok_code.
       if save_code = space.  "as said above ENTER will generate empty function code
        CALL SCREEN ...
       endif.    
    ENDMODULE.
    Regards
    Marcin

  • My enter button and web search orb won't work only on my homepage. Works everywhere but there. We have Yahoo for a homepage. What should I do?

    We have the at&t/yahoo homepage fixed where we can check our other email account. On this page, I have just a color theme and all of the news items disabled. We have had this for three years now. Just a few days ago we noticed that when we use the search bar that is included in the middle of the page that the enter button won't work. I usually type and hit enter as opposed to clicking on the mouse button. I do have the search assistant on. I tried to disable that, but it didn't help. I have a couple of other search toolbars and they work fine with the keyboard. It's just convenient especially for my husband to have it this way. I have searched the internet for several days and have come close to what I thought would be the answer but nothing has worked yet. Most of the questions/answers were old anyway. It might not have anything to do with Firefox, I just didn't know where else to ask questions too.

    Also, when I go on to safari, another alert pops up that safari cannot verify the identity of the website, anything that I type in to as common as google.com. It gives me 3 options to either cancel, look at details, and continue. I've looked at the details of the website of Google and it is legitimate the site. Any help?

  • How to enable enter button on keyboard for action on jsp page with adf11g

    hello,
    i have a login page, when i press login button with mouse it is working.
    But i want to click 'enter' button on the keyboard when inputbox is focused.
    For example i entered user and i entered passsword and click 'enter' button on keyboard for login action. How can i do this easily with adf11g ?
    thanks for interests.

    i tried but on af:form we have not defaultAction. i saw, there has defaultCommand i tried this but not acceptable by warning that about, "no id or naming containers". We has an id on command but what is naming containers.
    Other question is,
    How to write javascript on the adf tools? We have not any, "onClick, onPressed vs..".
    Thanks for helps.

  • Menu Button in ALV toolbar (multiple choices for a button)

    Hi abapers,
    I would like to have a button with multiple choices in the toolbar;
    at the moment I have created a menu button with just one function.
    Here is my code:
    CLASS lcl_event_receiver (Definition)
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver (Implementation)
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
        DATA: ls_toolbar  TYPE stb_button.
    *Separator
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    *Button
        CLEAR ls_toolbar.
        MOVE 1 TO ls_toolbar-butn_type.
        MOVE 'EDIT' TO ls_toolbar-function.
        MOVE icon_change TO ls_toolbar-icon.
        MOVE ' Modifica'(l02) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        MOVE 'Modifica' TO ls_toolbar-quickinfo.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION

    hi,
    check this code and reward me if it helps you..
    TYPE-POOLS : slis,icon.
    *Structure declaration for tcodes
    TYPES : BEGIN OF ty_table,
            tcode TYPE tcode,
            pgmna TYPE progname,
            END OF ty_table.
    *Structure for tocde text
    TYPES : BEGIN OF ty_itext,
            tcode TYPE tcode,
            ttext TYPE ttext_stct,
            sprsl TYPE sprsl,
            END OF ty_itext.
    *Structure for output display
    TYPES : BEGIN OF ty_output,
            tcode TYPE tcode,
            pgmna TYPE progname,
            ttext TYPE ttext_stct,
           END OF ty_output.
    *internal table and work area declarations
    DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
           it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
           wa_table TYPE ty_table,
           wa_output TYPE ty_output,
           wa_ittext TYPE ty_itext.
    *Class definition for ALV toolbar
    CLASS:      lcl_alv_toolbar   DEFINITION DEFERRED.
    *Declaration for toolbar buttons
    DATA : ty_toolbar TYPE stb_button.
    Data declarations for ALV
    DATA: c_ccont TYPE REF TO cl_gui_custom_container,   "Custom container object
          c_alvgd         TYPE REF TO cl_gui_alv_grid,   "ALV grid object
          it_fcat            TYPE lvc_t_fcat,            "Field catalogue
          it_layout          TYPE lvc_s_layo,            "Layout
          c_alv_toolbar    TYPE REF TO lcl_alv_toolbar,           "Alv toolbar
          c_alv_toolbarmanager TYPE REF TO cl_alv_grid_toolbar_manager.  "Toolbar manager
    *Initialization event
    INITIALIZATION.
    *Start of selection event
    START-OF-SELECTION.
    *Subroutine to get values from tstc table
      PERFORM fetch_data.
    *subroutine for alv display
      PERFORM alv_output.
          CLASS lcl_alv_toolbar DEFINITION
          ALV event handler
    CLASS lcl_alv_toolbar DEFINITION.
      PUBLIC SECTION.
    *Constructor
        METHODS: constructor
                   IMPORTING
                     io_alv_grid TYPE REF TO cl_gui_alv_grid,
    *Event for toolbar
        on_toolbar
           FOR EVENT toolbar
           OF  cl_gui_alv_grid
           IMPORTING
             e_object.
    ENDCLASS.                    "lcl_alv_toolbar DEFINITION
          CLASS lcl_alv_toolbar IMPLEMENTATION
          ALV event handler
    CLASS lcl_alv_toolbar IMPLEMENTATION.
      METHOD constructor.
      Create ALV toolbar manager instance
        CREATE OBJECT c_alv_toolbarmanager
          EXPORTING
            io_alv_grid      = io_alv_grid.
       ENDMETHOD.                    "constructor
      METHOD on_toolbar.
      Add customized toolbar buttons.
      variable for Toolbar Button
          ty_toolbar-icon      =  icon_generate.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button1'.
          APPEND ty_toolbar TO e_object->mt_toolbar.
          ty_toolbar-icon      =  icon_voice_output.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button2'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
         ty_toolbar-icon      =  icon_phone.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button3'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
         ty_toolbar-icon      =  icon_mail.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button4'.
           APPEND ty_toolbar TO e_object->mt_toolbar.
       ty_toolbar-icon      =  icon_voice_input.
        ty_toolbar-butn_type = 0.
        ty_toolbar-text = 'Button5'.
         APPEND ty_toolbar TO e_object->mt_toolbar.
      Call reorganize method of toolbar manager to
      display the toolbar
         CALL METHOD c_alv_toolbarmanager->reorganize
          EXPORTING
            io_alv_toolbar = e_object.
       ENDMETHOD.                    "on_toolbar
    ENDCLASS.                    "lcl_alv_toolbar IMPLEMENTATION
    *&      Form  fetch_data
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .
    Select the tcodes upto 200 rows from TSTC
       SELECT   tcode
               pgmna
               FROM tstc
               INTO CORRESPONDING FIELDS OF TABLE it_table
               UP TO 200 ROWS
               WHERE dypno NE '0000'.
    *Select the tcode textx
       IF it_table[] IS NOT INITIAL.
         SELECT ttext
               tcode
               sprsl
               FROM tstct
               INTO CORRESPONDING FIELDS OF TABLE it_ittext
               FOR ALL ENTRIES IN it_table
               WHERE tcode = it_table-tcode
               AND sprsl = 'E'.
       ENDIF.
    Apppending the data to the internal table of ALV output
       LOOP AT it_table INTO wa_table.
        wa_output-tcode = wa_table-tcode.
        wa_output-pgmna = wa_table-pgmna.
       For texts
        READ TABLE it_ittext INTO wa_ittext WITH KEY tcode = wa_table-tcode.
        wa_output-ttext = wa_ittext-ttext.
         APPEND wa_output TO it_output.
        CLEAR wa_output.
       ENDLOOP.
       ENDFORM.                    " fetch_data
    *&      Form  alv_output
          text
    -->  p1        text
    <--  p2        text
    FORM alv_output .
    *Calling the ALV
      CALL SCREEN 0600.
      ENDFORM.                    " alv_output
    Calling the ALV screen with custom container
    On this statement double click  it takes you to the screen painter SE51.Enter the attributes
    *Create a Custom container and name it CC_CONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    Now a normal screen with number 600 is created which holds the ALV grid. PBO of the actual screen , Here we can give a title and *customized menus
    *&      Module  STATUS_0600  OUTPUT
          text
    MODULE status_0600 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    calling the PBO module ALV_GRID.
    *&      Module  ALV_GRID  OUTPUT
          text
    MODULE alv_grid OUTPUT.
    *create object for custom container
      CREATE OBJECT c_ccont
           EXPORTING
              container_name = 'CC_CONT'.
    *create object of alv grid
      CREATE OBJECT c_alvgd
          EXPORTING
              i_parent = c_ccont.
    create ALV event handler
      CREATE OBJECT c_alv_toolbar
        EXPORTING
          io_alv_grid = c_alvgd.
    Register event handler
      SET HANDLER c_alv_toolbar->on_toolbar FOR c_alvgd.
    Fieldcatalogue for ALV
       PERFORM alv_build_fieldcat.
    ALV attributes FOR LAYOUT
      PERFORM alv_report_layout.
       CHECK NOT c_alvgd IS INITIAL.
    Call ALV GRID
       CALL METHOD c_alvgd->set_table_for_first_display
        EXPORTING
          is_layout                     = it_layout
        CHANGING
          it_outtab                     = it_output
          it_fieldcatalog               = it_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDMODULE.                 " ALV_GRID  OUTPUT
    *&      Form  alv_build_fieldcat
          text
         <--P_IT_FCAT  text
    FORM alv_build_fieldcat.
       DATA lv_fldcat TYPE lvc_s_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '1'.
      lv_fldcat-fieldname = 'TCODE'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 8.
      lv_fldcat-scrtext_m = 'TCODE'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
       lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '2'.
      lv_fldcat-fieldname = 'PGMNA'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'PROGNAME'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '3'.
      lv_fldcat-fieldname = 'TTEXT'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 60.
      lv_fldcat-scrtext_m = 'Description'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
    ENDFORM.                    " alv_build_fieldcat
    *&      Form  alv_report_layout
          text
         <--P_IT_LAYOUT  text
    FORM alv_report_layout.
       it_layout-cwidth_opt = 'X'.
       it_layout-zebra = 'X'.
    ENDFORM.                    " alv_report_layout
    PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes
    *and based on the user command we can do the coding.
    *&      Module  USER_COMMAND_0600  INPUT
          text
    MODULE user_command_0600 INPUT.
    ENDMODULE.                 " USER_COMMAND_0600  INPUT
    thanks,
    gupta

  • Imitate clicking Enter button

    How to imitate clicking Enter on ALV to force data to be saved in internal table?
    Edited by: S S on Mar 16, 2009 10:38 PM

    Hi,
    Also check this code --->
    REPORT zalv_editf4display.
    *Type pools for alv
    TYPE-POOLS : slis.
    *structure for t582a tbale
    TYPES : BEGIN OF ty_table,
            infty TYPE infty,
            pnnnn TYPE pnnnn_d,
            zrmkz TYPE dzrmkz,
            zeitb TYPE dzeitb,
            dname TYPE dianm,
             davo TYPE davo,
            davoe TYPE davoe,
            END OF ty_table.
    *Structure for infotype text
    TYPES : BEGIN OF ty_itext,
            infty TYPE infty,
            itext TYPE intxt,
            sprsl TYPE sprsl,
            END OF ty_itext.
    *Structure for output display
    TYPES : BEGIN OF ty_output,
            infty TYPE infty,
            itext TYPE intxt,
            pnnnn TYPE pnnnn_d,
            zrmkz TYPE dzrmkz,
            zeitb TYPE dzeitb,
            dname TYPE dianm,
            davo TYPE davo,
            davoe TYPE davoe,
           END OF ty_output.
    *internal table and work area declarations
    DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
           it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_pbo TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
           wa_table TYPE ty_table,
           wa_output TYPE ty_output,
           wa_ittext TYPE ty_itext.
    *Data declarations for dropdown lists for f4
    DATA: it_dropdown TYPE lvc_t_drop,
          ty_dropdown TYPE lvc_s_drop,
    *data declaration for refreshing of alv
          stable TYPE lvc_s_stbl.
    *Global variable declaration
    DATA: gstring TYPE c.
    *Data declarations for ALV
    DATA: c_ccont TYPE REF TO cl_gui_custom_container,         "Custom container object
          c_alvgd         TYPE REF TO cl_gui_alv_grid,         "ALV grid object
          it_fcat            TYPE lvc_t_fcat,                  "Field catalogue
          it_layout          TYPE lvc_s_layo.                  "Layout
    *ok code declaration
    DATA:
      ok_code       TYPE ui_func.
    *initialization event
    INITIALIZATION.
    *start of selection event
    START-OF-SELECTION.
    *select the infotypes maintained
      SELECT infty
              pnnnn
              zrmkz
              zeitb
              dname
              davo
              davoe
              FROM t582a UP TO 10 ROWS
              INTO CORRESPONDING FIELDS OF TABLE it_table.
    * *Select the infotype texts
      IF it_table[] IS NOT INITIAL.
        SELECT itext
                 infty
                 sprsl
                 FROM t582s
                 INTO CORRESPONDING FIELDS OF TABLE it_ittext
                 FOR ALL ENTRIES IN it_table
                 WHERE infty = it_table-infty
                 AND sprsl = 'E'.
      ENDIF.
    *Apppending the data to the internal table of ALV output
      LOOP AT it_table INTO wa_table.
        wa_output-infty = wa_table-infty.
        wa_output-pnnnn = wa_table-pnnnn.
        wa_output-zrmkz = wa_table-zrmkz.
        wa_output-zeitb = wa_table-zeitb.
        wa_output-dname = wa_table-dname.
        wa_output-davo = wa_table-davo.
        wa_output-davoe = wa_table-davoe.
    * For texts
        READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
        wa_output-itext = wa_ittext-itext.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
      ENDLOOP.
    * Calling the ALV screen with custom container
      CALL SCREEN 0600.
    *On this statement double click  it takes you to the screen painter SE51.
    *Enter the attributes
    *Create a Custom container and name it CCONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.
    * PBO of the actual screen ,
    * Here we can give a title and customized menus
    *create 2 buttons with function code 'SAVE' and 'EXIT'.
    * GIVE A SUITABLE TITLE
    *&      Module  STATUS_0600  OUTPUT
    *       text
    MODULE status_0600 OUTPUT.
      SET PF-STATUS 'DISP'.
      SET TITLEBAR 'ALVF4'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    * calling the PBO module ALV_GRID.
    *&      Module  PBO  OUTPUT
    *       text
    MODULE pbo OUTPUT.
    *Creating objects of the container
      CREATE OBJECT c_ccont
           EXPORTING
              container_name = 'CCONT'.
    *  create object for alv grid
      create object c_alvgd
      exporting
      i_parent = c_ccont.
    *  SET field for ALV
      PERFORM alv_build_fieldcat.
    * Set ALV attributes FOR LAYOUT
      PERFORM alv_report_layout.
      CHECK NOT c_alvgd IS INITIAL.
    * Call ALV GRID
      CALL METHOD c_alvgd->set_table_for_first_display
        EXPORTING
          is_layout                     = it_layout
          i_save                        = 'A'
        CHANGING
          it_outtab                     = it_output
          it_fieldcatalog               = it_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDMODULE.                 " PBO  OUTPUT
    *&      Form  alv_build_fieldcat
    *       text
    *      <--P_IT_FCAT  text
    *subroutine to build fieldcat
    FORM alv_build_fieldcat.
      DATA lv_fldcat TYPE lvc_s_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '1'.
      lv_fldcat-fieldname = 'INFTY'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 8.
      lv_fldcat-scrtext_m = 'Infotype'.
      lv_fldcat-icon = 'X'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '2'.
      lv_fldcat-fieldname = 'PNNNN'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Structure'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '3'.
      lv_fldcat-fieldname = 'ITEXT'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 60.
      lv_fldcat-scrtext_m = 'Description'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '5'.
      lv_fldcat-fieldname = 'ZRMKZ'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 1.
      lv_fldcat-scrtext_m = 'PERIOD'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '6'.
      lv_fldcat-fieldname = 'ZEITB'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 5.
      lv_fldcat-scrtext_m = 'Time constraint'.
      lv_fldcat-edit = 'X'.
    *To avail the existing F4 help these are to
    *be given in the field catalogue
      lv_fldcat-f4availabl = 'X'.
      lv_fldcat-ref_table = 'T582A'.
      lv_fldcat-ref_field = 'ZEITB'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '7'.
      lv_fldcat-fieldname = 'DNAME'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Dialogmodule'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '8'.
      lv_fldcat-fieldname = 'DAVO'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Start'.
      lv_fldcat-edit = 'X'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '9'.
      lv_fldcat-fieldname = 'DAVOE'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'End'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
    *To create drop down for the field 'DAVO'
    * with our own f4 help
      ty_dropdown-handle = '1'.
      ty_dropdown-value = ' '.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '1'.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '2'.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '3'.
      APPEND ty_dropdown TO it_dropdown.
      CALL METHOD c_alvgd->set_drop_down_table
        EXPORTING
          it_drop_down = it_dropdown.
      LOOP AT it_fcat INTO lv_fldcat.
        CASE lv_fldcat-fieldname.
    ** To assign dropdown in the fieldcataogue
          WHEN 'DAVO'.
            lv_fldcat-drdn_hndl = '1'.
            lv_fldcat-outputlen = 15.
            MODIFY it_fcat FROM lv_fldcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " alv_build_fieldcat
    *&      Form  alv_report_layout
    *       text
    *      <--P_IT_LAYOUT  text
    *Subroutine for setting alv layout
    FORM alv_report_layout.
      it_layout-cwidth_opt = 'X'.
      it_layout-col_opt = 'X'.
      it_layout-zebra = 'X'.
    ENDFORM.                    " alv_report_layout
    * PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes
    *and based on the user command we can do the coding.
    *&      Module  PAI  INPUT
    *       text
    MODULE pai INPUT.
    *To change the existing values and refresh the grid
    *And only values in the dropdown or in the default
    *F4 can be given , else no action takes place for the dropdown
    *and error is thrown for the default F4 help and font changes to red
    *and on still saving, value is not changed
      c_alvgd->check_changed_data( ).
    *Based on the user input
    *When user clicks 'SAVE;
      CASE ok_code.
        WHEN 'SAVE'.
    *A pop up is called to confirm the saving of changed data
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar       = 'SAVING DATA'
              text_question  = 'Continue?'
              icon_button_1  = 'icon_booking_ok'
            IMPORTING
              answer         = gstring
            EXCEPTIONS
              text_not_found = 1
              OTHERS         = 2.
          IF sy-subrc NE 0.
    *       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *When the User clicks 'YES'
          IF ( gstring = '1' ).
            MESSAGE 'Saved' TYPE 'S'.
    *Now the changed data is stored in the it_pbo internal table
            it_pbo = it_output.
    *Subroutine to display the ALV with changed data.
            PERFORM redisplay.
          ELSE.
    *When user clicks NO or Cancel
            MESSAGE 'Not Saved'  TYPE 'S'.
          ENDIF.
    **When the user clicks the 'EXIT; he is out
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
      CLEAR: ok_code.
    ENDMODULE.                 " PAI  INPUT
    *&      Form  REDISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM redisplay .
    *Cells of the alv are made non editable after entering OK to save
      CALL METHOD c_alvgd->set_ready_for_input
        EXPORTING
          i_ready_for_input = 0.
    *Row and column of the alv are refreshed after changing values
      stable-row = 'X'.
      stable-col = 'X'.
    *REfreshed ALV display with the changed values
    *This ALV is non editable and contains new values
      CALL METHOD c_alvgd->refresh_table_display
        EXPORTING
          is_stable = stable
        EXCEPTIONS
          finished  = 1
          OTHERS    = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " REDISPLAY
    In that report they have made a application button save instead of save you enter your function code for Enter(execute command button function code) in the user command. And rest will be the same.
    Hope this solves your problem.
    Regards,
    Qamar.

  • Where is the ENTER Button on the P1606dn when I am trying to manually feed envelopes?

    I had trouble trying to print envelopes using Microsoft Word running under Windows 7, I got an HP message saying to load the paper (envelope) then hit the ENTER button.
    Hitting the enter button on my keyboard did not get the intended results. Looking at all documentation on the P1606dn printer did not find a button labeled as an ENTER button there.
    I finally discovered the proper button is the "GO" button depicted by a sheet of paper with a folded-down upper right-hand corner and an arrow pointing downward on the top of the printer.
    It would be nice is HP were to change the drivers to where the message would be consistent with the documentation of the printer.

    Thank you for your message and feedback.
    You are right. the intention is to educate customer to hit the "GO" button.
    I am an employee of HP but I only speak for myself and not for the company.

  • 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

  • Add An Enter Button To a Preloader

    On my site I have 2 scenes and I'd like to add an 'Enter' button for moving from the preloader to the main site. How would I do that in this code?
    stop();
    preloader._width = 0;
    preloader._visible = preloader_bg._visible = true;
    preloader.onEnterFrame = function()
        filesize_total = _root.getBytesTotal();
        if( filesize_total == 0 ) filesize_total = 1;
        percent = Math.round( _root.getBytesLoaded() / filesize_total * 100 );
        txt = percent + "%";
        preloader._width = percent * 3;
        if( percent == 99 )
            delete this.onEnterFrame;}
    enter_btn.onPress
         gotoAndPlay("flashmo_dream", "start");

    I don't know where you are getting these tutorials, but they sound like they are very, very old. Along with not using AS2, you shouldn't be using scenes. Scenes are a left over method from the very earliest versions of Flash.
    The objective in preloading content is that you are loading in new content before the user needs it. If you are doing this loading well, the user will not know that the operation went on. Any sort of loading screen should only be seen if the user calls for content that has not loaded yet. Your design objective should be to show something to the user as quickly as possible when the user hits your site. Load in your additional content and then let the user experience your site.
    If you create a button on the stage in the same frame as your preloader object and name that button "enter_btn", then the code that you've shown above should do what you want.
    I haven't used AS2 in many years. I don't remember a lot about its syntax, but from what I read of your code, it looks like you are measuring the loading of the file that contains the preloader object. This methodology can lead to a problem. When Flash begins working, a certain amount of the movie has to load before anything is seen on the screen. This means that the loading telltale that you have set up in your code will never show "0%", and probably not even "50%".
    Here's a good tutorial that uses AS3 and fully explains the code and how the loader operates: http://flashexplained.com/preloaders/basic-loading-bar-preloader/
    Here's another: http://www.republicofcode.com/tutorials/flash/as3preloader/
    And here's a third: http://flashexplained.com/preloaders/making-the-complete-internal-preloader-in-flash-8-wit h-a-loading-bar-and-mathematical-preloaders/
    Take a look at those examples and compare and contrast their methods.

  • Sy-ucomm problem when hitting enter button

    Hello all,
    I am implementing a user exit for CO11N screen and i want the control after hitting save button so i made a control for sy-ucomm and i gave an error message. But when i hit enter button after this error message, sy-ucomm still equal to BU so it gives error message again. How can i prevent this?
    Thanks.

    Im not creating blank message
    i use the a term but the problem is, when i first hit save button and see the error message,than  i hit enter button to pass the message and make the input fields editable again. But sy-ucomm is still equal to BU so it show the message again and again and i cant return to normal input screen. And if i make the message type 'S' i cant block the saving process.
    I have to option first i will use type E message but i have to get over the problem above, or i will use type 'S' message but i have to stop the transaction after this message. I used type E like S or type S like E. They didnt work.

  • How to "enter" a text field on a website that doesn't have an enter button?

    Hi All,
    I wanted to know I can press "enter" in a text field on a website that doesn't have an enter button.
    I have used the following to help me code (i.e. login, enter values into fields).
    https://decibel.ni.com/content/docs/DOC-25396
    The above link helps but there isn't a submit on the website I am trying to access or in the code.
    What has worked for me, but isn't the best solution, is to simulate a mouse click on the desired field, after text entry, then simulate the keyboard "pressing enter".  The problem with this is the mouse click depends on the position of the labview front panel. The code runs in the background and is also a subvi.
    thanks in advance,
    Jose

    Just a question/idea - but can you not just POST the data to the web server directly? Take a look at the HTML of the page and see if you can find the <form action="<THE URL TO POST TO>"> and then find all of the names of the form fields and send them along with the values via the HTTP Client POST VI.
    It sounded to me like you are trying to push data into a web server so it shouldn't be necessary to render the page and fill out the fields on the rendered page if you can bypass all that and just submit the data and get the response.
    If the form data is sent asynchronously (using AJAX), then you might need to delve a little into the site's javascript to find the POST URL and field names.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

Maybe you are looking for

  • Automatic clearing for Billing Reversal not working because of SPL 90

    Hi all experts, We recently implemented the Grants management module and SPL 90 is now active. We are now having a problem with automatic clearing for billing reversals. When I go to VF11 and try to reverse a document, the FI postings and FM postings

  • Request to know necessity of filter in BADI

    Hi, I would like to know what is Filter in BADI and why it is required, please throw some light on the advantages of filter in BADI. Appreciate your quick response. Regards Harikrishna

  • S-WFAR_OBJ

    Hi Experts, i was wandering if someone could ease some concerns i have. I am looking at implementing an authority check in an abap programme. That does a check on a value in the Auth Obj S_WFAR_OBJ. the soloution i am trying to put in place is all ba

  • EMP HW requiremnts on test server

    Dear Experts, I would like to install the following EPM components on a test environment, so would you please advice on the HW requirements and whether i could install them all in one server or shall i separate them. From the documentation i can find

  • Cross Form updates for searched record

    Hi All How to update a form fields which taking a searched value from another table . I have a form that records student data and which has a drop down to select the 'student registration No' that comes from different table. When insert or update a s