Connect Solutions - REST API for SAP Solution Manager
Business partner mapping (REST API for Solution Manager)
When creating or updating a ChARM object via the REST API, business partners and their roles can be specified in the request in the following form, see https://galileogroup.atlassian.net/wiki/spaces/CONNECTDOCEN/pages/623149089/Endpoints+REST+API+for+SAP+Solution+Manager#Business-Partner .
The property "partnerLookup" usually contains the business partner number, which can be determined using the REST API based on the email address, see https://galileogroup.atlassian.net/wiki/spaces/CONNECTDOCEN/pages/623149089/Endpoints+REST+API+for+SAP+Solution+Manager#GET-%2Fdata%2Fpartner%3Femail%3D%7BemailAddress) . If the email address is not unique or does not exist in the source system, e.g. ServiceNow, it is possible to implement a customer-specific mapping for determining business partners. The prerequisite is that a unique characteristic for determining a business partner exists, which is available in the source system and in Solution Manager.
In the following example, such a unique characteristic is stored as a search term in the business partner master record.
For the implementation of a business partner mapping, an enhancement spot named /GAL/SM_CHARM is delivered in the addon. To create an implementation, proceed as follows.
Call transaction SE19.
Enter the name /GAL/SM_CHARM in the enhancement spot field and click the "Create Impl." button.
In the popup that appears, enter a name for the enhancement implementation according to the naming conventions of your company and confirm the entry with the corresponding button.
In the next popup, the package assignment and the request for a transport request is made. Select a suitable package and transport request or create a new one.
In a further popup the name of the BAdI implementation and the name of the implementing class must be specified. Choose a suitable name based on your naming convention and select the entry /GAL/SM_CHARM_PARTNER_BADI as BAdI definition from the input help and confirm the entry with the corresponding button in the dialog.
Another popup for package assignment is displayed. Here, select the same package as in the previous popup and a corresponding transport request.
After successfully entering all relevant data, the newly created enhancement implementation is displayed.
To perform the customer-specific implementation, double-click on the "Implementing Class" node in the left tree structure and then double-click on the Implementing Class link in the right half of the screen to navigate to the SAP Class Builder. In the method /GAL/IF_EX_CHARM_PARTNER_BADI~ASSIGN_PARTNER you can implement the customer-specific logic for a business partner mapping. The method contains the following definition.
Parameter | Type | Data type | Description |
---|---|---|---|
PROCESS_TYPE | Importing | CRMT_PROCESS_TYPE | The transaction type of the current ChaRM object for which a partner mapping is to be performed. |
PARTNER_FCT | Importing | CRMT_PARTNER_FCT | The role of the partner in the ChaRM object, e.g. developer or change manager. |
PARTNER_PFT | Importing | CRMT_PARTNER_PFT | The category of the partner function in the ChaRM object, e.g. employee or supplier. |
LOOKUP_TEXT | Changing | STRING | The value "partnerLookup" from the REST request. |
The three import parameters can be used for more complex mappings, e.g. if the mapping should be dependent on the partner function or the transaction type.
In our example we only need the value from the changing parameter LOOKUP_TEXT. The following sample implementation shows how a business partner is determined based on the second search term and the found value is returned.