Replicating MENU_BUTTON, TOOLBAR events

Hi All,
I wanted to know if the events in CL_GUI_ALV_GRID - MENU_BUTTON and TOOLBAR - are available in the new ALV Object Model. If not, is there a way to replicate them.
I couldn't find anything matching these events in the various CL_SALV* classes.
Thanks and Regards,
Vidya.

SALV Model has Functions object which does the job similar to TOOLBAR Event.
In SALV, Add the function in the ALV grid, get the function object and call the method ADD_FUNCTION.
*... §3.1 activate ALV generic Functions
    data: lr_functions type ref to cl_salv_functions,
          l_text       type string,
          l_icon       type string.
    lr_functions = gr_table->get_functions( ).
    lr_functions->set_all( gc_true ).
*... §3.2 include own functions
    l_text = 'My Button'.
    l_icon = icon_complete.
    try.
      lr_functions->add_function(
        name     = 'MYFUNCTION'
        icon     = l_icon
        text     = l_text
        tooltip  = l_text
        position = if_salv_c_function_position=>right_of_salv_functions ).
      catch cx_salv_existing cx_salv_wrong_call.
    endtry.
To handle the added function, register the event USER_COMMAND.
    data: lr_events type ref to cl_salv_events_table.
    lr_events = gr_table->get_event( ).
    create object gr_events.
    set handler gr_events->on_user_command for lr_events.
Event handler class
class lcl_handle_events definition.
  public section.
    methods:
      on_user_command for event added_function of cl_salv_events
        importing e_salv_function.
endclass.                    "lcl_handle_events DEFINITION
class lcl_handle_events implementation.
  method on_user_command.
    perform show_function_info using e_salv_function text-i08.
  endmethod.                    "on_user_command
endclass.                    "lcl_handle_events IMPLEMENTATION
Check program SALV_DEMO_TABLE_FUNCTIONS for more information.
Regards,
Naimesh Patel

