Handling Double click on a Pop-up screen with ALV Grid

Hello Experts,
I have an issue handling double click on ALV Pop-up screen. I tried to achive this using following steps.
1. I defined a local class in Top-include to handle double click and implemented it in the following way.
CLASS lcl_alv_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
on_double_click FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING e_row
e_column
es_row_no.
ENDCLASS. "lcl_alv_event_handler DEFINITION
*~~~ Implementation code
CLASS lcl_alv_event_handler IMPLEMENTATION.
To handle Selection of Issue data on Screen 100
METHOD on_double_click.
DATA: lt_row_no TYPE lvc_t_roid,
ls_req TYPE zcst_zirt_seltab.
READ TABLE gt_req
INTO ls_req
INDEX e_row-index.
g_req_id = ls_req-zzrequest_id.
gv_selected = true.
CALL METHOD go_alv->dispatch
EXPORTING
cargo = 'OK'
eventid = 3
is_shellevent = ' '
is_systemdispatch = 'X'
EXCEPTIONS
cntl_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.
ENDMETHOD. "on_double_click
ENDCLASS. "lcl_alv_event_handler IMPLEMENTATION
2. Registered the event in the PBO module of the screen
ls_events-eventid = 3.
ls_events-appl_event = gc_true.
APPEND ls_events TO lt_events.
CALL METHOD co_alv->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 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.
CREATE OBJECT co_alv_event_handler.
SET HANDLER: co_alv_event_handler->on_double_click FOR co_alv.
CALL METHOD co_alv->set_toolbar_interactive.
3. In the PAI module of Screen, tried to handle the event 'OK' that waqs registred in PBO.
CASE save_ok.
WHEN 'OK'.
Get selected line
CALL METHOD io_alv->get_selected_rows
IMPORTING
et_index_rows = lt_rows
et_row_no = lt_rows_no.
IF NOT lt_rows IS INITIAL.
READ TABLE lt_rows INTO ls_rows INDEX 1.
IF sy-subrc EQ 0.
gv_selected = 'X'.
READ TABLE it_req
INTO ls_req
INDEX ls_rows-index.
e_req_id = ls_req-zzrequest_id.
SET SCREEN 0.
ENDIF.
ELSE.
SET SCREEN 0.
ENDIF.
With this code what is happening is, when user double clicks a line on Pop-up screen with ALV grid data, the program is able to successfully get into the class implementation but the control is not going to PAI module to execute the OK_code handling part.
Am I doing this in the right way? Appreciate quick suggestions. Proper posts will be thoroughly awarded with points.
Thx.
Minni

Put your code into the Event handler Implementation of Double Click which is there in the PAI Module.
Regards,
Naimesh Patel

