Events

Use

An application itself can react to events of their own appointments in the appointment display, whereas the events of other appointments are handled by the appointment display. The criterion used by the application to differentiate between own and other appointments is the appointment type. You can differentiate between the following events:

Events in the framework of ABAP objects

The objects can react to the events for which they have registered (using set handler). This enables appointments of the application to react to events within their own application context according to their requirements.

Events using the appointment-type exit

A function module is called when an event of a specific appointment type occurs. This enables objects that do not exist in the current application context to also react to the events.

Activity management reacts to the event Double-click on appointments of the appointment type Activity plan appointment, in the appointment display. It registers for this event at runtime. If the user double-clicks on an activity plan appointment in the calendar for activity management, activity management then displays the associated activity.

If the calendar was not called within activity management but in another application context, this mechanism does not work because activity management is not running (is not instantiated) and is therefore not registered for the event. In this case, a function module is called using the appointment-type exit function. This function module calls the activity.

Features

The CL_ORGANIZER class provides the following events:

APPT_CREATED

This event is triggered if a user double-clicks on a free time period.

Export Parameters

Parameter

Description

EX_TIME_FROM

Start time and end time of the selected time interval

EX_TIME_TO

EX_DATE

Date of the selected time interval

EX_DOMINANT

Indicates whether it is an all-day event, that is, whether the area above the time intervals was selected.

APPT_SELECTED

This event is triggered if a user double-clicks on an appointment.

Export Parameters

Parameter

Description

EX_APPT_ID

Appointment ID of the selected appointment

EX_DISPLAY_MODE

Indicates whether the appointment was selected in display mode

The CL_ORGANIZER class provides a method (SET_REGISTERED_EVENTS) that you can use to restrict registration for an event to appointments of a certain type.

SET_REGISTERED_EVENTS

You use this method to handle events of appointments of a certain type.

Table

IM_REGISTERED_EVENTS (APPT_TYPE name of appointment type and EVENT event)

Exit Function

All other events are handled using the appointment-dependent exit function (see API description).

Activities

After the appointment display is instantiated, you can register the application for the events that the CL_ORGANIZER class provides.

You can also configure the system so that the triggering of an event causes the flow logic of the subscreen container to run. It is useful to run the PAI and the PBO for the screen particularly if appointment-specific data, such as the appointment time and title, are to be displayed in specific screen fields.

The APPT_CREATE and APPT_SELECTED events are system events. A function code is generated for each system control event from the ABAP control framework. You have to register the function code at the ABAP control framework. You can react to this in PAI.

You have to implement a class to provide the handling methods for the events. You have to register the function codes at the control framework in these methods. You can also define the class locally in the function group of the subscreen container.

The example shows the procedure for registering an application for the APPT_SELECTED event.

Defining and implementing local handling classes

Local classes are usually defined in the top include of the function group. The implementation can be contained in separate includes.

The ON_APPT_SELECTED method of the LCL_HANDLER class stores the appointment ID specified by the event and registers a function code at the control framework.

Instantiating the control container and appointment display

In the subscreen container, a GUI container is made available and instantiated together with the appointment display.

Registering an application for events in the calendar framework

The application registers for the APPT_SELECTED event for appointments of the appointment type ORDER.

Registering own handling methods

The LCL_HANDLER class is instantiated and its event handling method is registered for the APPT_SELECTED event.

Displaying the organizer

The organizer is displayed when the SHOW method is called in the appointment display.

Reacting at PAI

The function codes for the GUI status and the function code for processing the APPT_SELECTED event are processed in the PAI of the subscreen container.

Process flow when the user double-clicks on an appointment

The following process flow shows the steps that the program goes through when the user double-clicks on an appointment:

  1. PBO of the subscreen container is run.
  2. The organizer is displayed.
  3. Double-click executed on the appointment.
  4. The APPT_SELECTED event is triggered from the calendar framework.
  5. The ON_APPT_SELECTED handling method is called.
  6. PAI is run with the (newly registered) function code sccon_appt_selected.
  7. PBO of the subscreen container is run, and so on.