
Use CL_SRT_PUBLIC_IBCR class in your application to create, edit, and delete Identifiable Business Context References (IBCRs).
You can use the CL_SRT_PUBLIC_IBCR class in your application to create, edit, and delete Identifiable Business Context References (IBCRs).
Normally you do not need to create IBCRs (either via an application using this API or manually using SOA Manager) because SAP NetWeaver does this for you automatically when you create IBCs. The most common use of this API is to access the current list of IBCRs in the system and to create an instance of an existing IBCR.
CL_SRT_PUBLIC_FACTORY=>GET_IBCR_HANDLER( ).
The GET_IBCR_HANDLER method returns an instance of the CL_SRT_PUBLIC_IBCR class type with the IF_SRT_PUBLIC_IBCR_HANDLER interface.
This interface contains the following methods for retrieving and creating IBCR instances:
| Method | Level | Description |
|---|---|---|
| LIST | Static method | Query IBCRs. |
| OPEN_BY_ID | Instance method | Creates an instance of an existing IBCR by looking up its ID. |
| OPEN_BY_RECEIVER | Instance method | Creates an instance of an existing IBCR by looking up its IBCR/receiver type and name. |
| CREATE | Instance method | Creates an instance of an IBCR in order to create a new IBCR. |
| EXISTS | Instance method | Checks the existence of an IBCR. |
This interface provides methods for retrieving information, changing, and deleting IBCR instances. Before these operations can be performed, IBCRs must first be instantiated using the OPEN_BY_ID, OPEN_BY_RECEIVER or CREATE methods in the IF_SRT_PUBLIC_IBCR_HANDLER interface.
| Method | Level | Description |
|---|---|---|
| ADD_USAGE | Instance method | Add a usage entry to an IBCR |
| ASSIGN | Instance method | Assign an IBCR to a provider system |
| DELETE | Instance method | Delete an IBCR |
| DELETE_DESCRIPTION | Instance method | Delete a description for a specific language |
| DELETE_USAGE | Instance method | Delete a usage entry of an IBCR |
| GET_ASSIGNMENT | Instance method | Get assignment data |
| GET_BUSINESS_ADDRESS | Instance method | Get the business address |
| GET_DESCRIPTION | Instance method | Get the IBCR description |
| GET_IBC_NOTES | Instance method | Get the IBC notes |
| GET_IBCR_NOTES | Instance method | Get the IBCR notes |
| GET_LAST_CHANGE | Instance method | Get the Last Change date |
| GET_RECEIVER | Instance method | Get the Receiver Information |
| GET_TECHNICAL_ADDRESS | Instance method | Get the Technical Address |
| GET_USAGES | Instance method | Get the Usages of an IBCR |
| GET_VALID_FROM | Instance method | Get the Valid From date |
| GET_VALID_TO | Instance method | Get the Valid To date |
| LOCK | Instance method | Lock an IBCR |
| SAVE | Instance method | Save an IBCR |
| SET_BUSINESS_ADDRESS | Instance method | Edit the Business Address |
| SET_DESCRIPTION | Instance method | Edit the Description |
| SET_IBC_NOTES | Instance method | Edit the IBC Notes |
| SET_IBCR_NOTES | Instance method | Edit the IBCR Notes |
| SET_LAST_CHANGE | Instance method | Edit the Last Change date |
| SET_RECEIVER | Instance method | Edit the Receiver Information |
| 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 |
| UNASSIGN | Instance method | Remove a Provider System assignment |
| UNLOCK | Instance method | Unlock a IBCR |
The following example shows how to retrieve a list of all IBCRs where the IBCR type (RECEIVER_TYPE) is <CLIENT>:
lr_ibcr_handler ?= cl_srt_public_factory=>get_ibcr_handler( ).
data(l_tab_ibcr) = lr_ibcr_handler->list( exporting search_attributes = value #( ( attribute_name = 'RECEIVER_TYPE'
sign = 'I'
option = 'EQ'
low = 'CLIENT' ) )
max_hits = 999 ).
The following example report uses the OPEN_BY_RECEIVER method to instantiate the correct IBCR using the receiver type and name:
report test_ibcr_instantiation.
data l_sender_ibc_id type srt_wsp_ibc_id.
data l_receiver_type type srt_wsp_ibc_receiver_type value 'EPMBUYER'.
data l_receiver_name type srt_wsp_ibc_receiver_name value '0100000000'.
data lr_ibc_handler type ref to cl_srt_public_ibc.
try.
lr_ibc_handler ?= cl_srt_public_factory=>get_ibc_handler( ).
l_sender_ibc_id = lr_ibc_handler->if_srt_public_ibc_handler~open_by_receiver( exporting receiver_type = l_receiver_type
receiver_name = l_receiver_name )->get_ibc_id( ).
catch cx_srt_public_config into data(l_cx_srt_public_config).
write: / l_cx_srt_public_config->get_text( ).
endtry.