Create Events in Global Class

In this short tutorial, we are going to create events in global class. A common event example below is done in local class for ALV left click. We will recreate this in SE24.

*----------------------------------------------------------------------*
*       CLASS cl_local_app DEFINITION
*----------------------------------------------------------------------*
*       Class Definition for cl_local_app
*----------------------------------------------------------------------*
CLASS cl_local_app DEFINITION FINAL.
 
  PRIVATE SECTION.
    METHODS:
      on_hotspot_click_left   FOR EVENT hotspot_click OF cl_gui_alv_grid IMPORTING es_row_no.
ENDCLASS.
  1. Go to transaction code SE24. Input class name at Object Type and click Create.
  2. Popup below will be shown. Choose Class option and click the green tick button.
  3. Input Description and click Save.
  4. Save to a package and transport request.
  5. At Methods tab, maintain details as shown below and click on the icon highlighted below to maintain event details.
  6. A popup below will be shown. Tick Event Handler for and fill in Class/interface and Event as shown below. Next, click Change button.
  7. You will see the blue icon as shown below once the event has been defined. Click Parameters button.
  8. In Parameters button, input parameter ES_ROW_NO and press Enter.
  9. The remaining details shown below will be auto populated.

That’s all. You have completed creating an event in global class.