Starting Only One Service Directly 

Use

You only want to offer one service for your object. The service is started directly, that is, not only when the button is pressed.

Procedure

  1. When generating an instance from cl_gos_manager you do not enter an object ID. Thus the object is not published:
  2. data: go_myobject type ref to cl_gos_manager.

    create object go_myobject.

  3. The name of the service requested (from table SGOSATTR) provides you with the method start_service_direct, for example for the service Displaying Attachments:

data: ...,

lo_container type ref to cl_gui_custom_container,

ls_object type borident.

call method go_myobject->start_service_direct

exporting ip_service = ‚VIEW_ATTA‘

is_object = ls_object

io_container = lo_container.

You can enter a control container for specific services in the parameter io_container. The services that allow this option can be found in table SGOSATTR.