Technical Enhancements 
Steps required to create a contract interface
Define additional product attributes required using the concept of a template installed base.
Map the CRM product identification to the product in the external system.
Define the attributes used to save the reference to the external system.
User status for controlling contract distribution.
Enhance transaction data in the external interface BAdI
Mapping In/Outbound Business
Transaction Interface
CRMXIF_ORDER_MAP
Connect external systems using the
Business Connector
It may be necessary to save the reference to entities created in the external system in the CRM transaction, or more precisely in the individual object assigned, and to send this data in the case of contract changes. The API function module ISTCRM_IBASE_EXT_REF_ADD is available to do so, which creates a new object with the data transferred in an existing installed base.
Prerequisites for use:
Object family (in a single set type) exists with the attributes required to save the reference.
Object family has been released for the installed base categories.
The set type has been mapped to the _SAP_EXT_REF_ service and the characteristic names used in the interface are mapped to the attribute names in CRM.

Object: |
Assigned to: |
|---|---|
Object family 0815 Set type ZEXT_REF Attribute ZVERTRAG Attribute ZKUNDE
|
Installed base category IT Service _SAP_EXT_REF_ Characteristic SUBSCRIPTION Characteristic XY_CUSTOMER
|
This module expects to receive characteristics in a table with the name/value format (example: Name: SUBSCRIPTION Value: 12345) and the ID of the existing installed base. The module can be accessed in the response section of the
Mapping In/Outbound
Business Transaction Interface
CRMXIF_ORDER_MAP BadI.
The status can be as complicated as the application and variety of involved processes requires. It is essential that the status in conjunction with the system status controls whether the transaction change is relevant to distribution and which data is to be transferred. You must program the corresponding evaluation in the external interface BAdI or the
Business Connector.
Updates for the user status must also come from there.

The user status profile consists of the following statuses:
Open
Active
Canceled
These statuses can only be set in this order and only one status can be set at the same time.
The following status also exists in parallel:
Errors occurred
The following rules for interface programming can be derived from this status:
If the
Errors occurred status
is set, the system should not perform any additional activity. Errors must be resolved manually. By reversing the status, you can trigger new determination.
In other cases, you must evaluate using the following matrix:
System status |
User status |
Action |
Subsequent user status |
|---|---|---|---|
|
|
|
|
|
|
|
|
Other combinations are not admissible.
Transaction data is already available within the BAdI in the complex CRMXIF_BUSTRANS structure (CS_DATA_MAPPED parameter), which is sent to the targets defined in the middleware following processing in the BadI. Additional data can be attached to this structure using an
append. This can be done in a generic way using attribute names/value pairs or in a structure that has been adapted to the product attribute. The generic solution must be evaluated in the
Business Connector.
The more inflexible solution saves some effort here, which is later required during BadI programming, since the APIs for use of the additional product attributes always expect these in a generic format.
However, some evaluations must be performed for each of the transaction items recorded in the complex structure first:
The item category normally determines whether the item is to be distributed.
The status and the user status determine whether actions are performed and which commands are sent to an external system.
Several installed bases can be linked to the transaction item and if this is the case, you must determine the relevant installed base.
The ISTCRM_IBASE_SERVICES_GET
Read Service Attributes and Values Entered in the Contract
Installed Base
function module supplies the transaction item for the installed base and product.
External product description and logical system (Service _SAP_EXT_PRD_).
Billing period and date (service _SAP_EXT_BIL_).
Additional attributes (service created for additional attributes), if available.
Key for external entities (service _SAP_EXT_REF_), if available.
Data is available with the external attribute names according to the set type/service mapping and must be recorded in the interface according to its requirements.
If it is not possible to use the external interface BadI and enhance the structures using an append, it is possible to send the data to the Business
Connector
in advance in an unfiltered format and therefore not define the BadI. RFC calls to the CRM System can be initiated from here. All evaluations regarding the transaction item for the status/installed base can be performed and additional attributes returned in these RFC-enabled modules. This means you do not have to enhance the structure of the external interface but improves programming in the Business
Connector
and the CRM System. You should give priority to the first solution for performance reasons.