Similar Messages

  • ALV: Problem with toolbar event

    Hi ALV-experts,
    I have a dynpro with a header area where I display an ALV table. Below this I have a subscreen with a tabstrip control and two tabs.
    In the ALV toolbar I defined an own button. This button gets deactivated after pressing this button. I achieved this by the option "disabled" in the structure stb_button within the event handler for the toolbar event.
    This works all fine so far. If I start the dynpro and click on the button in the ALV-toolbar the buttons gets deactivated afterwards. But I have I jump between the tabs before I press the ALV-toolbar button, the button does not get deactivated.
    The debugger does not go into the event handler of the toolbar event. I also did system debugging of the method SET_TOOLBAR of the CL_GUI_ALV_GRID-class. Here I pass in both cases the command
    raise event toolbar e_object = m_cl_toolbar e_interactive = i_interactive.
    but in the second case (when I change the tabs before I press the button) the event handler is not executed and I don't know why. I also tried to register the event handler for all instances of the ALV still with the same result.
    The ALV method set_toolbar_interactive( ) did also not solve the problem.
    I couldn't find any SAP note about an issue for this event.
    Does anybody have an idea or a solution for this problem?
    EDIT:
    Problem solved, it was typo!
    Thanks in advance and regards,
    Martin
    Edited by: Martin Fischer on Jul 7, 2010 4:53 PM

    The problem was a typo!

  • TOOLBAR Event in OOALV

    Hi,
    I am using OOALV to display a report. I have 3 containers in the same screen and each container contains a ALV grid.
    I have to add some customized buttons in each of the ALV grid. I am using the event 'TOOLBAR' of class cl_gui_alv_grid.
    I have 3 different objects for each grid i.e. Ob1, ob2 and ob3.
    I have created a event handler method to handle TOOLBAR event. In this event handler method i want to know that at a particular point of execution, which object is invoking this method (i.e. method is called by ob1, ob2 or Ob3) ?
    I have checked the parameter 'e_object' but it is not giving a numeric value but not the object name.
    Regards,
    Pankaj.

    Unfortunatelly I don't have access to SAP right now so I will improvise
    "event handler class
    CLASS lcl_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
             "create constructor accepting three grid references on input
              constructor importing ir_grid1 type ref to cl_gui_alv_grid
                                                 ir_grid2 type ref to cl_gui_alv_grid
                                                 ir_grid3 type ref to cl_gui_alv_grid,
            "and your handler method with SENDER parameter
              handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
                             IMPORTING e_object e_interactive sender.
        PRIVATE SECTION.
             "create 3 attributes to store grid references
           data: mr_grid1 type ref to cl_gui_alv_grid,
                    mr_grid2 type ref to cl_gui_alv_grid,
                    mr_grid3 type ref to cl_gui_alv_grid.
    ENDCLASS.             
    CLASS lcl_handler IMPLEMENTATION.
        METHOD constructor.     
             me->mr_grid1 = ir_grid1.
             me->mr_grid2 = ir_grid2.
             me->mr_grid3 = ir_grid3.
         ENDMETHOD.
        METHOD handle_toolbar.
              "check which grid raised the event
              case sender.
                 when me->mr_grid1.
                    "1st alv
                     "your coding here...
                  when me->mr_grid2.
                      "2nd
                       "...and here
                   when me->mr_grid3.
                      "3rd
                     "...and here
              endcase.
        ENDMETHOD.
    ENDCLASS.
    "now when creating handler object pass all your three grid references
    data lr_handler type ref to lcl_handler.
    create object lr_handler exporting ir_grid1 = your_grid_ref1
    ir_grid2 = your_grid_ref2
    ir_grid3 = your_grid_ref3.
    SET HANDLER....               
    This should work
    Regards
    Marcin

  • ToolBar Event OpenPopUp() How to find the Javascript?

    Hello,
    In the Toolbar at BP_HEAD (Overview) there is a button for the PDF Fact Sheet.
    The Button-on_client_click = 'OpenPopUp()'.
    As far as I understood -> this is a Javascript event/function somewhere in /bc/bsp/sap/bsp_wd_base/bspwdpopupscripts.js
    (The sourcecode of the generated HTML Page points to this)
    HOW can I have a look into this Javascript?
    Or how to debugg this Event?!
    Or is "ls_button-page_id  = me->component_id." pointing to the Service of the PDF Fact sheet?
    Any help is highly recommended...
    Thanks
    /Chris
    PS: the Sourcecode of the whole Toolbar...
       IF lr_partner IS BOUND AND lv_enabled = abap_true.
            lr_partner->get_property_as_value( EXPORTING iv_attr_name = 'BP_GUID'"#EC NOTEXT
                                               IMPORTING ev_result    = lv_partner_guid ).
            IF lv_partner_guid IS NOT INITIAL.
    *       ICF handler class prepares java script
              CALL METHOD cl_crm_afs_print=>get_url
                EXPORTING
                  iv_object   = lv_object
                  iv_key      = lv_partner_guid
                  iv_role     = lv_business_role
                  iv_language = sy-langu
                  iv_form     = ' '     "read from customizing
                  iv_format   = lv_format
                IMPORTING
                  ev_url      = lv_url.
              IF lv_url IS INITIAL.
                lv_enabled = abap_false.
              ELSE.
                lr_cuco_head ?= get_custom_controller( 'BP_HEAD/Lifecycle' )."#EC NOTEXT
                IF lr_cuco_head IS BOUND.
    *              CONCATENATE '"' lv_url '"' INTO lr_cuco_head->gv_preview_url.
                  lr_cuco_head->gv_preview_url = lv_url.
                ENDIF.
              ENDIF.
            ENDIF.
            ls_button-text  = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BP/BP_PDF' )."#EC NOTEXT
            ls_button-tooltip  = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BP/BP_FS_PREVIEW' )."#EC NOTEXT
    *        ls_button-on_click = 'PREVIEW'.
            ls_button-on_client_click = 'OpenPopUp()'.          "#EC NOTEXT
            ls_button-page_id  = me->component_id.
            ls_button-enabled = lv_enabled.
            ls_button-icon_src = '/sap/bc/bsp/sap/crm_ppm/w_pdf__s.gif' ."#EC NOTEXT
            APPEND ls_button TO rt_buttons.
            CLEAR ls_button.
          ENDIF.
        ENDIF.
      ENDIF.
    From ... Re: Display PDF document in web browser

    Chris, Did you find out how to edit this java script?.
    I need to look at the code as I suspect it accesses table CRMV_PRN_CONTROL, looking for a particular Role and it identifies the Smartform for the PDF Factssheet and the Class/interface. We have TWO PDF factsheets displayed on the 'More' tab on the Account screen and need to therefore have two Smartforms/interfaces per Role. This is not possible due to the keys of this table, so we may need to point it to a Ztable when the PDF form option is chosen.
    Therefore I might need to change the code in the Java script OpenPopUp() if that's where this table lookup takes place.
    Almost 300 reads of this posting and no comments made. That's unusual.
    Jason

  • ALV OO toolbar event of  cl_gui_alv_grid - problem

    I have defined a Button in ALV grid toolbar in my program using Event Toolbar OF cl_gui_alv_grid.
    I have also disabled/Excluded some of the buttons on Standard Grid toolbar.
    My requirement is when i click on Button defined on ALV grid toolbar..i have to trigger a Perform in which code for submit the changes done on the grid is written..
    I tried to use event user_command and this method is not getting trigerred when i click on button defined on toolbar, Probably since i have mutiple grids in my output..
    suggest me appropriate event handler method or proper approach to go about this?

    Hello Ksiva
    Have you set the event handler for USER_COMMAND? You can do this either for all or a specific grid instance.
    SET HANDLER: lcl_eventhandler=>handle_user_command    FOR ALL INSTANCES.
    SET HANDLER: lcl_eventhandler=>handle_user_command    FOR go_grid1.
    Within your event handler method you can easily distinguish between the different grid instance.
    CLASS lcl_eventhandler DEFINITION.
    METHODS: handle_user_command FOR EVENT user_command
                                                         OF cl_gui_alv_grid
                        IMPORTING
                           e_ucomm
                           sender.    " !!! Optional parameter, instance which raised the event
    CLASS lcl_eventhandler IMPLEMENTATION.
    METHOD handle_user_command.
      CASE sender.
         WHEN go_grid1.
             " handle user command
         WHEN others.
               RETURN.
      ENDCASE.
    ENDMETHOD.
    Regards
      Uwe

  • Handling standard toolbar event in CL_SALV_TABLE

    Hi Experts,
    I have created a ALV report using class CL_SAL_TABLE. I have created some buttons in the application toolbar of ALV by which I can jump to other ALV views. Now my requirement is if I click on the Exit (Shift+F3) button on the standard toolbar at that time, I'd be taken back to the selection screen. Currently both the back and exit button behaves the same way (i.e. set screen 0. leave screen.). I want to change the behaviour for exit button.
    Can anybody help me how to implement that?
    Thanks,
    Mainak

    Hi Mainak,
    Call the screen number that you wish to. (Selection-screen number).
    CASE sy-ucomm.
    WHEN EXIT.
    CALL SCREEN 'xxxx'.

  • OOP ALV event on standard toolbar

    Hi everyone,
    I'm using a method SET_TABLE_FOR_FIRST_DISPLAY to create an ALV grid.
    After making it editable I get these "Append", "Insert", "Delete" and "Duplicate Row" buttons in the toolbar by default.
    Is there a way to override the functionality of these buttons?
    My requirement is to make some cells (key fields) editable if a row has been duplicated or a new row has been inserted.
    Thanks in advance,
    Yasantha

    If you implement the toolbar event handler for the class, you can remove icons from the toolbar that you don't want. 
    *   Set up event handlers.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->toolbar for g_grid.
    METHODS:
          toolbar FOR EVENT toolbar OF cl_gui_alv_grid
                  IMPORTING e_object e_interactive.
    DATA: ls_toolbar type stb_button.
      LOOP AT p_e_object->mt_toolbar INTO ls_toolbar.
        IF ls_toolbar-function = '&REFRESH' OR
           ls_toolbar-function = '&LOCAL&CUT' OR
           ls_toolbar-function = '&LOCAL&COPY' OR
           ls_toolbar-function = '&LOCAL&PASTE' OR
           ls_toolbar-function = '&LOCAL&APPEND' OR
           ls_toolbar-function = '&LOCAL&INSERT_ROW' OR
           ls_toolbar-function = '&LOCAL&DELETE_ROW' OR
           ls_toolbar-function = '&LOCAL&COPY_ROW'.
           DELETE p_e_object->mt_toolbar.
        ENDIF.
      ENDLOOP.

  • Handling Events in ALV Grid Display

    Hi,
         I need ur urgent help on how to trigger and handle the events associated with the class CL_GUI_ALV_GRID_DISPLAY .Events like
    •     ONF4
    •     ONF1
    •     DATA_CHANGED
    •     USER_COMMAND
    •     TOOLBAR
    •     HOTSPOT_CLICK
    Please help me in this matter and post some valid codes depicting these events.Ur help will be really appreciated throught points.
    Thnkx in advance.

    Hi,
    Please refer program "BCALV_TEST_GRID_EVENTS"
    Best regards,
    Prashant
    *& Report  BCALV_TEST_GRID_EVENTS                                      *
    report  bcalv_test_grid_events.
    types: g_ty_t_carrid  type standard table of alv_tab,
           g_ty_t_connid  type standard table of alv_chck,
           g_ty_t_curr    type standard table of alv_cur,
           g_ty_s_sflight type alv_t_t2,
           g_ty_s_carrid  type alv_tab,
           g_ty_s_connid  type alv_chck,
           g_ty_s_curr    type alv_cur.
    constants: con_sflight type lvc_fname value 'ALV_T_T2',
               con_scarr   type lvc_fname value 'ALV_TAB',
               con_spfli   type lvc_fname value 'ALV_CHCK'.
    * DATA                                                                 *
    class lcl_events_d0100 definition deferred.
    types: begin of g_ty_s_plane,
             carrid    type g_ty_s_sflight-carrid,
             connid    type g_ty_s_sflight-connid,
             planetype type g_ty_s_sflight-planetype,
             seatsmax  type g_ty_s_sflight-seatsmax,
           end   of g_ty_s_plane,
           g_ty_t_plane type sorted table of g_ty_s_plane
                             with unique key carrid connid,
           begin of g_ty_s_event,
             user_command                 type char1,
             before_user_command          type char1,
             after_user_command           type char1,
             double_click                 type char1,
             hotspot_click                type char1,
             button_click                 type char1,
             onf1                         type char1,
             onf4                         type char1,
             menu_button                  type char1,
             toolbar                      type char1,
             context_menu_request         type char1,
             ondrag                       type char1,
             ondrop                       type char1,
             ondropcomplete               type char1,
             ondropgetflavor              type char1,
             subtotal_text                type char1,
             data_changed                 type char1,
             data_changed_finished        type char1,
             after_refresh                type char1,
             delayed_callback             type char1,
             delayed_changed_sel_callback type char1,
             top_of_page                  type char1,
             end_of_list                  type char1,
             print_top_of_page            type char1,
             print_end_of_page            type char1,
             print_top_of_list            type char1,
             print_end_of_list            type char1,
           end   of g_ty_s_event,
           begin of g_ty_s_onf4,
             register        type char1,
             get_before      type char1,
             change_after    type char1,
             internal_format type char1,
           end   of g_ty_s_onf4,
           begin of g_ty_s_test,
             select_amount      type i,
             no_info_popup      type char1,
             info_popup_once    type char1,
             events_info_popup  type lvc_fname occurs 0,
             application_events type char1,
             event              type g_ty_s_event,
             onf4               type g_ty_s_onf4,
             button_fields      type lvc_fname occurs 0,
             hotspot_fields     type lvc_fname occurs 0,
             onf1_fields        type lvc_fname occurs 0,
             onf4_fields        type lvc_fname occurs 0,
             bypassing_buffer   type char1,
             buffer_active      type char1,
           end   of g_ty_s_test,
           begin of g_ty_s_outtab.
    include type g_ty_s_sflight.
    types:   box                  type char1,
             lights               type char1,
           end   of g_ty_s_outtab,
           g_ty_t_outtab type table of g_ty_s_outtab.
    constants: con_exit type sy-ucomm value 'EXIT',
               con_canc type sy-ucomm value 'CANC',
               con_back type sy-ucomm value 'BACK',
               con_true     type char1 value 'X'.
    data: g_okcode type sy-ucomm.
    data: gs_test type g_ty_s_test.
    data: gt_outtab type g_ty_t_outtab with header line,
          gr_container_d0100   type ref to cl_gui_custom_container,
          gr_grid_d0100        type ref to cl_gui_alv_grid,
          gr_events_d0100      type ref to lcl_events_d0100,
          gr_grid_dragdrop     type ref to cl_dragdrop.
    data: g_static_menu            type ref to cl_ctmenu,
          g_static_menu_default    type ref to cl_ctmenu.
    data: g_field type lvc_s_fcat-fieldname.
    *       CLASS lcl_dragdrop_obj_d0100 DEFINITION
    class lcl_dragdrop_obj_d0100 definition.
      public section.
        data: line  type g_ty_s_outtab,
              index type i.
    endclass.                    "lcl_dragdrop_obj_d0100 DEFINITION
    *       CLASS lcl_events_d0100 DEFINITION
    class lcl_events_d0100 definition.
      public section.
        methods:
        user_command         for event user_command
                             of cl_gui_alv_grid
                             importing e_ucomm sender,
        before_user_command  for event before_user_command
                             of cl_gui_alv_grid
                             importing e_ucomm,
        after_user_command   for event after_user_command
                             of cl_gui_alv_grid
                             importing e_ucomm
                                       e_not_processed
                                       e_saved,
        double_click         for event double_click
                             of cl_gui_alv_grid
                             importing e_row
                                       e_column
                                       es_row_no,
        hotspot_click        for event hotspot_click
                             of cl_gui_alv_grid
                             importing e_row_id
                                       e_column_id
                                       es_row_no,
        menu_button          for event menu_button
                             of cl_gui_alv_grid
                             importing e_object
                                       e_ucomm,
        toolbar              for event toolbar
                             of cl_gui_alv_grid
                             importing e_object
                                       e_interactive,
        context_menu_request for event context_menu_request
                             of cl_gui_alv_grid
                             importing e_object,
        top_of_page          for event top_of_page
                             of cl_gui_alv_grid
                             importing e_dyndoc_id,
        end_of_list          for event end_of_list
                             of cl_gui_alv_grid
                             importing e_dyndoc_id,
        print_top_of_page    for event print_top_of_page
                             of cl_gui_alv_grid,
        print_end_of_page    for event print_end_of_page
                             of cl_gui_alv_grid,
        print_top_of_list    for event print_top_of_list
                             of cl_gui_alv_grid,
        print_end_of_list    for event print_end_of_list
                             of cl_gui_alv_grid,
        after_refresh        for event after_refresh
                             of cl_gui_alv_grid,
        delayed_callback     for event delayed_callback
                             of cl_gui_alv_grid,
        delayed_changed_sel_callback
                             for event delayed_changed_sel_callback
                             of cl_gui_alv_grid,
        subtotal_text        for event subtotal_text
                             of cl_gui_alv_grid
                             importing es_subtottxt_info
                                       ep_subtot_line
                                       e_event_data,
        ondrag               for event ondrag
                             of cl_gui_alv_grid
                             importing e_row
                                       e_column
                                       es_row_no
                                       e_dragdropobj,
        ondrop               for event ondrop
                             of cl_gui_alv_grid
                             importing e_row
                                       e_column
                                       es_row_no
                                       e_dragdropobj,
        ondropcomplete       for event ondropcomplete
                             of cl_gui_alv_grid
                             importing e_row
                                       e_column
                                       es_row_no
                                       e_dragdropobj,
        ondropgetflavor      for event ondropgetflavor
                             of cl_gui_alv_grid
                             importing e_row
                                       e_column
                                       es_row_no
                                       e_dragdropobj
                                       e_flavors,
        data_changed         for event data_changed
                             of cl_gui_alv_grid
                             importing er_data_changed
                                       e_onf4
                                       e_onf4_before
                                       e_onf4_after,
        data_changed_finished
                             for event data_changed_finished
                             of cl_gui_alv_grid,
        button_click         for event button_click
                             of cl_gui_alv_grid
                             importing es_col_id
                                       es_row_no,
        onf1                 for event onf1
                             of cl_gui_alv_grid
                             importing e_fieldname
                                       es_row_no
                                       er_event_data,
        onf4                 for event onf4
                             of cl_gui_alv_grid
                             importing e_fieldname
                                       e_fieldvalue
                                       es_row_no
                                       er_event_data
                                       et_bad_cells
                                       e_display.
    endclass.                    "lcl_events_d0100 DEFINITION
    *       CLASS lcl_events_d0100 IMPLEMENTATION
    class lcl_events_d0100 implementation.
    *       METHOD user_command                                           *
      method user_command.
        perform d0100_event_ucomm using e_ucomm.
      endmethod.                    "user_command
    *       METHOD before_user_command                                    *
      method before_user_command.
        perform d0100_event_before_ucomm using e_ucomm.
      endmethod.                    "before_user_command
    *       METHOD after_user_command                                     *
      method after_user_command.
        perform d0100_event_after_ucomm using e_ucomm
                                              e_not_processed
                                              e_saved.
      endmethod.                    "after_user_command
    *       METHOD double_click                                           *
      method double_click.
        perform d0100_event_double_click using e_row
                                               e_column.
      endmethod.                    "double_click
    *       METHOD hotspot_click                                          *
      method hotspot_click.
    *    perform d0100_event_hotspot_click using e_row_id
    *                                            e_column_id.
        gr_grid_d0100->refresh_table_display( ).
      endmethod.                    "hotspot_click
    *       METHOD menu_button                                            *
      method menu_button.
        perform d0100_event_menu_button using e_object
                                              e_ucomm.
      endmethod.                    "menu_button
    *       METHOD toolbar                                                *
      method toolbar.
        perform d0100_event_toolbar using e_object
                                          e_interactive.
      endmethod.                    "toolbar
    *       METHOD context_menu_request                                   *
      method context_menu_request.
        perform d0100_event_context_menu_reqst using e_object.
      endmethod.                    "context_menu_request
    *       METHOD top_of_page                                            *
      method top_of_page.
        perform d0100_event_top_of_page using e_dyndoc_id.
      endmethod.                    "top_of_page
    *       METHOD end_of_list                                            *
      method end_of_list.
        perform d0100_event_end_of_list using e_dyndoc_id.
      endmethod.                    "end_of_list
    *       METHOD print_top_of_page                                      *
      method print_top_of_page.
        perform d0100_event_print_top_of_page.
      endmethod.                    "print_top_of_page
    *       METHOD print_end_of_page                                      *
      method print_end_of_page.
        perform d0100_event_print_end_of_page.
      endmethod.                    "print_end_of_page
    *       METHOD print_top_of_list                                      *
      method print_top_of_list.
        perform d0100_event_print_top_of_list.
      endmethod.                    "print_top_of_list
    *       METHOD print_end_of_list                                      *
      method print_end_of_list.
        perform d0100_event_print_end_of_list.
      endmethod.                    "print_end_of_list
    *       METHOD after_refresh                                          *
      method after_refresh.
        perform d0100_event_after_refresh.
      endmethod.                    "after_refresh
    *       METHOD delayed_callback                                       *
      method delayed_callback.
        perform d0100_event_delayed_callback.
      endmethod.                    "delayed_callback
    *       METHOD delayed_changed_sel_callback                           *
      method delayed_changed_sel_callback.
        perform d0100_event_changed_sel_callba.
      endmethod.                    "delayed_changed_sel_callback
    *       METHOD subtotal_text                                          *
      method subtotal_text.
        perform d0100_event_subtotal_text using es_subtottxt_info
                                                ep_subtot_line
                                                e_event_data.
      endmethod.                    "subtotal_text
    *       METHOD ondrag                                                 *
      method ondrag.
        perform d0100_event_ondrag using e_row
                                         e_column
                                         e_dragdropobj.
      endmethod.                    "ondrag
    *       METHOD ondrop                                                 *
      method ondrop.
        perform d0100_event_ondrop using e_row
                                         e_column
                                         e_dragdropobj.
      endmethod.                    "ondrop
    *       METHOD ondropcomplete                                         *
      method ondropcomplete.
        perform d0100_event_ondropcomplete using e_row
                                                 e_column
                                                 e_dragdropobj.
      endmethod.                    "ondropcomplete
    *       METHOD ondropgetflavor                                        *
      method ondropgetflavor.
        perform d0100_event_ondropgetflavor.
      endmethod.                    "ondropgetflavor
    *       METHOD data_changed                                           *
      method data_changed.
        perform d0100_event_data_changed using er_data_changed
                                               e_onf4
                                               e_onf4_before
                                               e_onf4_after.
      endmethod.                    "data_changed
    *       METHOD data_changed_finished                                  *
      method data_changed_finished.
        perform d0100_event_data_changed_finis.
      endmethod.                    "data_changed_finished
    *       METHOD button_click                                           *
      method button_click.
        perform d0100_event_button_click using es_col_id
                                               es_row_no.
      endmethod.                    "button_click
    *       METHOD onf1                                                   *
      method onf1.
        perform d0100_event_onf1 using e_fieldname
                                       es_row_no
                                       er_event_data.
      endmethod.                                                "onf1
    *       METHOD onf4                                                   *
      method onf4.
        perform d0100_event_onf4 using e_fieldname
                                       e_fieldvalue
                                       es_row_no
                                       er_event_data
                                       et_bad_cells
                                       e_display.
      endmethod.                                                "onf4
    endclass.                    "lcl_events_d0100 IMPLEMENTATION
    * SELECTION-SCREEN                                                     *
    selection-screen begin of block gen with frame.
      selection-screen begin of line.
      parameters:
        p_ext    radiobutton group db.
      selection-screen comment (29) for field p_ext.
      selection-screen comment (29) for field p_d_file.
      parameters:
        p_d_file   type char255.
      selection-screen end of line.
      selection-screen begin of line.
      parameters:
        p_db    radiobutton group db default 'X'.
      selection-screen comment (29) for field p_db.
      selection-screen comment (29) for field p_amount.
      parameters:
        p_amount type i default 30.
      selection-screen end of line.
    selection-screen end of block gen.
    selection-screen begin of block inf with frame.
    parameters:
    p_inf01 as checkbox default con_true,
    p_inf02 as checkbox.
    selection-screen end of block inf.
    selection-screen begin of block app with frame.
    parameters:
    p_appevt as checkbox.
    selection-screen end of block app.
    selection-screen begin of block evt with frame.
    parameters:
    p_evt01 as checkbox, "USER_COMMAND
    p_evt02 as checkbox, "BEFORE_USER_COMMAND
    p_evt03 as checkbox. "AFTER_USER_COMMAND
    selection-screen skip.
    parameters:
    p_evt04 as checkbox, "DOUBLE_CLICK
    p_evt05 as checkbox. "HOTSPOT_CLICK
    select-options:
    p_hotspt for g_field no intervals default 'CARRID'.
    parameters:
    p_evt06 as checkbox. "BUTTON_CLICK
    select-options:
    p_button for g_field no intervals default 'CARRID'.
    selection-screen skip.
    parameters:
    p_evt07 as checkbox.                                        "ONF1
    selection-screen begin of block of4 with frame.
    parameters:
    p_evt08 as checkbox.                                        "ONF4
    select-options:
    p_onf4 for g_field no intervals default 'CARRID'.
    selection-screen begin of line.
    selection-screen comment 5(30) text-c01 for field p_f401.
    parameters:
    p_f401 as checkbox default con_true. "REGISTER
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 5(30) text-c02 for field p_f402.
    parameters:
    p_f402 as checkbox. "GET_BEFORE
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 5(30) text-c03 for field p_f403.
    parameters:
    p_f403 as checkbox. "CHANGE_AFTER
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 5(30) text-c04 for field p_f404.
    parameters:
    p_f404 as checkbox. "INTERNAL_FORMAT
    selection-screen end of line.
    selection-screen end of block of4.
    selection-screen skip.
    parameters:
    p_evt09 as checkbox, "MENU_BUTTON
    p_evt10 as checkbox, "TOOLBAR
    p_evt11 as checkbox. "CONTEXT_MENU_REQUEST
    selection-screen skip.
    parameters:
    p_evt12 as checkbox, "ONDRAG
    p_evt13 as checkbox, "ONDROP
    p_evt14 as checkbox, "ONDROPCOMPLETE
    p_evt15 as checkbox. "ONDROPGETFLAVOR
    selection-screen skip.
    parameters:
    p_evt16 as checkbox. "SUBTOTAL_TEXT
    selection-screen skip.
    parameters:
    p_evt17 as checkbox, "DATA_CHANGED
    p_evt18 as checkbox, "DATA_CHANGED_FINISHED
    p_evt19 as checkbox. "AFTER_REFRESH
    selection-screen skip.
    parameters:
    p_evt20 as checkbox, "DELAYED_CALLBACK
    p_evt21 as checkbox. "DELAYED_CHANGED_SEL_CALLBACK
    selection-screen skip.
    parameters:
    p_evt22 as checkbox, "TOP_OF_PAGE
    p_evt23 as checkbox, "END_OF_LIST
    p_evt24 as checkbox, "PRINT_TOP_OF_PAGE
    p_evt25 as checkbox, "PRINT_END_OF_PAGE
    p_evt26 as checkbox, "PRINT_TOP_OF_LIST
    p_evt27 as checkbox. "PRINT_END_OF_LIST
    selection-screen end of block evt.
    * AT SELECTION-SCREEN ON VALUE-REQUEST                                 *
    at selection-screen on value-request for p_hotspt-low.
      perform d0100_f4_fcode changing p_hotspt-low.
    at selection-screen on value-request for p_button-low.
      perform d0100_f4_fcode changing p_button-low.
    at selection-screen on value-request for p_onf4-low.
      perform d0100_f4_fcode changing p_onf4-low.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_d_file.
      PERFORM f4_file.
    * START-OF-SELECTION                                                   *
    start-of-selection.
      gs_test-select_amount = p_amount.
      gs_test-no_info_popup   = p_inf01.
      gs_test-info_popup_once = p_inf02.
      gs_test-application_events = p_appevt.
      gs_test-event-user_command                 = p_evt01.
      gs_test-event-before_user_command          = p_evt02.
      gs_test-event-after_user_command           = p_evt03.
      gs_test-event-double_click                 = p_evt04.
      gs_test-event-hotspot_click                = p_evt05.
      gs_test-event-button_click                 = p_evt06.
      gs_test-event-onf1                         = p_evt07.
      gs_test-event-onf4                         = p_evt08.
      gs_test-event-menu_button                  = p_evt09.
      gs_test-event-toolbar                      = p_evt10.
      gs_test-event-context_menu_request         = p_evt11.
      gs_test-event-ondrag                       = p_evt12.
      gs_test-event-ondrop                       = p_evt13.
      gs_test-event-ondropcomplete               = p_evt14.
      gs_test-event-ondropgetflavor              = p_evt15.
      gs_test-event-subtotal_text                = p_evt16.
      gs_test-event-data_changed                 = p_evt17.
      gs_test-event-data_changed_finished        = p_evt18.
      gs_test-event-after_refresh                = p_evt19.
      gs_test-event-delayed_callback             = p_evt20.
      gs_test-event-delayed_changed_sel_callback = p_evt21.
      gs_test-event-top_of_page                  = p_evt22.
      gs_test-event-end_of_list                  = p_evt23.
      gs_test-event-print_top_of_page            = p_evt24.
      gs_test-event-print_end_of_page            = p_evt25.
      gs_test-event-print_top_of_list            = p_evt26.
      gs_test-event-print_end_of_list            = p_evt27.
      gs_test-onf4-register        = p_f401.
      gs_test-onf4-get_before      = p_f402.
      gs_test-onf4-change_after    = p_f403.
      gs_test-onf4-internal_format = p_f404.
      if p_evt05 ne space.
        loop at p_hotspt.
          if not p_hotspt-low is initial.
            append p_hotspt-low to gs_test-hotspot_fields.
          endif.
        endloop.
      endif.
      if p_evt06 ne space.
        loop at p_button.
          if not p_button-low is initial.
            append p_button-low to gs_test-button_fields.
          endif.
        endloop.
      endif.
      if p_evt08 ne space.
        loop at p_onf4.
          if not p_onf4-low is initial.
            append p_onf4-low to gs_test-onf4_fields.
          endif.
        endloop.
      endif.
      gs_test-bypassing_buffer = space.
      gs_test-buffer_active    = space.
    * END-OF-SELECTION                                                     *
    end-of-selection.
      call screen 100.
    *&      Module  d0100_set_status  OUTPUT
    *       text
    module d0100_set_status output.
      perform d0100_set_status.
    endmodule.                 " d0100_set_status  OUTPUT
    *&      Module  d0100_prepare_container  OUTPUT
    *       text
    module d0100_prepare_container output.
      perform d0100_prepare_container.
    endmodule.                 " d0100_prepare_container  OUTPUT
    *&      Module  d0100_exit  INPUT
    *       text
    module d0100_exit input.
      perform d0100_exit.
    endmodule.                 " d0100_exit  INPUT
    *&      Module  d0100_fcode  INPUT
    *       text
    module d0100_fcode input.
      perform d0100_fcode.
    endmodule.                 " d0100_fcode  INPUT
    *&      Form  d0100_set_status
    *       text
    form d0100_set_status .
      types: begin of l_ty_s_excl,
               func type syucomm,
             end   of l_ty_s_excl,
             l_ty_t_excl type standard table of l_ty_s_excl.
      data: lt_excl type l_ty_t_excl.
      set pf-status 'D0100' excluding lt_excl.
      set titlebar 'D0100'.
    endform.                    " d0100_set_status
    *&      Form  d0100_prepare_container
    *       text
    form d0100_prepare_container .
      data: lt_fcat             type lvc_t_fcat,
            ls_layo             type lvc_s_layo,
            ls_vari             type disvariant,
            ls_prnt             type lvc_s_prnt,
            l_consistency_check type char1.
      if gr_container_d0100 is initial.
        if cl_gui_alv_grid=>offline( ) is initial.
          create object gr_container_d0100
                        exporting container_name = 'D0100_CONTAINER'.
        endif.
        create object gr_grid_d0100
                      exporting i_parent      = gr_container_d0100
                                i_appl_events = gs_test-application_events.
        DATA: l_filename TYPE string,
              l_struct   TYPE string.
        CASE con_true.
          WHEN p_db.
            perform d0100_get_outtab.
          WHEN p_ext.
            l_struct = 'g_ty_t_outtab'.
            l_filename = p_d_file.
            CALL METHOD cl_salv_test_data=>select_data
              EXPORTING
                structname = l_struct
                SOURCE     = 2
                 filename   = l_filename
    *            AMOUNT     = 30
              CHANGING
                data       = gt_outtab[].
        ENDCASE.
        perform d0100_set_grid_vari     changing ls_vari.
        perform d0100_set_grid_layo     changing ls_layo.
        perform d0100_set_grid_fcat     changing lt_fcat.
        perform d0100_set_grid_onf4     changing lt_fcat.
        perform d0100_set_grid_buttons  changing lt_fcat.
        perform d0100_set_grid_hotspot  changing lt_fcat.
        perform d0100_set_grid_dragdrop changing ls_layo.
        perform d0100_set_grid_edit     changing ls_layo.
        perform d0100_set_grid_events.
        ls_prnt-grpchgedit = con_true.
        call method gr_grid_d0100->set_table_for_first_display
          exporting
            i_buffer_active     = gs_test-buffer_active
            i_bypassing_buffer  = gs_test-bypassing_buffer
            i_consistency_check = l_consistency_check
            is_variant          = ls_vari
            i_save              = 'A'
            i_default           = con_true
            is_layout           = ls_layo
            is_print            = ls_prnt
          changing
            it_outtab           = gt_outtab[]
            it_fieldcatalog     = lt_fcat.
      endif.
    endform.                    " d0100_prepare_container
    *&      Form  d0100_exit
    *       text
    form d0100_exit .
      data: l_okcode like sy-ucomm.
      l_okcode = g_okcode.
      clear g_okcode.
      case l_okcode.
        when con_exit or con_back or con_canc.
          call method gr_grid_d0100->free.
          call method gr_container_d0100->free.
          call method cl_gui_cfw=>flush.
          clear gr_container_d0100.
          clear gr_grid_d0100.
          clear gr_events_d0100.
          set screen 0.
          leave screen.
      endcase.
    endform.                    " d0100_exit
    *&      Form  d0100_fcode
    *       text
    form d0100_fcode .
      data: l_okcode like sy-ucomm.
      l_okcode = g_okcode.
      clear g_okcode.
      call method cl_gui_cfw=>dispatch.
      case l_okcode.
        when con_exit or con_back or con_canc.
          g_okcode = l_okcode.
          perform d0100_exit.
        when others.
      endcase.
    endform.                    " d0100_fcode
    *&      Form  d0100_set_grid_vari
    *       text
    form d0100_set_grid_vari changing cs_vari type disvariant.
      cs_vari-report      = sy-repid.
      cs_vari-handle      = space.
      cs_vari-log_group   = space.
      cs_vari-username    = space.
      cs_vari-variant     = space.
      cs_vari-text        = space.
      cs_vari-dependvars  = space.
    endform.                    " d0100_set_grid_vari
    *&      Form  d0100_set_grid_layo
    *       text
    form d0100_set_grid_layo  changing cs_layo type lvc_s_layo.
    *... ALV-Control: Allgemeine Anzeigeoptionen
      cs_layo-stylefname  = space.
      cs_layo-cwidth_opt  = con_true.
      cs_layo-zebra       = space.
      cs_layo-smalltitle  = space.
      cs_layo-graphics    = space.
      cs_layo-frontend    = space.
      cs_layo-template    = space.
    *... ALV-Control: Gridcustomizing
      cs_layo-no_colexpd  = space.
      cs_layo-no_hgridln  = space.
      cs_layo-no_vgridln  = space.
      cs_layo-no_rowmark  = space.
      cs_layo-no_headers  = space.
      cs_layo-no_merging  = space.
      cs_layo-grid_title  = space.
      cs_layo-no_toolbar  = space.
      cs_layo-sel_mode    = 'D'.
      cs_layo-box_fname   = space.
      cs_layo-sgl_clk_hd  = space.
    *... ALV-Control: Summenoptionen
      cs_layo-totals_bef  = space.
      cs_layo-no_totline  = space.
      cs_layo-numc_total  = space.
      cs_layo-no_utsplit  = space.
    *... ALV-Control: Exceptions
      cs_layo-excp_fname  = 'LIGHTS'.
      cs_layo-excp_rolln  = space.
      cs_layo-excp_conds  = space.
      cs_layo-excp_led    = space.
    *... ALV-Control: Steuerung Interaktion
      cs_layo-detailinit  = space.
      cs_layo-detailtitl  = space.
      cs_layo-keyhot      = space.
      cs_layo-no_keyfix   = space.
      cs_layo-no_author   = space.
      clear cs_layo-s_dragdrop.
    *... ALV-Control: Farben
      cs_layo-info_fname  = space.
      cs_layo-ctab_fname  = space.
    *... ALV-Control: Eingabefähigkeit
      cs_layo-edit        = space.
      cs_layo-edit_mode   = space.
      cs_layo-no_rowins   = space.
      cs_layo-no_rowmove  = space.
    *... ALV-Control: Web-Optionen
      cs_layo-weblook     = space.
      cs_layo-webstyle    = space.
      cs_layo-webrows     = space.
      cs_layo-webxwidth   = space.
      cs_layo-webxheight  = space.
    endform.                    " d0100_set_grid_layo
    *&      Form  d0100_set_grid_fcat
    *       text
    form d0100_set_grid_fcat changing ct_fcat type lvc_t_fcat.
      call function 'LVC_FIELDCATALOG_MERGE'
        exporting
          i_buffer_active        = gs_test-buffer_active
          i_structure_name       = con_sflight
          i_client_never_display = con_true
          i_bypassing_buffer     = gs_test-bypassing_buffer
        changing
          ct_fieldcat            = ct_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.
    endform.                    " d0100_set_grid_fcat
    *&      Form  d0100_set_grid_onf4
    *       text
    form d0100_set_grid_onf4 changing ct_fcat type lvc_t_fcat.
      field-symbols: <ls_fcat> type lvc_s_fcat.
      data: l_field type lvc_fname,
            lt_f4   type lvc_t_f4,
            ls_f4   type lvc_s_f4.
      if gs_test-event-onf4 eq con_true.
        loop at gs_test-onf4_fields into l_field.
          read table ct_fcat assigning <ls_fcat>
                     with key fieldname = l_field.
          if sy-subrc eq 0.
            <ls_fcat>-f4availabl = con_true.
          endif.
          ls_f4-fieldname  = l_field.
          ls_f4-register   = gs_test-onf4-register.
          ls_f4-getbefore  = gs_test-onf4-get_before.
          ls_f4-chngeafter = gs_test-onf4-change_after.
          ls_f4-internal   = gs_test-onf4-internal_format.
          insert ls_f4 into table lt_f4.
        endloop.
      endif.
      check not lt_f4 is initial.
      call method gr_grid_d0100->register_f4_for_fields
        exporting
          it_f4 = lt_f4.
    endform.                    " d0100_set_grid_onf4
    *&      Form  d0100_set_grid_buttons
    *       text
    form d0100_set_grid_buttons changing ct_fcat type lvc_t_fcat.
      field-symbols: <ls_fcat> type lvc_s_fcat.
      data: l_field type lvc_fname.
      loop at gs_test-button_fields into l_field.
    *... Spaltenebene
    *    In Feldkatalog wird Feld STYLE für Spalte auf
    *    cl_gui_alv_grid=>mc_style_button gesetzt
        read table ct_fcat assigning <ls_fcat>
                   with key fieldname = l_field.
        if sy-subrc eq 0.
          <ls_fcat>-style = cl_gui_alv_grid=>mc_style_button.
        endif.
      endloop.
    endform.                    " d0100_set_grid_buttons
    *&      Form  d0100_set_grid_hotspot
    *       text
    form d0100_set_grid_hotspot changing ct_fcat type lvc_t_fcat.
      field-symbols: <ls_fcat> type lvc_s_fcat.
      data: l_field type lvc_fname.
      loop at gs_test-hotspot_fields into l_field.
    *... Spaltenebene
    *    In Feldkatalog wird Feld STYLE für Spalte auf
    *    cl_gui_alv_grid=>mc_style_hotspot gesetzt
        read table ct_fcat assigning <ls_fcat>
                   with key fieldname = l_field.
        if sy-subrc eq 0.
          <ls_fcat>-style = cl_gui_alv_grid=>mc_style_hotspot.
        endif.
      endloop.
    endform.                    " d0100_set_grid_hotspot
    *&      Form  d0100_set_grid_edit
    *       text
    form d0100_set_grid_edit changing cs_layo type lvc_s_layo.
      if gs_test-event-data_changed eq con_true or
         gs_test-event-data_changed_finished eq con_true or
         gs_test-event-after_refresh eq con_true.
        cs_layo-edit = con_true.
        call method gr_grid_d0100->register_edit_event
          exporting
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      endif.
    endform.                    " d0100_set_grid_edit
    *&      Form  d0100_set_grid_dragdrop
    *       text
    form d0100_set_grid_dragdrop changing cs_layo type lvc_s_layo.
      data: l_effect       type i,
            l_handle_grid  type i,
            ls_dragdrop    type lvc_s_dd01.
    *... setzen für Zeilen
      create object gr_grid_dragdrop.
      l_effect = cl_dragdrop=>move + cl_dragdrop=>copy.
      call method gr_grid_dragdrop->add
        exporting
          flavor     = 'Line'                                   "#EC NOTEXT
          dragsrc    = 'X'
          droptarget = 'X'
          effect     = l_effect.
      call method gr_grid_dragdrop->get_handle
        importing
          handle = l_handle_grid.
      ls_dragdrop-cntr_ddid = space.
      ls_dragdrop-grid_ddid = space.
      ls_dragdrop-col_ddid  = space.
      ls_dragdrop-row_ddid  = l_handle_grid.
      ls_dragdrop-fieldname = space.
      cs_layo-s_dragdrop = ls_dragdrop.
    endform.                    " d0100_set_grid_dragdrop
    *&      Form  d0100_set_grid_events
    *       text
    form d0100_set_grid_events .
      create object gr_events_d0100.
      if gs_test-event-user_command eq con_true.
        set handler gr_events_d0100->user_command
                    for gr_grid_d0100.
      endif.
      if gs_test-event-before_user_command eq con_true.
        set handler gr_events_d0100->before_user_command
                    for gr_grid_d0100.
      endif.
      if gs_test-event-after_user_command eq con_true.
        set handler gr_events_d0100->after_user_command
                    for gr_grid_d0100.
      endif.
      if gs_test-event-double_click eq con_true.
        set handler gr_events_d0100->double_click
                    for gr_grid_d0100.
      endif.
      if gs_test-event-hotspot_click eq con_true.
        set handler gr_events_d0100->hotspot_click
                    for gr_grid_d0100.
      endif.
      if gs_test-event-button_click eq con_true.
        set handler gr_events_d0100->button_click
                    for gr_grid_d0100.
      endif.
      if gs_test-event-onf1 eq con_true.
        set handler gr_events_d0100->onf1
                    for gr_grid_d0100.
      endif.
      if gs_test-event-onf4 eq con_true.
        set handler gr_events_d0100->onf4
                    for gr_grid_d0100.
      endif.
      if gs_test-event-menu_button eq con_true.
        set handler gr_events_d0100->menu_button
                    for gr_grid_d0100.
      endif.
      if gs_test-event-toolbar eq con_true.
        set handler gr_events_d0100->toolbar
                    for gr_grid_d0100.
      endif.
      if gs_test-event-context_menu_request eq con_true.
        set handler gr_events_d0100->context_menu_request
                    for gr_grid_d0100.
      endif.
      if gs_test-event-ondrag eq con_true.
        set handler gr_events_d0100->ondrag
                    for gr_grid_d0100.
      endif.
      if gs_test-event-ondrop eq con_true.
        set handler gr_events_d0100->ondrop
                    for gr_grid_d0100.
      endif.
      if gs_test-event-ondropcomplete eq con_true.
        set handler gr_events_d0100->ondropcomplete
                    for gr_grid_d0100.
      endif.
      if gs_test-event-ondropgetflavor eq con_true.
        set handler gr_events_d0100->ondropgetflavor
                    for gr_grid_d0100.
      endif.
      if gs_test-event-subtotal_text eq con_true.
        set handler gr_events_d0100->subtotal_text
                    for gr_grid_d0100.
      endif.
      if gs_test-event-data_changed eq con_true.
        set handler gr_events_d0100->data_changed
                    for gr_grid_d0100.
      endif.
      if gs_test-event-data_changed_finished eq con_true.
        set handler gr_events_d0100->data_changed_finished
                    for gr_grid_d0100.
      endif.
      if gs_test-event-after_refresh eq con_true.
        set handler gr_events_d0100->after_refresh
                    for gr_grid_d0100.
      endif.
      if gs_test-event-delayed_callback eq con_true.
        set handler gr_events_d0100->delayed_callback
                    for gr_grid_d0100.
        call method gr_grid_d0100->register_delayed_event
          exporting
            i_event_id = cl_gui_alv_grid=>mc_evt_delayed_move_curr_cell.
      endif.
      if gs_test-event-delayed_changed_sel_callback eq con_true.
        set handler gr_events_d0100->delayed_changed_sel_callback
                    for gr_grid_d0100.
        call method gr_grid_d0100->register_delayed_event
          exporting
            i_event_id = cl_gui_alv_grid=>mc_evt_delayed_change_select.
      endif.
      if gs_test-event-top_of_page eq con_true.
        set handler gr_events_d0100->top_of_page
                    for gr_grid_d0100.
      endif.
      if gs_test-event-end_of_list eq con_true.
        set handler gr_events_d0100->end_of_list
                    for gr_grid_d0100.
      endif.
      if gs_test-event-print_top_of_page eq con_true.
        set handler gr_events_d0100->print_top_of_page
                    for gr_grid_d0100.
      endif.
      if gs_test-event-print_end_of_page eq con_true.
        set handler gr_events_d0100->print_end_of_page
                    for gr_grid_d0100.
      endif.
      if gs_test-event-print_top_of_list eq con_true.
        set handler gr_events_d0100->print_top_of_list
                    for gr_grid_d0100.
      endif.
      if gs_test-event-print_end_of_list eq con_true.
        set handler gr_events_d0100->print_end_of_list
                    for gr_grid_d0100.
      endif.
    endform.                    " d0100_set_grid_events
    *&      Form  d0100_get_outtab
    *       text
    form d0100_get_outtab .
      field-symbols: <ls_outtab> type g_ty_s_outtab.
      data: l_excp_mod      type i,
            l_excp_div      type i,
            l_excp_amnt     type i value 4,
            l_excp          type i,
            lt_carrid       type g_ty_t_carrid,
            ls_carrid       type g_ty_s_carrid,
            l_carrid_amount type i,
            l_carrid_select type i,
            l_carrid_index1 type i,
            lt_connid       type g_ty_t_connid,
            ls_connid       type g_ty_s_connid,
            l_connid_amount type i,                             "#EC NEEDED
            l_connid_select type i,
            l_connid_index1 type i,
            l_connid_index2 type i,
            lt_plane        type g_ty_t_plane,
            ls_plane        type g_ty_s_plane.
      if gs_test-select_amount gt 0.
        select * from (con_sflight) into corresponding fields
                   of table gt_outtab up to gs_test-select_amount rows.
      endif.
      gs_test-select_amount = sy-dbcnt.
      perform d0100_get_carrid changing lt_carrid.
      perform d0100_get_connid changing lt_connid.
      perform d0100_get_plane  using lt_connid changing lt_plane.
      describe table lt_carrid lines l_carri

  • ALV events

    what are the different events in ABAP ALV.... I tried to use the regular top-of-page and end-of-page as in regular ABAP program..
    As I am new to ALV's it will be helpful if u can cite me with examples

    Rahul,
    There are quite a few events, which also depend upon whehter we dealing with editable grid or a display grid. These are the events you can find the SE24 - CL_GUI_ALV_GRID.
    ONF1
    ONF4
    DATA_CHANGED
    ONDROPGETFLAVOR
    ONDRAG
    ONDROP
    ONDROPCOMPLETE
    SUBTOTAL_TEXT
    BEFORE_USER_COMMAND
    USER_COMMAND
    AFTER_USER_COMMAND
    DOUBLE_CLICK
    DELAYED_CALLBACK
    DELAYED_CHANGED_SEL_CALLBACK
    PRINT_TOP_OF_PAGE
    PRINT_TOP_OF_LIST
    PRINT_END_OF_PAGE
    PRINT_END_OF_LIST
    TOP_OF_PAGE
    CONTEXT_MENU_REQUEST
    MENU_BUTTON
    TOOLBAR
    HOTSPOT_CLICK
    END_OF_LIST
    AFTER_REFRESH
    BUTTON_CLICK
    DATA_CHANGED_FINISHED
    Here are the sample programs for the events
    BCALV_GRID_EDIT_DELTA_EVENT
    BCALV_SIMPLE_EVENT_RECEIVER
    BCALV_TEST_FULLSCREEN_EVENTS
    BCALV_TEST_GRID_EVENTS
    BCALV_TEST_HIERSEQ_LIST_EVENTS
    BCALV_TEST_LIST_EVENTS
    BCALV_TOOLBAR_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER
    The following are the examples for EDITABLE ALV's.
    BCALV_EDIT_01
    BCALV_EDIT_02
    BCALV_EDIT_03
    BCALV_EDIT_04
    BCALV_EDIT_05
    BCALV_EDIT_06
    BCALV_EDIT_07
    BCALV_EDIT_08
    Regards,ff
    Ravi
    Note : Please mark the helpful answers

  • Calling external url like 'GOOGLE'  when user clicks on toolbar button

    Hi All,
           I have done the following steps for url creation:
       1. I have created an event and assigned it to newly created toolbar grp.Then in 'Define Application Layout' I have created an entry specifying name of application, toolbar, event, tab grp and version.
       2. Then in navigation for url generation I have created a method with blank object name. This method I have then assigned to a role.Here i have specified path for extenal link say 'google'.
       3. I have assigned same role to me in su01 transaction.
       4. when i run my application ,toolbar is getting displayed but when I click on toolbar nothing is getting open up.
               Is this the correct way for url generation or do i need to do something else?Is there any coding needs to be done?I have provided with steps done by me.Please help me further.
    Regards,
    vikas

    Hi.
    That's not possible in the PCUI since when the button is pressed a PCUI event is triggered and handle by the PCUI framework and we don't have access to the layout in order to react to such event (like placing javascript windows.open or kind of). The events defined in the PCUI are only supported by the PCUI framework. You could create an HTML container and then start the external web application (www.google.com or whatever) in this container (there is a good blog written by Gregor Wolf at <a href="/people/gregor.wolf3/blog/2005/05/27/use-crm-pcui-html-viewer-to-call-a-custom-url:///people/gregor.wolf3/blog/2005/05/27/use-crm-pcui-html-viewer-to-call-a-custom-url) or as Raj said you can use "Object Link Navigation" in order to start a new window with the PCUI layout where you can create another container with the web application you want to display (for more details have a look to the PCUI cookbook).
    Best regards.
    Armando Rodriguez.

  • Problem with Toolbars in LVC_S_LAYO

    Dear all,
    i am using structure LVC_S_LAYO.
    Here in my toolbar some icons like show next,summation are inactive.
    Also i am using LVC_T_FCAT where i have set DO_SUM = 'X'.
    When i see in debugging the value X is getting passed from my it_fieldcatalog table but still
    the sum of the desired column is not displayed.what must be the problem?
    Why are these icons inactive in the toolbar.?What should i do to Activate them?

    If you are using the OO model cl_gui_alv_grid you won´t need any of the fcat models as the sum facility is included on the standard toolbar.
    Just select the column and then press the SUM button.
    If  you switch to the OO model you don`t need to do very much coding and there are a lot less chances of getting errors.
    However if you DO program the toolbar then you will need some code like
    1)  in the constructor set the handler for the ON TOOLBAR event.
    SET HANDLER z_object->on_toolbar FOR grid1.
    also have one for ON_USER_COMMAND
      SET HANDLER z_object->on_user_command FOR grid1.
    2) in the the toolbar method activate the buttons you need
    For example
    method ON_TOOLBAR.
    type-pools icon.
    CLEAR ls_toolbar.
        MOVE 0 TO ls_toolbar-butn_type.
        MOVE 'EXIT' TO ls_toolbar-function.
        MOVE space TO ls_toolbar-disabled.
        MOVE icon_system_end TO ls_toolbar-icon.
        MOVE 'Click2Exit' TO ls_toolbar-quickinfo.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
        MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'SAVE' TO ls_toolbar-function.
        MOVE space TO ls_toolbar-disabled.
        MOVE  icon_system_save TO ls_toolbar-icon.
        MOVE 'Save data' TO ls_toolbar-quickinfo.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
        MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'EDIT' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE  icon_toggle_display_change TO ls_toolbar-icon.
        MOVE 'Edit data' TO ls_toolbar-quickinfo.
        MOVE  'EDIT' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
        MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'PROC' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE   icon_businav_process TO ls_toolbar-icon.
        MOVE 'Process.' TO ls_toolbar-quickinfo.
        MOVE  'PROC' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
        MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'EXCEL' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE  icon_xxl TO ls_toolbar-icon.
        MOVE 'Excel' TO ls_toolbar-quickinfo.
        MOVE  'EXCEL' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'REFR' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE  icon_refresh TO ls_toolbar-icon.
        MOVE  'Refresh' TO ls_toolbar-quickinfo.
        MOVE  'REFR' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    endmethod.
    What the above code does is set the variable E_UCOMM with the value in the toolbar function for example if I press the EXCEL button E_UCOMM is set to EXCEL.
    Now the method ON_USER_COMMAND is called where you can then choose your method / action for the toolbar.
    method ON_USER_COMMAND.
           FOR EVENT before_user_command OF cl_gui_alv_grid
           IMPORTING
             e_ucomm
             sender.
    CASE e_ucomm.
          WHEN 'EXIT'.
            LEAVE PROGRAM.
          WHEN 'EXCEL'.
            CALL METHOD me->download_to_excel.
          WHEN 'SAVE'.
          WHEN 'PROC'.
            CALL METHOD me->process.
          WHEN 'REFR'.
            CALL METHOD me->refresh.
        ENDCASE.
    endmethod.
    Note that the routine ON Data Changed Finished is always called before the user command handling if you set a handler for the event data changed finished;
    Your data of course must still be correct  for summing it must be NUMERIC.
    Cheers
    jimbo

  • Handling the Standard Toolbar Button click of an ALV

    Hi Experts,
    I have created an ALV grid output using CL_GUI_ALV_GRID with standard buttons(default) on the toolbar. When I click on any of these standard buttons, say '+' button to insert records, my custom program is not hit.
    I know there is a protected event 'TOOLBAR_BUTTON_CLICK' which I tried to handle in my program but it did not work. However, I am able to handle the public event 'DOUBLE_CLICK' of the same class 'CL_GUI_ALV_GRID'.
    So..can anyone tell how to handle this protected event OR how to handle the STANDARD buttons on ALV toolbar so that they hit my custome code.
    Thanks very much.
    Regards,
    Rudresh

    Hello Rudresh
    The point is to "re-define" the standard ok-codes of toolbar buttons:
    " Make toolbar interactive
    CALL METHO go_grid->set_toolbar_interactive( ).  " raises event TOOLBAR
    " Event handler method
    METHOD handle_toolbar.
    * define local data
      DATA: ls_button    TYPE stb_button.
    " Redefine function code
      LOOP AT e_object->mt_toolbar INTO ls_button
                      WHERE ( function = cl_gui_alv_grid=>MC_FC_LOC_INSERT_ROW ).
        ls_button-function = 'MY_FCODE'.  " triggers USER_COMMAND
        MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
      ENDLOOP.
    ENDMETHOD.
    Regards
      Uwe

  • Edit Toolbar of CL_GUI_ALV_TREE

    Hi everyone,
    I'm wondering how to edit the toolbar of the CL_GUI_ALV_TREE. There is no toolbar event like in CL_GUI_ALV_GRID.
    In case of CL_GUI_ALV_GRID you have the attribute 'mt_toolbar' which is an internal table, containing the toolbar buttons.
    In case of CL_GUI_ALV_TREE there is only the attribute 'mr_toolbar' which is a reference to CL_GUI_TOOLBAR. So I thought about editing the internal table M_TABLE_BUTTON from CL_GUI_TOOLBAR(should be the same as mt_toolbar), but it's read-only
    Any idea how to edit/personalize the toolbar of CL_GUI_ALV_TREE?

    For solution check program BCALV_TREE_DEMO, form: change_toolbar!

  • ALV events for data_change  executing multiple times

    Hello Experts,
    I am using the event "data_changed" of cl_gui_alv_grid and its getting triggred multiple times based on
    no. of rows in my ALV grid output.
    For ex: if i have 5 rows and if i input a field in any cell in a new row, in data_changed event is triggered 2 times.
    The  LOOP AT er_data_changed->mt_mod_cells INTO ls_modified is executing 6 times as in above example
    even though is having only 1 entry.
    Can some one pls help me with this?
    Also i see the  toolbar event is often getting excuted multiples no of times making the application slow.
    Please suggest.
    Thanks
    Dan

    Dan,
    Maybe you've placed or doing something wrong, take this report as a pattern "BCALV_EDIT_03".
    Best regards,
    Alexandre

  • ALV scroll event ?

    Hello,
    I need to display a long list using a ALV display.  For each line, there are data to be fetched from multiple tables so this can take quite long to accomplish.  To avoid having users to wait while gathering the data for the whole list I would like to be able to gather only data for the lines visible at each time.  So if a user scrolls down, I would select the data for the new lines displayed.
    So I was wondering if anyone would know if there is an event in the ALV object which allows me to catch which lines are being displayed ?  The method get_scroll_info_via_id would allow me to know which lines are displayed in the beginning but if a user scrolls down I have no information about this as an PBO event is not triggered.
    So if anyone could advise me or has an alternative approach to this problem I would be very grateful.
    Regards,
    Sigurjon

    Hi,
      One solution I can think of is to add your own button to the ALV Toolbar (Like "Show Next Page") and then limit the initial display to certain N number of lines..
      And when user clicks on this button, you read next N number of records and then <b>add</b> these entries to the internal table that is used for ALV display and call REFRESH_TABLE_DISPLAY method..
      Once you reach the end, just disable the button..
      Since you are always adding the lines, if he wants to see previous page he can simply use paging keys or scrollbar...
      Hope this helps..
      May be you already know..but just..FYI, you can handle TOOLBAR event of ALV Grid to add your own buttons to the ALV Toolbar.. Please take a look at sample program BCALV_GRID_05 just in case you need reference on how to add the button..
    Sri
    Message was edited by: Srikanth Pinnamaneni

Maybe you are looking for

  • Can I use airport time capsule 2tb the same way as an external hard drive

    I would like to know if I can use it as I would an external hard drive by dragging certain files or folders over to my Mac computer and not just as a backing up device. Where as I would only be able to completely add all files and folders without a c

  • RFIDYYWT ECC6 reversal of FI vendor invoices no taken in the list

    Hi all I'm launching for Spain the RFIDYYWT, in January for the company we have a FI vendor invoice with withholding tax, with a reversal (made with FB08) in the same day. No payment document has been made before the reversal. The system generate the

  • Context menu enhancement in WAD 7.0

    Hi All, I would like to enhance the standard context menu in my webtemplate Scenerio If I right click broadcast and export in context menu  I get the following - Broadcast to email - Broadcast to Portal - Broadcast to PDF - Export to Excel - Export t

  • Why does my Airport Base Station continue to disconnect?

    It works fine until it just goes out. Every once in a while it just goes out at random times even though it is still connected to everything (computer, modem).I do this to create a wifi connection for my family and I. I have tried all of resets and i

  • You can help me

    My iphone5 stolen, the police at the time , when I later discovered the thief actually Apple store in Shenzhen, repair and replace it , and now phone serial number with imei numbers are replaced , and I have found that it can no longer information on