Entering content frame

Function documentationCLOSE Locate the document in its SAP Library structure

Use

This event is triggered when the user clicks the Close button in the dialog box. By handling the event, you can close the dialog box when the user does this.

For further information, refer to Structure link Event Handling, and to Structure link Lesson 2: Event Handling of the Controls Tutorial.

Features

You need to add the following coding to your program.

Declaration Part

data close_event type cntl_simple_events.

 

class lcl_dialogbox_handler definition.

public section.

    methods: on_dialogbox_close

      for event close of cl_gui_dialogbox_container

      importing sender.

endclass.

 

class lcl_dialogbox_handler implementation.

  method on_dialogbox_close.

    if not sender is initial.

      call method sender->free

        exceptions

          others = 1.

      if sy-subrc <> 0.

        *Error handling

      endif.

      free dialogbox_container.

      clear dialogbox_container.

      endif.

  endmethod.

endclass.

 

data: dialogbox_handler type ref to lcl_dialogbox_handler.

After Creating the Dialog Box Container

If dialogbox_handler is initial.

      create object dialogbox_handler.

      endif.

 

    set handler dialogbox_handler->on_dialogbox_close

      for dialogbox_container.

 

Leaving content frame