Show TOC

Public API for Creating, Editing, and Deleting IBCsLocate this document in the navigation structure

Use the CL_SRT_PUBLIC_IBC class in your applications to create, edit, and delete Identifiable Business Contexts (IBCs).

Overview

You can use the CL_SRT_PUBLIC_IBC class in your applications to create, edit, and delete Identifiable Business Contexts (IBCs). For example, an application could automatically create IBCs to act as proxies for new company codes created in your SAP system, where the company codes need to communicate via web services with other entities, either inside or outside of your SAP landscape.

Instantiation

CL_SRT_PUBLIC_FACTORY=>GET_IBC_HANDLER( ).

The GET_IBC_HANDLER method returns an instance of the CL_SRT_PUBLIC_IBC class type with the IF_SRT_PUBLIC_IBC_HANDLER interface.

IF_SRT_PUBLIC_IBC_HANDLER Interface

This interface contains the following methods for retrieving and creating IBC instances:

Table 1:
Method Level Description
LIST Static method Query IBCs.
OPEN_BY_ID Instance method Creates an instance of an existing IBC by looking up its ID.
OPEN_BY_RECEIVER Instance method Creates an instance of an existing IBC by looking up its IBC/receiver name.
CREATE Instance method Creates an instance of an IBC in order to create a new IBC.
EXISTS Instance method Checks the existence of an IBC.
IF_SRT_PUBLIC_IBC Interface

This interface provides methods for retrieving information, changing, and deleting IBC instances. Before these operations can be performed, IBCs must first be instantiated using the OPEN_BY_ID, OPEN_BY_RECEIVER or CREATE methods in the IF_SRT_PUBLIC_IBC_HANDLER interface.

Table 2:
Method Level Description
DELETE Instance Method Delete an IBC
DELETE_DESCRIPTION Instance Method Delete the Description for a specific language
GET_BUSINESS_ADDRESS Instance Method Get the Business Address
GET_DESCRIPTION Instance Method Get the Description for a specific language
GET_DESCRIPTIONS Instance Method Get all Descriptions (that is, for all languages)
GET_IBC_ID Instance Method Get the IBC ID
GET_IBC_NOTES Instance Method Get all Notes
GET_RECEIVER Instance Method Get all Receiver information
GET_RECEIVER_NAME Instance Method Get the Receiver Name (the IBC Name)
GET_RECEIVER_SYSTEM Instance Method Get the Receiver System Information
GET_RECEIVER_TYPE Instance Method Get the Receiver Type
GET_TECHNICAL_ADDRESS Instance Method Get the Technical Address
GET_VALID_FROM Instance Method Get the Valid From date
GET_VALID_TO Instance Method Get the Valid To date
IS_IBC_LOCKED Instance Method Check if an IBC is locked
LOCK Instance Method Lock an IBC
SAVE Instance Method Save an IBC
SET_BUSINESS_ADDRESS Instance Method Edit the Business Address
SET_DESCRIPTION Instance Method Edit the Description
SET_IBC_NOTES Instance Method Edit the Notes
SET_TECHNICAL_ADDRESS Instance Method Edit the Technical Address
SET_VALID_FROM Instance Method Edit the Valid From date
SET_VALID_TO Instance Method Edit the Valid To date
TERMINATE Instance Method Terminate an instance (and remove any database locks)
UNLOCK Instance Method Unlock an IBC

Example

Creating an IBC
The following example shows how an IBC can be created containing:
  • Name
  • Type
  • Description
  • Valid From date
  • Valid To date

<impl_class_name> is the name of the implementing class of the IBC type, which you must create separately. See Implementing a Class for IBC Usage

Sample Code
lr_ibc_handler ?= cl_srt_public_factory=>get_ibc_handler( ).
      check lr_ibc_handler->if_srt_public_ibc_handler~exists( receiver_type = <receiver_type>
                                                              receiver_name = <receiver_name> ) ne abap_true.

      lr_ibc_handler->if_srt_public_ibc_handler~create( exporting receiver_type = <receiver_type>
                                                                  receiver_name = <receiver_name>
                                                                  class_name    = <impl_class_name> ) .
      lr_ibc_handler->if_srt_public_ibc~set_description( exporting description = description
                                                                   language    = sy-langu ).

      lr_ibc_handler->if_srt_public_ibc~set_valid_from( valid_from = valid_from ).
      lr_ibc_handler->if_srt_public_ibc~set_valid_to( valid_to = valid_to ).
      lr_ibc_handler->if_srt_public_ibc~save( ).