Show TOC

Publishing Dynamically Determined ObjectsLocate this document in the navigation structure

Context

You use this procedure when the object to be taken up by the services is not decided until the process flow of the transaction. To avoid having to program several publication calls, you should in this case publish a call back.

You use the callback to return the responsibility for determining the object to generic object services. For this, the services call a method that you have implemented. At runtime, your application only publishes the callback.

Procedure


  1. Implement the method get_object of the interface if_gos_callback in a local class.

    class lcl_myclass definition.
            interfaces if_gos_callback.
            …
    endclass.
    
    class lcl_myclass implementation.
            method if_gos_callback~get_object.
            …
            endmethod.
    endclass.
    
                   
  2. Program the callback (more precise: the publication of the callback).

    data:      go_myobject type ref to cl_gos_manager,
                    lo_callback type ref to lcl_myclass
    …
    create object lo_callback.
    …
    create object go_myobject
            exporting       io_callback = lo_callback
            exceptions      others = 1
    
                   

Results

At runtime, the following now happens:

  1. Your application publishes the callback and provides an instance of your local class lcl_myclass.

  2. As soon as the user demands the menu of available services, method get_object is called from your local class and thus determines the current object.

  3. The symbol for the toolbox is inserted in the screen (GUI) next to the title.