I had to recently work with SLD API to mass create business systems. There were over thousands of business systems to be created and we needed a solution to automate the process as going to SLD for each business system creation will be very time consuming process as the tasks require business system creation, linking with other business systems etc.

Overview of the steps involved.


1. Navigate to SLD and look at the Development area . Click on CIM Classes ( bottom right in the below image ).



  1. Find the CIM class you’re interested in – in our case we’re interested in “Business System”.



  1. Click on the Class Diagram. This is important as this will understand objects that need to be created. This is important to understand as when we create a business system, system creates various objects – the class diagram helps to understand the relationships. Some objects are directly linked and others have an indirect relationship.



  1. Again in SLD Development area, click on CIM Classes and chose the class name as “Business System”.




Chose a business system to display. All associations need to be created for successful creation of business system.



  1. Look at examples in package SLD_API. You can do a good test by copying program SLDAPI_READ_EXAMPLE to do a read test and SLDAPI_WRITE_EXAMPLE for writing to SLD.


With information from these three sources, we’re good to start ABAP development.

Steps to get a handle of a SLD object

  • SLD operations require the “handle” of the object to be retrieved before it can be used for operations. It involves the following steps

  1. Create a filter using class CL_SLD_FILTER.

  2. Add pattern to the filtter for property “Name” and the value. It will be the object value . Look in SLD CIM Instance to get the string to be created. As an example, technical system name is <TS_NAME>.Systemhome.<Hostname>

  3. Get the list of instances by supplying cname as the name for the object and filter object created.

  4. Loop at instances and get the ‘CreationClassName’ . If the value matchesthe classname we’re looking for, store the object.

  5. Call get_objectname to get the system handle.


E.g sample code for creating technical system
  concatenate p_tec_sys_name ‘.SystemHome.’ p_hostname into lv_tech_sys_full_name.
  create object lo_filter.  lo_filter->add_pattern( pname = ‘Name’                          value = lv_tech_sys_full_name ).
  lt_instances = o_accessor->enumerate_instances( cname = gc_sap_appl_sys  filter = lo_filter ). “’SAP_ApplicationSystem
  loop at lt_instances into lo_instance.    lv_classname = lo_instance->get_property( pname = ‘CreationClassName’ ).    i_sld =  lo_instance->get_properties( ).
    if  lv_classname = gc_sap_standal_sys . “’SAP_StandaloneJavaSystem’      c_tec_sys = lo_instance.      c_tec_sys_handle = lo_instance->get_objectname( ).      exit.    endif.
  endloop.


Process of creating SLD objects:

  1. Create an object of type CL_SLD_CIM_INSTANCE passing the classname from SLD CIMInstance and accessor ( an object of type reference to class CL_SLD_ACCESSOR ).

  2. Set property ‘CreationClassName’ as the name of the class from SLD CIMInstance.

  3. Set property name

      d)  Set any other attribute ( like caption , description etc )

  1. Finally write to SLD by using CREATE_INSTANCE method of accessor ( reference to class CL_SLD_ACCESSOR )


Sample code:
          create object lo_bus_sys “type CL_SLD_CIM_INSTANCE            exporting              classname = gc_sap_bus_sys   “’SAP_BusinessSystem’              accessor  = o_accessor.    “type CL_SLD_ACCESSOR
lo_bus_sys->set_property( pname = ‘CreationClassName’                    value = gc_sap_bus_sys ). “SAP_BusinessSystem
lo_bus_sys->set_property( pname = ‘Name’                    value = p_bus_system ).
…….Set other attributes…..c_handle = o_accessor->create_instance( iref = lo_bus_sys ). “c_hanlde is a string

Steps we took to create business systems:

  1. Get handle of PI Integration Server Business system

  2. Get handle for the group of business systems we’ll be creating

  3. Get handle of technical system

  4. Create business system

  5. Create business system GUID

  6. Attach GUID to the business system

  7. Create entry for SAP_BusinessSystemViewedStandaloneJavaSystem ( using BS and TS handle – it links the BS and TS )

  8. Create entry for SAP_BusinessSystemExchangeServer ( using BS and IS ( Integration Server ) handle – it assigns the IS for the BS )

  9. Create entry for SAP_LogicalALESystem

  10. Create entry for SAP_ALESystemViewedBusinessSystem

  11. Add the business system to collection using the group handle from b)

  12. Create relationship with other business systems ( dev -> pre-prod, prod etc).

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply