Connection to the Class Interface

Use

You can integrate the appointment calendar in your application using the class interface. The class interface is called CL_APPOINTMENT and consists of a set of public methods that allow appointments to be created, read, edited, changed, and deleted. Other methods can be used to instantiate one or more appointments from application objects or application GUIDS or using an iCalendar object.

Activities

Instantiating an Appointment

You normally instantiate an appointment using the constructor, which you call with the initial GUID. Existing appointments can be identified by the import parameter GUID.

You can use the SELECT_BY_APPLICATION_GUID method to determine instances of appointments that were created with reference to an application object.

In the case of iCalender appointments, the CREATE_FROM_ICAL_OBJECT method returns one or more instances of these appointments.

Appointment Attributes

Appointment attributes are changed or read using the SET_... methods or GET_... methods. Important attributes are the participants, the rules, and the related application objects (RELATED_OBJECTS).

There is a SET method for almost every attribute individually. As a result, you can change an individual appointment attribute without the other attributes having to be read and transferred again when saved.

Saving

The SAVE method is used to create a new appointment in the database or to modify an existing appointment in the database. A new appointment is an instance created without the appointment GUID (see above).

Deleting

The DELETE method deletes an appointment in the database. New appointments that have not yet been created in the database cannot be deleted. In the case of periodic appointments, all instances of the period are deleted. If only one individual instance is to be deleted, this instance must first be determined by the GET_PERIOD_INSTANCES method. It can then be deleted using its DELETE method.

When an appointment is deleted, it also disappears from the appointment calendars of all the participants. You cannot delete an appointment from the calendar of an individual participant using this method. To do this, you have to remove the participant from the participant list.

Participants

A participant of an appointment can be an SAP user, a distribution list, or a business object. If the business object ADDRESS is used, Internet addresses, for example, can also appear as participants.

You add participants to an appointment using the ADD_PARTICIPANTS method, you read participants using the GET_PARTICIPANTS method and you remove participants using the DELETE_PARTICIPANT method.

Rules

You can create a periodic appointment by adding a rule to an appointment using the SET_RULE method. You cannot, however, read the individual instances of the periodic appointment until you have saved the period appointment using the SAVE method.

A rule is an object of the class CL_APPOINTMENT_RULE. Users normally create rules from the interface, which they can integrate in their application using the EDIT method, or they instantiate them using the known rule ID.

You use the GET_RULE method to request an instance of the rules assigned to the appointment.

Editing

You use the EDIT method to change appointments in dialog. In the case of appointments of types that belong to your application, you can provide your own interface using your exit function module. In other cases, you can use the appointment calendar standard dialog. Appointment calendar authorizations are not checked in the EDIT method.

Changes made by the user do not become effective in the database until the SAVE method has been called. You must, therefore, call the SAVE method after the EDIT method.

Displaying

The DISPLAY method displays appointments. With regard to the interface, the same applies as with the EDIT method.

Appointment Classes

There are two types of appointments. Full appointments and small appointments. Small appointments have considerably fewer attributes than full appointments. Besides the appointment GUID and the application GUID, small appointments only have the rule and a time stamp with the time zone for the start time and end time of the appointment.

You can only use a limited number of appointment methods on small appointments and you cannot switch between the two appointment classes. Once defined, an appointment keeps its class for its entire lifetime.

You have to decide whether to create a full appointment or a small appointment when the appointment object is instantiated. You can specify the class using the constants CL_SMALL_APPOINTMENT or CL_FULL_APPOINTMENT. The standard setting is a full appointment.

Internal ID

Besides its GUID, every appointment also has an internal ID (INTERNAL_ID). In theory, you can also address an appointment using this ID. In contrast to the appointment GUID, however, the internal ID can change during the appointment's lifetime. You are, therefore, not advised to use this ID as a reference to this appointment.

You may, however, be able to use this ID for certain function modules from the old interface.