Use
Instead of a toolbox in a separate window, you can insert the service in a context menu that can be displayed by positioning the cursor on the object and right mouse-clicking.
Procedure
data: go_myobject type ref to cl_gos_manager.
…
create object go_myobject.
data: ...,
lo_menu type ref to cl_ctmenu,
ls_object type borident.
…
call method go_myobject->get_context_menu
exporting is_object = ls_object
importing eo_menu = lo_menu.
The import parameter lo_menu contains a reference to the context menu.
call method go_myobject->dispatch_menu_command
importing ip_fcode = lp_fcode
io_menu = lo_menu.
You only have to request lo_menu here if you have requested more than one context menu within the same instance from cl_gos_manager.