Processing Office Application Events
Use
You can interpret events triggered by the office application or users of the office application in your ABAP program and respond to them. The following events exist:
-
on_custom_event: The event is triggered by the office application user. You must initialize this event when you call the document
-
on_close_event: This event is triggered when you close the document to be edited in the office application. This allows you still to save the document.
Process
-
Register the events that you want to interpret in your program. You do this in the method call for init_control on the instance of type i_oi_container_control.
-
Create the processing logic for the registered events in a class of your own. You can use static methods or object methods here.
-
After initializing the document ( method get_document_proxy), define the event handling. You can use static methods and object methods to react to the events.
-
Static Methods
SET HANDLER c_event_handler=>close_event FOR document. SET HANDLER c_event_handler=>custom_event FOR document.
-
Object Methods
DATA o_event_handler TYPE REF TO class_event_handler. CREATE OBJECT o_event_handler. SET HANDLER o_event_handler->close_event FOR document. SET HANDLER o_event_handler->custom_event FOR document.
-
-
In each PAI module of your program that can be called while the desktop application is active, include the following method call for dispatching control framework events:
CALL METHOD cl_gui_cfw=>dispatch IMPORTING return_code = return_code.