Similar Messages

  • Is it possible to create a pop up screen with alv tree within it?

    I was wondering whether it is possible to create a pop up screen where an ALV tree is within the pop up screen and the user may select a record from it..
    is there a function module for such function?

    you may use class cl_gui_alv_tree and display it in a popup screen. Look at RSDEMO_DIALOGBOX_CONTROL program (popup + cl_gui_picture control), and you combine it with BCALV_TREE_04 (cl_gui_alv_tree) to replace cl_gui_picture. You may access all demos from menu SE38, Environment, Examples (and finally Controls Examples in your case)

  • Problem in handling double click in the second alv grid control

    Hi all,
    I have a screen. In the screen , I have 2 custom container and each custom container has 1 alv grid control.
    I need to handle double click event for both of alv grid controls in my screen.
    I defined 2 local event handler class for each alv grid and defined 2 handle_double_click event.
    In the first Alv grid double click works fine , everything is ok, world is peaceful.
    But in the second alvgrid, the row parameters (E_ROW, E_COLUMN, ES_ROW_NO) comes initial so i cannot handle it.
    All i need is to call a different transaction (displaying the equipment-IE03) when user double-click on a field in the second alv grid control. I tried to use hotspot_click event too but it does'nt give the row id either.
    I read some posts in the forms ([Double click event of alv grid control|Double click event of alv grid control]).
    I tried everything but nothing works.
    Please help. Your answers will be appreciated.

    Hello Eagle
    I am not sure where the problem lies in your case but sample report ZUS_SDN_THREE_ALV_GRIDS_01 shows that you can always find out the current cell after the double-click event (in any case you have the current cell already as IMPORTING parameters of the event):
    *& Report  ZUS_SDN_THREE_ALV_GRIDS_01
    *& Flow logic of screen '0100' (no screen elements, ok-code => GD_OKCODE):
    **    PROCESS BEFORE OUTPUT.
    **      MODULE STATUS_0100.
    **    PROCESS AFTER INPUT.
    **      MODULE USER_COMMAND_0100.
    *& Thread: problem in handling double click in the second alv grid control
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1172052"></a>
    REPORT  zus_sdn_three_alv_grids_01.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_splitter_2    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_cell_left     TYPE REF TO cl_gui_container,
      go_cell_right    TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      go_grid3         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_outtab        TYPE STANDARD TABLE OF vbak,
      gt_outtab_2      TYPE STANDARD TABLE OF vbap,
      gt_outtab_3      TYPE STANDARD TABLE OF vbep.
    **PARAMETERS:
    **  p_bukrs          TYPE bukrs  DEFAULT '1000'.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          ms_row      TYPE lvc_s_row,
          ms_col      TYPE lvc_s_col.
        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_outtab      TYPE vbak,
          ls_outtab_2    TYPE vbap,
          ls_outtab_3    TYPE vbep.
        "   Initialize class data
        CLEAR: ms_row,
               ms_col.
        CASE sender.
          WHEN go_grid1.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_ITEMS'
    *          IMPORTING
    *            rc       =
          WHEN go_grid2.
            ms_row = e_row.
            ms_col = e_column.
    *       Triggers PAI of the dynpro with the specified ok-code
            CALL METHOD cl_gui_cfw=>set_new_ok_code
              EXPORTING
                new_code = 'GET_SCHEDULE_LINES'
    *          IMPORTING
    *            rc       =
          WHEN go_grid3.
    **        READ TABLE gt_vbap INTO ls_vbap INDEX e_row-index.
    **        CHECK ( ls_vbap-matnr IS NOT INITIAL ).
    **        SET PARAMETER ID 'MAT' FIELD ls_vbap-matnr.
    **        CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  vbak INTO TABLE gt_outtab UP TO 100 ROWS.
      PERFORM init_controls.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAK'
        CHANGING
          it_outtab        = gt_outtab
        EXCEPTIONS
          OTHERS           = 4.
      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.
      REFRESH: gt_outtab_2.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAP'
        CHANGING
          it_outtab        = gt_outtab_2    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      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.
      REFRESH: gt_outtab_3.
      CALL METHOD go_grid3->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBEP'
        CHANGING
          it_outtab        = gt_outtab_3    " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      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.
    * 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 NE 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:
    *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 "ORDERS"
    *  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 NE 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Refresh display of detail ALV list
      CALL METHOD go_grid3->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          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.
    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.
        " Double-click on first or second ALV grid
        WHEN 'GET_ITEMS'  OR
             'GET_SCHEDULE_LINES'.
          PERFORM get_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          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.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 1
          columns           = 2
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 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.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_left.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 2
        RECEIVING
          container = go_cell_right.
    * Create 2nd splitter container
      CREATE OBJECT go_splitter_2
        EXPORTING
          parent            = go_cell_left
          rows              = 2
          columns           = 1
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 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.
    * Get cell container
      CALL METHOD go_splitter_2->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter_2->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 NE 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_cell_bottom
        EXCEPTIONS
          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.
      CREATE OBJECT go_grid3
        EXPORTING
          i_parent = go_cell_right
        EXCEPTIONS
          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.
    * Set event handler
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid2.
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid3.
    ENDFORM.                    " INIT_CONTROLS
    *&      Form  GET_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_details .
    * define local data
      DATA: ls_row      TYPE lvc_s_row,
            ls_col      TYPE lvc_s_col.
      data: ls_outtab   type vbak,
            ls_outtab_2 type vbap,
            ls_outtab_3 type vbep.
      BREAK-POINT.
      CASE gd_okcode.
        WHEN 'GET_ITEMS'.
          CALL METHOD go_grid1->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          read TABLE gt_outtab into ls_outtab index ls_row-index.
          refresh: gt_outtab_2,
                   gt_outtab_3.
          SELECT        * FROM  vbap into TABLE gt_outtab_2
                 WHERE  vbeln  = ls_outtab-vbeln.
        WHEN 'GET_SCHEDULE_LINES'.
          CALL METHOD go_grid2->get_current_cell
            IMPORTING
    *          e_row     =
    *          e_value   =
    *          e_col     =
              es_row_id = ls_row
              es_col_id = ls_col
    *          es_row_no =
          READ TABLE gt_outtab_2 into ls_outtab_2 index ls_row-index.
          refresh: gt_outtab_3.
          SELECT        * FROM  vbep into TABLE gt_outtab_3
                 WHERE  vbeln  = ls_outtab_2-vbeln
                 AND    posnr  = ls_outtab_2-posnr.
        WHEN OTHERS.
          RETURN.
      ENDCASE.
      IF ( lcl_eventhandler=>ms_row = ls_row  AND
           lcl_eventhandler=>ms_col = ls_col ).
        MESSAGE 'Current cell identical'  TYPE 'I'.
      ELSE.
        MESSAGE 'Current cell NOT identical'  TYPE 'I'.
      ENDIF.
    ENDFORM.                    " GET_DETAILS
    Regards
      Uwe

  • Handling double click event in oops alv

    I need to write a interactive alv where,can any one help me in handling double click event using oops.

    Hello,
    Demo program on interactive ALV using OOPS
    REPORT  ZALV_OOINTERACTIVE.*Class definition for handling double click
    CLASS event_class DEFINITION DEFERRED.*Internal table and work area declarations for dd02l and dd03l
    DATA : it_dd02l TYPE TABLE OF dd02l,
           wa_dd02l TYPE dd02l,
           it_dd03l TYPE TABLE OF dd03l,
           wa_dd03l TYPE dd03l.*data declarations for ALV Main list
    DATA : ty_lay1 TYPE lvc_s_layo,
           it_fieldcat TYPE lvc_t_fcat ,
           ty_fieldcat TYPE lvc_s_fcat ,
           c_alv1 TYPE REF TO cl_gui_alv_grid,
           c_cont1 TYPE REF TO cl_gui_custom_container,
           event_receiver TYPE REF TO event_class.*data declarations for ALV Interactive listDATA : ty_lay2 TYPE lvc_s_layo,
           it_fcat TYPE lvc_t_fcat ,
           ty_fcat TYPE lvc_s_fcat ,
           c_alv2 TYPE REF TO cl_gui_alv_grid,
           c_cont2 TYPE REF TO cl_gui_custom_container.
    **Select options for multiple values and NOT ranges
    SELECT-OPTIONS : s_table FOR wa_dd02l-tabname NO INTERVALS.
    Initialization event
    INITIALIZATION.*Start of selection event
    START-OF-SELECTION.*fetch data into table and field characteristics
      PERFORM fetch_data.*ALV display for output
      PERFORM alv_output.&----
    *&      Form  FETCH_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .*Select the table details
      SELECT * FROM dd02l INTO CORRESPONDING FIELDS OF TABLE it_dd02l 
    WHERE tabname IN s_table
      AND tabclass = 'TRANSP'.
    ENDFORM.                    " FETCH_DATA----* CLASS lcl_event_receiver DEFINITION----CLASS event_class DEFINITION.*Handling double click
      PUBLIC SECTION.    METHODS:
        handle_double_click
        FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row .ENDCLASS. "lcl_event_receiver DEFINITION
    ----* CLASS lcl_event_receiver IMPLEMENTATION
    ----CLASS event_class IMPLEMENTATION.  METHOD handle_double_click.    DATA : ls_dd02l LIKE LINE OF it_dd02l.*Reading the selected data into a variable
        READ TABLE it_dd02l INDEX e_row-index INTO ls_dd02l.*  *Select the field details of the selected table
        SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
        WHERE tabname EQ ls_dd02l-tabname.
    *calling the ALV containing the field values
        CALL SCREEN 101.  ENDMETHOD. "handle_double_clickENDCLASS. "lcl_event_receiver IMPLEMENTATION&----& Module pbo_100 OUTPUT&----
    *MODULE pbo_100 OUTPUT.
    *set pf-status 'XXX'.
    *set titlebar 'XXX'.
    ENDMODULE. " PBO_100 OUTPUT
    *& Module alv_100 OUTPUT
    &----MODULE alv_100 OUTPUT.*Check if there is no custom container in screen 100
      IF c_cont1 IS INITIAL.*Creating object of container
        CREATE OBJECT c_cont1
         EXPORTING
           container_name = 'CCONT'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*Creating object of alv
        CREATE OBJECT c_alv1
           EXPORTING
            i_parent = c_cont1.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*alv layout
        PERFORM alv_100_layout.*alv field catalogue
        PERFORM alv_100_fieldcat.*Displaying the ALV grid
        CALL METHOD c_alv1->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay1
          CHANGING
            it_outtab       = it_dd02l[]
            it_fieldcatalog = it_fieldcat.    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 of the event class and setting handler for double click
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR c_alv1.  ENDIF.ENDMODULE. " ALV_100 OUTPUT&----& Module pai_100 INPUT&----
    *MODULE pai_100 INPUT.
    ENDMODULE. " pai_100 INPUT----* MODULE PBO_101 OUTPUT----MODULE pbo_101 OUTPUT.
    SET PF-STATUS 'XXX'.
    SET TITLEBAR 'XXX'.
    ENDMODULE. " PBO_101 INPUT----* MODULE ALV_101 OUTPUT----
    MODULE alv_101 OUTPUT.
    *Check if the Custom container exists.
      IF c_cont2 IS INITIAL.*Creating container object
        CREATE OBJECT c_cont2
          EXPORTING
            container_name = 'CDCONT'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*creating ALV grid for interactive list
        CREATE OBJECT c_alv2
          EXPORTING
           i_parent = c_cont2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*ALV layout
        PERFORM alv_101_layout.*ALV fieldcatalogue
        PERFORM alv_101_fieldcat.*Sorting the output by field position
        SORT it_dd03l BY position.*ALV for display field details
        CALL METHOD c_alv2->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay2
          CHANGING
            it_outtab       = it_dd03l[]
            it_fieldcatalog = it_fcat.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.  ENDIF.ENDMODULE. " ALV_101 OUTPUT
    &----& Module PAI_101 INPUT&----
    *MODULE pai_101 INPUT.ENDMODULE. " PAI_101 INPUT
    *&      Form  ALV_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_output .
      CALL SCREEN 100.ENDFORM.                    " ALV_OUTPUT
    *&      Form  ALV_100_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_layout .  ty_lay1-grid_title = 'TABLES'.
      ty_lay1-zebra = 'X'.
      ty_lay1-no_toolbar = 'X'.ENDFORM.                    " ALV_100_LAYOUT
    *&      Form  ALV_100_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_fieldcat .
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 1.
      ty_fieldcat-fieldname = 'TABNAME'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'TableName'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 2.
      ty_fieldcat-fieldname = 'TABCLASS'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'CATEGORY'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 3.
      ty_fieldcat-fieldname = 'AS4USER'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'CREATED'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 4.
      ty_fieldcat-fieldname = 'AS4DATE'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'DATE'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 5.
      ty_fieldcat-fieldname = 'AS4TIME'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'TIME'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 6.
      ty_fieldcat-fieldname = 'CONTFLAG'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'Delivery Class'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.ENDFORM.                    " ALV_100_FIELDCAT
    *&      Form  ALV_101_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_layout .  ty_lay2-grid_title = 'FIELDS'.
      ty_lay2-zebra = 'X'.
      ty_lay2-no_toolbar = 'X'.ENDFORM.                    " ALV_101_LAYOUT
    *&      Form  ALV_101_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_fieldcat .  REFRESH it_fieldcat.
      REFRESH it_fcat.
      CLEAR ty_fcat.  ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 1.
      ty_fcat-fieldname = 'FIELDNAME'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'Fieldname'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.
      ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 2.
      ty_fcat-fieldname = 'CHECKTABLE'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'CHECKTABLE'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.  ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 3.
      ty_fcat-fieldname = 'KEYFLAG'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'Key Flag'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.ENDFORM.                    " ALV_101_FIELDCAT

  • How to handle double click in a table control?

    Hi,
    Can any one let me how to handle double click event in a table control in dialog programming?
    here i need to navigate to another screen when user double click on the table contols (emp number column).
    thanks in advance,
    PrasadBabu.

    to define double click in your table controlwhich is similar to 'PICK' function. Enable F2 in PF-status for this
    Table Control Question
    Check the above thread which was posted recently on SDN, please award points if found helpful

  • How to handle double click event in a text control

    Hi,
       Will u please send me information on handling double click events inside text control and also about locking and unlocking of DB tables for updation.
    Regards,
    Praba.

    Hi Prabhavathi,
    Here is how you handle double click events in Textedit control.
    1)Create a custom control in screen (say TEXT_CONTROL)
    2)In main program,
    a) Declarations:
    data: obj type ref to cl_gui_custiom_control.
          text type ref to cl_gui_textedit.
    b) Create the instance of custom container
    c) Create the instance of textedit control.
    3)Now to handle double click events , create a local class as follows.
    class shail_event definition.
    public section.
    methods:
    handle_doubleclick for event dblclick of cl_gui_textedit .
    endclass.
    class shail_event implementation.
    method handle_doubleclick .
    here do the coding for handling the double click.
    endmethod.
    endclass.
    4) Create an instance of the handler class(ie.ZSHAIL_EVENT).Let it be named hand.
    5) Define varibles for event.
    DATA: i_events TYPE cntl_simple_events,
          wa_events TYPE cntl_simple_event.
    SET HANDLER hand->handle_doubleclick for text.
    wa_events-eventid = cl_gui_textedit=>event_double_click.
    wa_events-appl_event = 'X'. "This is an application event
    APPEND wa_events TO i_events.
    6)
        CALL METHOD texte->set_registered_events
          EXPORTING
            events                    = i_events
          EXCEPTIONS
            cntl_error                = 1
            cntl_system_error         = 2
            illegal_event_combination = 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.
    These are the basic steps needed for handling events in Textedit control.You can go to SE24 and type CL_GUI_TEXTEDIT to find the associated events of the class.
    If you want the program, kindly send your mail-id so that I can mail it to you.
    Regards,
    Sylendra.

  • Handling double-click in tabstrips.

    Hi All,
    I have a requirement in which there is a tabstrip with 4 tabs ( it is in second screen). Based on the number of tabs selected by the user in first screen, those many tabs will be active in second screen.
    Here each tab indicates a different transaction code.
    We have set the first tab selected by the user as the default tab in the second screen.When we double click on the data displayed in the subscreen area , it should navigate to the respective transaction code.
    Currently, when we double click on the data in the default subscreen area, it does not navigate, but when we toggle between the tabs and then come back to the default tab screen then it navigates as expected.
    Please let me how to handle double click functionality for the default tab set by the user without the need to toggle between the tabs.
    Thanks in advance.

    Hi All,
    I have a requirement in which there is a tabstrip with 4 tabs ( it is in second screen). Based on the number of tabs selected by the user in first screen, those many tabs will be active in second screen.
    Here each tab indicates a different transaction code.
    We have set the first tab selected by the user as the default tab in the second screen.When we double click on the data displayed in the subscreen area , it should navigate to the respective transaction code.
    Currently, when we double click on the data in the default subscreen area, it does not navigate, but when we toggle between the tabs and then come back to the default tab screen then it navigates as expected.
    Please let me how to handle double click functionality for the default tab set by the user without the need to toggle between the tabs.
    Thanks in advance.

  • If I click on an e-mail address link in a web page instead of a blank message opening I always get a pop up screen with a log-in for googlemail. I do not have and do not want a googlemail account. I just want to be able to send e-mails using Outlook.

    If I click on an e-mail address link in a web page instead of a blank message opening I always get a pop up screen with a log-in for googlemail. I do not have and do not want a googlemail account. I just want to be able to send e-mails using Outlook.

    OUtlook was already set as the mail client for FF, and is my operating system (XP)'s default mail programme. therefore problem not solved at all. what I get whenever I follow a link in a webpage to send an e-mail is a little pop up window asking me to sign in to gmail or open an account. any other suggestions?

  • Handle double click for alv_tree?

    hej out there,
    as you may remember I'm doing some updates to UIs.
    Somehow it should be possible to make alv_tree handle double_click events, shouldn't it?
    I don't know how to go on. I found some methods but they don't work properly (or as expected).
    I know there are methods to do so with simple_tree... hmpf. But it would be the worst solution to switch technique to simple_tree.
    regards and thanks in advance,
    BS

    Hej,
    I gotta do it using alv-tree.
    And I tried it the following way (just did a short and quick example which remains fundamentally the same to my old report).
    But the way it's done in the following code snipped it won't work... if decomment
    *    event-eventid = cl_gui_alv_tree=>eventid_node_double_click .
    *    event-appl_event = ' ' .
    *    APPEND event TO events .
    the message will be raised telling node double click has been handled... but not a single node can be expanded anymore.
    CLASS event DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_node_dblclick
            FOR EVENT node_double_click
                   OF cl_gui_alv_tree
            IMPORTING node_key.
    ENDCLASS.
    CLASS event IMPLEMENTATION.
      METHOD handle_node_dblclick.
        DATA:
          l_carrid TYPE spfli-carrid,
          l_connid TYPE spfli-connid.
        l_carrid = node_key(2).
        l_connid = node_key+2(4).
        MESSAGE i001(ZBOBOPP1) WITH 'handled double click'
                                    l_carrid
                                    l_connid .
      ENDMETHOD.
    ENDCLASS.
      DATA:
        ctrlcontainer TYPE REF TO cl_gui_docking_container ,
        treectrl      TYPE REF TO cl_gui_alv_tree ,
        evt           TYPE REF TO event ,
        tblpointer    TYPE TABLE OF scustom ,
        fieldcat      TYPE lvc_t_fcat ,
        hierhead      TYPE treev_hhdr ,
        events        TYPE cntl_simple_events ,
        event         TYPE cntl_simple_event .
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'S_100'.
      SET TITLEBAR 'T_100'.
      IF ctrlcontainer IS INITIAL .
        CREATE OBJECT evt.
        CREATE OBJECT ctrlcontainer
          EXPORTING
            extension = 900 .
        CREATE OBJECT treectrl
          EXPORTING
            parent         = ctrlcontainer
            no_html_header = 'X' .
        PERFORM adjcolarea
          CHANGING fieldcat.
        hierhead-heading   = 'Land/Kundenname/Kunde'(300).
        hierhead-tooltip   = 'Name des Kunden'(400).
        hierhead-width     = 45.
        hierhead-width_pix = space.
        CALL METHOD treectrl->set_table_for_first_display
          EXPORTING
            is_hierarchy_header = hierhead
          CHANGING
            it_outtab           = tblpointer
            it_fieldcatalog     = fieldcat.
    *    event-eventid = cl_gui_alv_tree=>eventid_node_double_click .
    *    event-appl_event = ' ' .
    *    APPEND event TO events .
    *    CALL METHOD treectrl->set_registered_events
    *      EXPORTING
    *        events = events .
        SET HANDLER evt->handle_node_dblclick FOR treectrl .
        PERFORM select_data_and_fill_col_tree .
        CALL METHOD treectrl->frontend_update .
        CALL METHOD cl_gui_cfw=>flush .
      ENDIF .
    ENDMODULE .                 " STATUS_0100  OUTPUT
    Thanks,
    BS
    Message was edited by: Boris Schoessow

  • I see slis everywhere while trying to handle double click

    I want to handle double click event of the alv grid but I could not reach any problem solving answer in documents.
    Am I required to write a class to handle user clicks on alv grid?
    Please send me a code segment on this subject. The procedure also would be very helpful.
    Thanks in advance.

    hi,
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' Or list display
    EXPORTING
    I_CALLBACK_PROGRAM = sy-repid
    I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND' " FORM NAME
    IT_FIELDCAT = GT_FIELDCAT
    TABLES
    T_OUTTAB = ITAB
    Here comes the interaction part
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_UCOMM.        "system fileds
    When '&IC1'.                   "this is Fcodce for double click
    if rs_selfield-fieldname = '<your field name>'    "give the field name on whcih you will double click
    Write your code here..
    fetch data from DB tables and put in internal tables and again use reuse_ALV_grid_display function module you will get interactive list
    else
    you can use "REUSE_ALV_POPUP_TO_SELECT"
    to show the details in a small window..
    endif.
    endcase.
    ENDFORM.
    rewards if useful
    regards,
    nazeer

  • When double click on the hotspot record of the ALV ,no result.

    Hi All,
    I have the following code ,
    CALL METHOD G_GRID->SET_USER_COMMAND
        EXPORTING
          I_UCOMM = 'USERCOMMAND' .
    *&      Form  usercommand
          Handle Double Click on ALV
    FORM USERCOMMAND USING r_ucomm
                           ls_selfield TYPE slis_selfield.      "#EC CALLED
      IF r_ucomm = '&IC1'.
        READ TABLE gt_disp INTO WA_GS_DISP INDEX ls_selfield-tabindex.
        IF sy-subrc = 0.
            SET PARAMETER ID 'P_BUKRS' FIELD 'C710'.
            SET PARAMETER ID 'P_FISCAL' FIELD '200711'.
            SET PARAMETER ID 'S_CUST' FIELD WA_GS_DISP-customer.
            SET PARAMETER ID 'STATUS' FIELD '20'.
           SET PARAMETER ID 'S_CODE4' FIELD
          CALL TRANSACTION 'ZE33_D7_T' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDIF.
    ENDFORM.                    "usercommand
    When i run the program and try to double click the record nothings happens ,infact if i debug the program does not even stop at "IF r_ucomm = '&IC1'" statement.
    What should have been wrong,am i missing something?
    Please suggest .
    Thanks in advance
    Swati

    Hello Swathi
    I have never used method SET_USER_COMMAND (cl_gui_alv_grid) before so I do not really know its function.
    However, you event handler FORM routine belongs to the old-fashioned fm-based ALV lists (e.g. REUSE_ALV_GRID_DISPLAY_LVC) so I doubt whether this will work together.
    If you have define a column as HOTSPOT then this trigger the class event HOTSPOT_CLICK.
    Correspondingly a double-click on the ALV grid triggers event DOUBLE_CLICK.
    For a sample report regarding ALV event handling have a look at the links provided in
    2 ALVS IN ONE SCREEN
    Regards
      Uwe

  • My TV show purchases don't play correctly. When I click on them, a black screen with no audio plays. The timecode for the show runs, but I don't see or hear anything besides that black screen. Help!

    My TV show purchases don't play correctly. When I click on them, a black screen with no audio plays. The timecode for the show runs, but I don't see or hear anything besides that black screen. Help!

    Have you tried resetting the iPad:
    Reset iPad:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.

  • Call Pop-up screen with I/O fields form function module.

    Hello experts,
      I have a Zfunction module with input paramteres i_matnr, i_posnr and i_kwmeng.
      My requirement is to call a pop-up screen with following fields.
      Material - Inputbox for material (Read Only)  " v_matnr
      Item     - Inputbox for Item (Read Only)      " v_posnr
      Quantity - Inputbox for Qty (Read Only)       " v_kwmwng
      Price    - Inputbox for Qty (Change only)     " v_price
      Submit button.
      I created function ZSD_MAT_DATA.
      Added statement CALL SCREEN 0005
    In PBO_0005, (include Prog)
      v_matnr = i_matnr
      v_posnr = i_posnr
      v_kwmeng = i_kwmeng
    1. But it gives me error for not declaration i_matnr. What I am missing here?
    2. Is there anything to make window as pop-up with some specific size?
    Regards,
    RH

    Hi,
    You can use the stanadard FM K_KKB_POPUP_RADIO3
    else like same you can craete a new function accordind to your requirement.
    Hope it helps you.
    Reagrds
    Arbind

  • When I double clicked the home button my screen changed to what looks almost like a picture negative (muted colouring) I turned it off and on but noo luck. How do I get back to my usual screen colours? Thanks for your help!).

    First time using the Apple Support Community. Trying to reset my screen so colors don't look like what can only be described as a picture negative. I recall double clicking the home button when this happened before but as that didn't work  this time would be grateful for some help. Many thanks!

    So when you triple tap the home button then it goes to negative colors, it is simple to go back. All you have to do is triple tab the home button again and it will go back if it doesnt then, go to Settings>General>Accessibility>And then switch off Invert Colors

  • BCALV_TREE_DEMO - handle double click event

    Hi everyone,
    I'm trying to do something close to BCALV_TREE_DEMO but I can't have a double click triggering anything. I have exactly the same code (except that I uncommented the PERFORM register_events) so I don't need to post here anything else.
    Can u help plz?
    Regards,
    André Costa
    Message was edited by:
            Andr Costa
    I also add the following line in the FORM register_events:
      set handler l_event_receiver->handle_item_double_click                                                        for tree1.

    Hi Umesh,
    Thanks for your reply , but af:ClientListener cannot be child of Hierarchy Viewer Component.
    Please suggest some other solution.
    Thanks,
    Jinali

Maybe you are looking for

  • CUCM installation fails in ESX server

    Hi, I'm currently trying to install CUCM 9.1 in ESX server 5.1 Attached snap is the error message and my server specs. Kindly help me on this. Thanks & Regards, Sakthivel M

  • Number Format Please help

    I have a float value like 232453.75 now I want to format it as 2,32,453.75 Is this possible using some java classes directly rather than going in for a string manipulation. Thanks

  • Regarding error : Subscript beyond count

    PROCEDURE up_value_set_blk(p_upload_phase IN VARCHAR2 DEFAULT NULL,                                  p_upload_mode IN VARCHAR2,                            p_custom_mode IN VARCHAR2 DEFAULT NULL) is                 cursor cur_flex_load is select * fro

  • Multiple Word Search

    Does anyone know how i can search a coloumn using multiple words without using string tokenizer I get all the values in the table everytime as it searches using " " unless you enter a string in every section. If you just want to search for one word i

  • WMV formats

    I need to export a video (2:40 minutes) into WMV. How can I do that?