Working with the SAP Calendar Control
Use
This section describes the specific functions of the SAP calendar control.
The process described in this section represents only a control-specific enhancement of the general control integration process and cannot be used separately.
Process
Instantiating
-
Define a reference variable for the SAP calendar control:
DATA calendar TYPE REF TO cl_gui_calendar.
-
Create an instance of the SAP toolbar control:
CREATE OBJECT calendar
EXPORTING parent = container
view_style = view_style.
-
Set the calendar to a specific date:
CALL METHOD calendar->go_to_date
EXPORTING focus_date = sy-datum.
Registering the events
-
Register Events for the SAP Calendar Control. The control supports the following events:
|
Event Name |
Meaning |
|
CTXMENU_REQUEST |
Requesting a context menu with the right mouse button |
|
CTXMENU_SELECTED |
Choosing an option of the context menu |
|
DATE_SELECTED |
Selecting a date / date range |
|
INFO_REQUEST |
Scrolling beyond the area that was defined using method set_day_info |
Destroying the controls
Controls are normally destroyed by Lifetime Management. However, if you want to destroy the controls manually in your program, you must proceed as follows:
-
Destroy the calendar control at the frontend. If you do not need the control container any more, destroy it as well.
CALL METHOD calendar->free.
-
Delete the reference variable of the calender control:
FREE calendar.