Refresh alv grid after user clicks f4( value-request)

Hello Experts,
I am currently developing a module pool program wherein after the user selects a value via f4(value request),
my ALV grid(using custom control) should be refreshed to show the new records selected based
on the f4 value. How can this be achieved?
thank you guys and take care!

Did you try a CALL METHOD [cl_gui_cfw=>set_new_ok_code|http://help.sap.com/saphelp_sm32/helpdata/en/06/3fa1b79f2811d2bd68080009b4534c/frameset.htm] and [=>flush|http://help.sap.com/saphelp_sm32/helpdata/EN/06/3fa1879f2811d2bd68080009b4534c/content.htm] in the POV section or in event onF4 handler method to force execution of PAI (either it works either it dumps)
Regards,
Raymond

Similar Messages

  • ALV grid abort processing, if wrong value

    Hello,
    i've a editable alv grid.
    Is it possible to abort at event data_changed/data_changed_finished, if an value is wrong (f.e. to high < 500), and write the old value back.
    Best regards,
    TomSd

    Hello Thomas
    The sample report <b>ZUS_SDN_ALVGRID_EDITABLE_10</b> provides a possible (perhaps not the most elegant) solution for your problem.
    *& Report  ZUS_SDN_ALVGRID_EDITABLE_10
    *& Description: Reset false values entered in editable ALV list
    *&              to original values
    *& Example:     Column SORT_KEY allows values from '000'-'150'
    *               -> reset if value > '010'
    *& Thread: ALV grid abort processing, if wrong value
    *& Link: https:||<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="669430"></a>
    REPORT  zus_sdn_alvgrid_editable_10.
    TYPE-POOLS: abap.
    INCLUDE <icon>.  " NOTE: replace by TYPE-POOLS: icon. on >= 6.20
    DATA:
      gd_repid         TYPE syrepid,
      gd_okcode        TYPE sy-ucomm,
      gs_layout        TYPE lvc_s_layo,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid          TYPE REF TO cl_gui_alv_grid.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knb1.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA:
      gt_outtab        TYPE ty_t_outtab,
      gt_outtab_pbo    TYPE ty_t_outtab.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          mo_data_changed    TYPE REF TO cl_alv_changed_data_protocol.
        CLASS-METHODS:
          handle_data_changed
            FOR EVENT data_changed OF cl_gui_alv_grid
            IMPORTING
              er_data_changed
              e_onf4
              e_onf4_before
              e_onf4_after
              e_ucomm
              sender,
          handle_data_changed_finished
            FOR EVENT data_changed_finished OF cl_gui_alv_grid
            IMPORTING
              e_modified
              et_good_cells,
          handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING
              e_ucomm,
          handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
            IMPORTING
              e_object
              e_interactive.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_data_changed.
    *   define local data
        DATA:
          ld_idx     TYPE i,
          ls_cell    TYPE lvc_s_modi,
          ls_msg     TYPE symsg.
        FIELD-SYMBOLS:
          <lt_outtab>  TYPE ty_t_outtab,
          <ls_outtab>  TYPE ty_s_outtab.
        ASSIGN er_data_changed->mp_mod_rows->* TO <lt_outtab>.
        LOOP AT er_data_changed->mt_mod_cells INTO ls_cell
                WHERE ( fieldname = 'ZUAWA' ).
          ld_idx = syst-tabix.
          IF ( ls_cell-value <= '010' ).
            READ TABLE <lt_outtab> ASSIGNING <ls_outtab> INDEX ld_idx.
            MODIFY gt_outtab FROM <ls_outtab> INDEX ls_cell-row_id. " !!!
          ELSE.
            CLEAR: ls_msg.
            ls_msg-msgv1 = 'Value'.
            ls_msg-msgv2 = ls_cell-value.
            ls_msg-msgv3 = 'too high (> 010)'.
            CALL METHOD er_data_changed->add_protocol_entry
              EXPORTING
                 i_msgid     = '00'
                 i_msgty     = 'E'
                 i_msgno     = '398'
                 i_msgv1     = ls_msg-msgv1
                 i_msgv2     = ls_msg-msgv2
                 i_msgv3     = ls_msg-msgv3
    *             I_MSGV4     =
                 i_fieldname = ls_cell-fieldname
                 i_row_id    = ls_cell-row_id
                 i_tabix     = ls_cell-tabix.
            DELETE er_data_changed->mt_mod_cells  INDEX ld_idx.
            DELETE er_data_changed->mt_good_cells INDEX ld_idx.
          ENDIF.
        ENDLOOP.
        IF ( syst-subrc = 0 ).
          er_data_changed->display_protocol( ).
        ENDIF.
    **    cl_gui_cfw=>set_new_ok_code( 'REFRESH' ). " not possible on 4.6c
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'DUMMY'
    *      IMPORTING
    *        RC       =
      ENDMETHOD.                    "handle_data_changed
      METHOD handle_data_changed_finished.
    *   define local data
        DATA:
          ls_outtab      TYPE ty_s_outtab,
          ls_cell        TYPE lvc_s_modi.
      ENDMETHOD.                    "handle_data_changed_finished
      METHOD handle_user_command.
      ENDMETHOD.                    "handle_user_command
      METHOD handle_toolbar.
    *   define local data
        DATA:
          ls_button    TYPE stb_button.
        ls_button-function  = 'DEFAULT'.
        ls_button-icon      = icon_mass_change.
        ls_button-quickinfo = 'Set default value for column'.
        APPEND ls_button TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM knb1 INTO TABLE gt_outtab UP TO 20 ROWS
        WHERE bukrs = '1000'.
      gt_outtab_pbo = gt_outtab.  " store PBO data
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Build fieldcatalog
      PERFORM build_fieldcatalog.
      PERFORM set_layout.
      SET HANDLER:
        lcl_eventhandler=>handle_toolbar               FOR go_grid,
        lcl_eventhandler=>handle_data_changed          FOR go_grid,
        lcl_eventhandler=>handle_data_changed_finished FOR go_grid.
    * Display data
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
        CHANGING
          it_outtab       = gt_outtab
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          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.
      go_grid->set_toolbar_interactive( ).
      CALL METHOD go_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter
        EXCEPTIONS
          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.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    * Flow logic (no elements on screen):
    *  PROCESS BEFORE OUTPUT.
    *    MODULE STATUS_0100.
    *  PROCESS AFTER INPUT.
    *    MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
      CALL METHOD go_grid->refresh_table_display
    *      EXPORTING
    *        IS_STABLE      =
    *        I_SOFT_REFRESH =
        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.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
    * Fetch changes on ALV grid
      go_grid->check_changed_data( ).
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'DUMMY'. " do nothing but pass PAI -> list refresh at PBO
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      " Set required fields editable
      LOOP AT gt_fcat INTO ls_fcat
                      WHERE ( fieldname = 'ZUAWA'  OR
                              fieldname = 'BUSAB' ).
        ls_fcat-edit    = abap_true.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
      DELETE gt_fcat WHERE ( fieldname = 'ZINRT' ).
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout .
      CLEAR: gs_layout.
      gs_layout-cwidth_opt = abap_true.
      gs_layout-zebra      = abap_true.
    **  gs_layout-stylefname = 'CELLTAB'.
    ENDFORM.                    " SET_LAYOUT
    Regards,
      Uwe

  • Image resizing after user clicking on it

    Hej,
    Im new to flash. Id like to create image resizing feature.
    After user clicking or pointing on it the image should become
    bigger. I was looking for some tutorial but couldnt find any.
    Can anyone help?Any tip, tutorial, actionscript?
    Regards,
    Nina

    Hi,
    Do other users still work well?
    Locate to Services, find Print Spooler service and check if its startup type is set as Automatic.
    Have you cleared and reset your print spooler?
    Open Services, and stop the Print Spooler service.
    Navigate to the folder below, and open the PRINTERS.
    C:\Windows\system32\spool\PRINTERS
    Delete all files in the PRINTERS folder until it is empty,
    Re-start the Print Spooler service
    Andy Altmann
    TechNet Community Support

  • When the user click on the request number it should skip the first screen o

    when the user click on the request number it should skip the first screen of REV track and show the rev track request number details. On click of u201CBacku201D button on this screen the output screen of the report should be displayed again.

    Hello Rohit,
                   What you can do is, when the User Clicks on any particular Request, you use the At Line-Selection Event. In that event, you can set the User Name to default "SY-UNAME" or any other user Name for the specific Request.
                 Again, if you want to check the Owner of the Request, you can use the Table E070 where you can Input the Request Number and get the Owner of the Request. Set the same in the User Name Field and Skip First Screen (SE09 Transaction).
    Hope it was helpful.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • How to regenerate additional rows after user clicks enter?

    Hi all,
              I am outputing the data through internal table(contains two fields 'Country' and 'Test')using ALV Classes.
    My requirement is user can add another row.And
    after appending another row user will enter country(say India) against the country
    field and clicks enter.Then the program has to fetch all the tests(say 'test1' and 'test2'  are there
    for India) described for India from the database table and refresh the screen
    with this additonal 2 rows(India, Test1 and India,Test2).
    Can anyone please let me know how to do it?Remember I am using ALV Classes.
    Thanks,
    Balaji.

    Hello Balaji
    I would use a simplified approach by storing the PBO output before displaying the editable ALV list. As soon as the user wants to save the data (enter 'SAVE' in command window) the report compares the PBO data with the current PAI data.
    To see the effect simply add a single row as previously described (resulting in three new rows) and delete two other rows. Inserted and deleted rows will be displayed afterwards.
    *& Report  ZUS_SDN_ALVGRID_EDITABLE_7
    REPORT  zus_sdn_alvgrid_editable_7.
    TYPE-POOLS: abap.
    INCLUDE <icon>.  " NOTE: replace by TYPE-POOLS: icon. on >= 6.20
    DATA:
      gd_repid         TYPE syrepid,
      gd_okcode        TYPE sy-ucomm,
      gs_layout        TYPE lvc_s_layo,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid          TYPE REF TO cl_gui_alv_grid.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knb1.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA:
      gt_outtab        TYPE ty_t_outtab,
      gt_outtab_pbo    TYPE ty_t_outtab.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_data_changed
            FOR EVENT data_changed OF cl_gui_alv_grid
            IMPORTING
              er_data_changed
              e_onf4
              e_onf4_before
              e_onf4_after
              e_ucomm
              sender,
          handle_data_changed_finished
            FOR EVENT data_changed_finished OF cl_gui_alv_grid
            IMPORTING
              e_modified
              et_good_cells,
          handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING
              e_ucomm,
          handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
            IMPORTING
              e_object
              e_interactive.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_data_changed.
    *   define local data
    **    cl_gui_cfw=>set_new_ok_code( 'REFRESH' ). " not possible on 4.6c
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'REFRESH'
    *      IMPORTING
    *        RC       =
      ENDMETHOD.                    "handle_data_changed
      METHOD handle_data_changed_finished.
    *   define local data
        DATA:
          ls_outtab      TYPE ty_s_outtab,
          ls_cell        TYPE lvc_s_modi.
      ENDMETHOD.                    "handle_data_changed_finished
      METHOD handle_user_command.
      ENDMETHOD.                    "handle_user_command
      METHOD handle_toolbar.
    *   define local data
        DATA:
          ls_button    TYPE stb_button.
        ls_button-function  = 'DEFAULT'.
        ls_button-icon      = icon_mass_change.
        ls_button-quickinfo = 'Set default value for column'.
        APPEND ls_button TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM knb1 INTO TABLE gt_outtab UP TO 20 ROWS
        WHERE bukrs = '1000'.
      gt_outtab_pbo = gt_outtab.  " store PBO data
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Build fieldcatalog
      PERFORM build_fieldcatalog.
      PERFORM set_layout.
      SET HANDLER:
        lcl_eventhandler=>handle_toolbar               FOR go_grid,
        lcl_eventhandler=>handle_data_changed          FOR go_grid,
        lcl_eventhandler=>handle_data_changed_finished FOR go_grid.
    * Display data
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
        CHANGING
          it_outtab       = gt_outtab
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          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.
      go_grid->set_toolbar_interactive( ).
      CALL METHOD go_grid->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter
        EXCEPTIONS
          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.
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    * Flow logic (no elements on screen):
    *  PROCESS BEFORE OUTPUT.
    *    MODULE STATUS_0100.
    *  PROCESS AFTER INPUT.
    *    MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
      CALL METHOD go_grid->refresh_table_display
    *      EXPORTING
    *        IS_STABLE      =
    *        I_SOFT_REFRESH =
        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.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      TRANSLATE gd_okcode TO UPPER CASE.
    * Fetch changes on ALV grid
      go_grid->check_changed_data( ).
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'REFRESH'.
          PERFORM refresh_outtab.
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      " Set required fields editable
      LOOP AT gt_fcat INTO ls_fcat
                      WHERE ( fieldname = 'ZUAWA'  OR
                              fieldname = 'BUSAB' ).
        ls_fcat-edit    = abap_true.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
      DELETE gt_fcat WHERE ( fieldname = 'ZINRT' ).
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout .
      CLEAR: gs_layout.
      gs_layout-cwidth_opt = abap_true.
      gs_layout-zebra      = abap_true.
    **  gs_layout-stylefname = 'CELLTAB'.
    ENDFORM.                    " SET_LAYOUT
    *&      Form  REFRESH_OUTTAB
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM refresh_outtab .
    * define local data
      DATA:
        ld_idx       TYPE i,
        ls_outtab    TYPE ty_s_outtab,
        ls_tmp       TYPE ty_s_outtab,
        lt_tmp       TYPE ty_t_outtab.
      " Simulate selection of data depending on value of ZUAWA
      ls_tmp-zuawa = '003'.
      ls_tmp-busab = 'K1'.  APPEND ls_tmp TO lt_tmp.
      ls_tmp-busab = 'K2'.  APPEND ls_tmp TO lt_tmp.
      ls_tmp-busab = 'K3'.  APPEND ls_tmp TO lt_tmp.
      LOOP AT gt_outtab INTO ls_outtab
                        WHERE ( zuawa = '003'
                        AND     busab IS INITIAL ).
        ld_idx = syst-tabix.
        LOOP AT lt_tmp INTO ls_tmp.
          ls_outtab-busab = ls_tmp-busab.
          IF ( syst-tabix = 1 ).
            MODIFY gt_outtab FROM ls_outtab INDEX ld_idx.
          ELSE.
            APPEND ls_outtab TO gt_outtab.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " REFRESH_OUTTAB
    *&      Form  SAVE_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM save_data .
    * define local data
      DATA:
        ls_outtab    TYPE ty_s_outtab,
        ls_pbo       TYPE ty_s_outtab,
        lt_insert    TYPE ty_t_outtab,
        lt_delete    TYPE ty_t_outtab.
    " Compare PBO with PAI -> find deleted records
      LOOP AT gt_outtab_pbo INTO ls_pbo.
        READ TABLE gt_outtab INTO ls_outtab
             WITH KEY table_line = ls_pbo.
        IF ( syst-subrc NE 0 ).
          APPEND ls_outtab TO lt_delete.
        ENDIF.
      ENDLOOP.
    " Compare PAI with PBO data -> find new records
      LOOP AT gt_outtab INTO ls_outtab.
        READ TABLE gt_outtab_pbo INTO ls_pbo
             WITH KEY table_line = ls_outtab.
        IF ( syst-subrc NE 0 ).
          APPEND ls_outtab TO lt_insert.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'KNB1'
          i_grid_title     = 'New Records'
        TABLES
          t_outtab         = lt_insert
        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.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'KNB1'
          i_grid_title     = 'Deleted Records'
        TABLES
          t_outtab         = lt_delete
        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.
      gt_outtab_pbo = gt_outtab.  " do not forget !!!
    ENDFORM.                    " SAVE_DATA
    Regards
      Uwe

  • ALV grid disable right click options

    Hi experts,
    Iam working on <b>normal</b> ALV grid.
    In the output of the ALV, if we click right click,
    we can see 'Cut', 'Copy text', 'Insert with Overwirte' options.
    How can i disable(or remove) these 3 options?
    Pls give me suggestions
    Reward guaranteed,
    thanks
    kaki

    Hello Kaki
    You have to handle event <b>CONTEXT_MENU_REQUEST</b> (of class CL_GUI_ALV_GRID). The following sample report shows how to do that:
    *& Report  ZUS_SDN_ALV_CONTEXT_MENU_1
    *& Flow logic of screen 100 (no screen elements; ok_code = GD_OKCODE)
    *&    PROCESS BEFORE OUTPUT.
    *&      MODULE STATUS_0100.
    *&    PROCESS AFTER INPUT.
    *&      MODULE USER_COMMAND_0100.
    REPORT  zus_sdn_alv_context_menu_1.
    DATA:
      gd_okcode        TYPE ui_func,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_cell_top      TYPE REF TO cl_gui_container,
      go_cell_bottom   TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gt_knb1          TYPE STANDARD TABLE OF knb1,
      gt_knvv          TYPE STANDARD TABLE OF knvv.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender,
          handle_context_menu_request FOR EVENT context_menu_request
                                                     OF cl_gui_alv_grid
            IMPORTING
              e_object
              sender,
          handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING
              e_ucomm
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_knb1      TYPE knb1.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
    *        IS_ROW_ID    =
    *        IS_COLUMN_ID =
            is_row_no    = es_row_no.
    *   Triggers PAI of the dynpro with the specified ok-code
        CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
      ENDMETHOD.                    "handle_double_click
      METHOD handle_context_menu_request.
    *   define local data
        DATA: lt_fcodes    TYPE ui_funcattr,
              ls_fcode     TYPE uiattentry,
              ls_func      TYPE ui_func,
              lt_func      TYPE ui_functions.
        "   Inactivate all standard functions
        CALL METHOD e_object->get_functions
          IMPORTING
            fcodes = lt_fcodes.
        LOOP AT lt_fcodes INTO ls_fcode.
          ls_func = ls_fcode-fcode.
          APPEND ls_func TO lt_func.
        ENDLOOP.
        e_object->disable_functions( lt_func ).
    "   Add new functions
        e_object->add_separator( ).
        CALL METHOD e_object->add_function
          EXPORTING
            fcode = 'XD03'
            text  = 'Call Transaction'.
        CALL METHOD e_object->add_function
          EXPORTING
            fcode = 'DETAILS'
            text  = 'Display Details'.
      ENDMETHOD.                    "handle_context_menu_request
      METHOD handle_user_command.
    *   define local data
        DATA:
          ls_knb1   TYPE knb1,
          ls_row    TYPE lvc_s_row,
          ls_col    TYPE lvc_s_col.
        "   NOTE: in case of CL_GUI_ALV_GRID the functions of a context menu
        "         are handled in method USER_COMMAND.
        CHECK ( e_ucomm = 'XD03'      OR
                e_ucomm = 'DETAILS' ).
        CALL METHOD sender->get_current_cell
          IMPORTING
            es_row_id = ls_row
            es_col_id = ls_col.
        CASE e_ucomm.
          WHEN 'XD03'.
            READ TABLE gt_knb1 INTO ls_knb1 INDEX ls_row-index.
            SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
            SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          WHEN 'DETAILS'.
      "       NOTE: only for the sake of simplicity the event handler method
            "             is called
            CALL METHOD lcl_eventhandler=>handle_double_click
              EXPORTING
                e_row  = ls_row
                sender = go_grid1.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.                    "handle_user_command
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1
             WHERE  bukrs  = '1000'.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 2
          columns           = 1
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = go_cell_bottom.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_cell_top
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click         FOR go_grid1,
        lcl_eventhandler=>handle_context_menu_request FOR go_grid1,
        lcl_eventhandler=>handle_user_command         FOR go_grid1.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_cell_bottom
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Display data
      gs_layout-grid_title = 'Customers'.
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          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.
      gs_layout-grid_title = 'Customers Details (Sales Areas)'.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNVV'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knvv  " empty !!!
        EXCEPTIONS
          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.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid2->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          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.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
    *   User has pushed button "Display Details"
        WHEN 'DETAIL'.
          PERFORM entry_show_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  ENTRY_SHOW_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM entry_show_details .
    * define local data
      DATA:
        ld_row      TYPE i,
        ls_knb1     TYPE knb1.
      CALL METHOD go_grid1->get_current_cell
        IMPORTING
          e_row = ld_row.
      READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
      CHECK ( syst-subrc = 0 ).
      SELECT        * FROM  knvv INTO TABLE gt_knvv
             WHERE  kunnr  = ls_knb1-kunnr.
    ENDFORM.                    " ENTRY_SHOW_DETAILS
    Regards
      Uwe

  • Refresh ALV Report after return from dialog screen

    Hi All,
    I have developed an alv report which lists new products, when user clicks on a product it will take to custom dialog screen where user makes neccessary changes. Once the changes are done user clicks back the control comes back to the ALV report.
    My question is when they come back to ALV report it should refresh and list the new products. Basically I want to know is it possible to refresh the report when control is coming back from dialog screen to ALV report.
    Pls provide me a best way to handle this scenario.
    Regards,
    Anand

    Hi Archna
    This is the code I am using
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = v_repid
          i_callback_user_command = 'USER_COMMAND'
          i_callback_top_of_page  = 'TOP_OF_PAGE'
          i_grid_title            = i_title
          it_fieldcat             = it_fcat
          it_events               = v_events
          i_save                  = 'A'
        TABLES
          t_outtab                = it_alv_cvg.
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE it_alv_map INTO wa_alv INDEX rs_selfield-tabindex.
          IF sy-subrc = 0.
            SET PARAMETER ID 'ZCR' FIELD wa_alv-product.
            CALL TRANSACTION 'ZSD_PRODUCT_DIV' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    ENDFORM.   
    After it goes to dialog when I clcik back it comes  back to the alv report.
    Now can you Pls tell me where to use the refresh.
    Regards,
    Anand

  • ALV Grid Control Double click error

    Hi
    In my Editable ALV Grid Control I input the data ,then click save, the program display error msg if any errors , then i double click in any field ,after that I exit from the program , here i dont want this after double click also the control should be on the same field.Pleace help me out this issue.
    THX

    But what you will do with the error data. you tell me that.
    Don't update some error values to DB.
    if you don't want error then check this sample code.
    report  ztest_alv_edit.
    data: it_flight type standard table of sflight.
    data: it_fcat type lvc_t_fcat,
          wa_fcat type lvc_s_fcat.
    data: grid type ref to cl_gui_alv_grid,
          cont type ref to cl_gui_custom_container.
    class lcl_event_receiver definition deferred.
    data: g_handler type ref to lcl_event_receiver.
    *       CLASS lcl_event_receiver DEFINITION
    class lcl_event_receiver definition.
      public section.
        methods:
          handle_data_changed
             for event data_changed of cl_gui_alv_grid
                 importing er_data_changed.
    endclass.                    "lcl_event_receiver DEFINITION
    *       CLASS lcl_event_receiver IMPLEMENTATION
    class lcl_event_receiver implementation.
      method handle_data_changed.
       "this is important
       "this will stop poping the message
       clear er_data_changed->mt_protocol.
      endmethod.                    "handle_data_changed
    endclass.                    "lcl_event_receiver IMPLEMENTATION
    start-of-selection.
      select * from sflight
      into table it_flight
      up to 20 rows.
    end-of-selection.
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module status_0100 output.
      set pf-status 'STATUS'.
      if cont is initial.
        call function 'LVC_FIELDCATALOG_MERGE'
          exporting
            i_structure_name       = 'SFLIGHT'
          changing
            ct_fieldcat            = it_fcat
          exceptions
            inconsistent_interface = 1
            program_error          = 2.
        create object cont
          exporting
            container_name              = 'CONT'
          exceptions
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            others                      = 6
        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.
        wa_fcat-edit = 'X'.
        wa_fcat-checktable = '!'.
        modify it_fcat from wa_fcat transporting edit checktable
        where fieldname = 'FLDATE'
        create object grid
          exporting
            i_parent          = cont
          exceptions
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            others            = 5
        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.
        call method grid->set_table_for_first_display(
           changing
             it_outtab                     = it_flight
             it_fieldcatalog               = it_fcat
           exceptions
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
        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.
        "Important for editable grid
         call method grid->register_edit_event
                   exporting
                      i_event_id = cl_gui_alv_grid=>mc_evt_enter.
         create object g_handler.
        "setting the handler
        set handler  g_handler->handle_data_changed for grid.
      endif.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    module user_command_0100 input.
      "important method to trigger the DATA_CHANGED event
      call method grid->check_changed_data.
      case sy-ucomm.
        when 'BACK'.
          leave to screen 0.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT

  • Need to retain the screen input after user clicks BACK

    Hi,
    I have a report program in HR, using LDB "PNP" and Report category : PSSPCDOC.
    After the program is executed and the report is displayed on screen, if the user clicks the BACK button (F3), the selection screen is displayed with initial values. The input values provided by the user previously get lost.
    I debugged and it seems that the memory gets cleared everytime the BACK button is clicked.
    But i want to retain the user inputs on the selection screen if the user clicks the BACK button because the user wants to change some selection inputs not all.
    I am new to HR module, please let me know how to solve this issue.

    Hi,
    In your screen in the application bar,the right most button  is a coloured monitor kind of icon, next to the Help icon (which is a white question mark in a yellow circle) ,click on this monitor icon ,then under the  Local Data tab there is a History Block, select radio button History ON.
    I hope it helps.
    Regards,
    Shraddha

  • How can i show details in ALV GRID with double click in a row?

    Hello, ich try to show the details of a row with double click in the line,
    but it doesn't work!?
    I have a eventhandler for doubleclick and the program run this code, but what i have to do, to show the details!?
    I try it with some methods like cl_gui_cfw=>set_new_ok_code, ...
    i think about the methods cl_gui_alv_grid->show_detail, but this method is private,
    i can create a class with inheritance of the cl_gui_alv_grid class and try this method!?
    Have anybody any ideas!?

    Hello Lars
    The following sample reports shows an ALV list with company codes. Double-clicking on any company code will open a second ALV list displaying all customers.
    *& Report  ZUS_SDN_ALVGRID_EVENTS_1
    REPORT  zus_sdn_alvgrid_events_1.
    DATA:
      gd_okcode        TYPE ui_func,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_docking2      TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_t001          TYPE STANDARD TABLE OF t001,
      gt_knb1          TYPE STANDARD TABLE OF knb1.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_t001     TYPE t001,
          ls_col_id   TYPE lvc_s_col.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_t001 INTO ls_t001 INDEX e_row-index.
        CHECK ( ls_t001-bukrs IS NOT INITIAL ).
        SELECT * FROM knb1 INTO TABLE gt_knb1
          WHERE bukrs = ls_t001-bukrs.
        IF ( syst-subrc NE 0 ).
          MESSAGE 'No customers found' TYPE 'S'.
        ELSE.
    *     Trigger PAI of dynpro '0100' and set new ok-code
          CALL METHOD cl_gui_cfw=>set_new_ok_code( 'CALL_SCREEN_0200' ).
        ENDIF.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM t001 INTO TABLE gt_t001.
      REFRESH: gt_knb1.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_docking2
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_docking2
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'T001'
        CHANGING
          it_outtab        = gt_t001
        EXCEPTIONS
          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.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          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.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
      CALL METHOD go_docking2->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0200'
    *      CONTAINER                   =
        EXCEPTIONS
          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.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'CALL_SCREEN_0200'.
          go_grid2->refresh_table_display( ).  " necessary
          CALL SCREEN '0200'.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Regards
      Uwe

  • Refresh alv grid

    i have an alv grid with 4 rows
    i mark 1 line and click on button and  now i have 3 lines and i see it in debug
    but when i get back to screen i see 4
    i try refresh-table_display
    any idea....,

    If line is deleted from internal table and you call refresh_table_display, it should refresh the table.
    Please check you are not reselecting data in PBO.
    Regards,
    Mohaiyuddin

  • Beginner ALV Grid question (using OO) "Possible Values" doesn't do anything

    Hi,
    I have a working ALV Grid report using the 'CL_CALV_TABLE' class, and FACTORY DISPLAY method.
    Standard Functions are working, got single-click events programmed to drill-down into documents, key columns, etc.
    So the report output seems fine.
    <i>However, some columns / cells have a "possible values" icon, but when selected nothing happens. And some columns have the icon, for example, Material, Co.Code, but then others don't. </i>
    I've looked at example report SALV_DEMO_TABLE_COLUMNS and SALV_TEST_FUNCTIONS, but I can't see any specific code in there that controls this.
    <u>Would appreciate it if anyone can confirm:</u>
    a) what triggers the icon to appear for some columns/cells but not others? Is it the TYPE of the table column?
    b) is any coding needed for the "Possible values" window to popup?
    TIA,
    James

    Seems like f4availabl field is enabled in field catalog.

  • How to identify column name in ALV tree when user clicks a particular field

    Hi All,
    In My requirement i am displaying ALV Tree.
    In Which When the user clicks on a particular header column it should navigate to other transaction.
    Now the issue is it is navigating to other transaction when we click on any column of the header row.
    But, the user requires only for particular column .
    Is there any method  to catch the field name in CLASS 'CL_GUI_ALV_TREE'.
    Regards,
    Bhanu.R

    Check out for CUCOL system field.
    Regards,
    Lalit Mohan Gupta.

  • Go to transaction after user clicks on report.

    Hello experts,
    Our users want that when they click on the report output, they want to go to a particular
    transaction in this case transaction AW01N(Asset Explorer) to see the values of that asset.
    So what I want to do is that I would make the assets displayed in the report to be a hotspot
    and when the users click on them it would call the AW01N and fill in the company code and asset. How do I do this guys?
    Thanks a lot!

    while displaying your internal table use HIDE to store the value of the field which user selects.
    LOOP AT ITAB.
      write :/ itab1-f1,itab-f2...
      hide itab-f1.
    endloop.
    when ever user selects that value will come into ITAB-F1 field.
    then use
    AT LINE SELECTION EVENT,
    to trigger that transaction
    for that first you have to populate Company code & asset no of that transaction initial screen with the user selected values. for that what you have to do is send these values to memory using
    SET PARAMETER ID 'BUK' FIELD itab-bukrs
    SET PARAMETER ID 'AN1' FIELD itab-ASSETNO
    then
    use CALL TRANSACTION 'code'....
    Regards
    Srikanth
    Message was edited by: Srikanth Kidambi

  • How to cancelling email submission after user clicks "yes/no" button of message box?

    could some one tell me, how can i cancelling the submission event after one user clicks "yes/no" button of message box? The scenario is the following:
    After data input in a dynamic form clicks the user send mail button. Before the email submit, the user has to decide going back to the form and validate the input or continuing to submit email.
    In case of going back to validate input the submission event must not solve. So, how can i implemente it in java and/or form calc script?
    Thanks so much for your help in advance and i am very glad to hearing from you soon!
    Djinges

    Hello,
    The most easy way to solve your problem is to add two buttons, the first should be regular button and the second is submit by e-mail one. Set the
    'presence' property of the second to 'hidden' and add to it your email address. To the first button on 'click' event add the script like this
    form1.#subform[0].Button1::click - (JavaScript, client)
    var answer = xfa.host.messageBox("Send e-mail?","e-mail",2,1);
    if(answer==1){
    EmailSubmitButton1.execEvent('click');
    Hope this helps.

Maybe you are looking for