Use
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
class lcl_myclass definition.
interfaces if_gos_callback.
…
endclass.
class lcl_myclass implementation.
method if_gos_callback~get_object.
…
endmethod.
endclass.
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
Result
At runtime, the following now happens: