Creating Contracts

Prerequisites

The semantic contract on which the contract is based must exist in the system.

Context

With the semantic contract at hand, the integration architect or the developer creates a concrete contract. The contract inherits the actors and operations from the semantic contract and defines the communication type and the signatures of the operations. In the case of Web service communication, the signatures are added by referencing the concrete message types. Since it is the basis for communication between two systems, the contract has to be available in both systems. Multiple contracts can be created for a single semantic contract.

There are two ways to create a contract:

  • Manually, by entering all necessary information into the Enterprises Services Wizard (see below).

  • Automatically, by importing a contract schema (XML file).

    Importing a schema creates a complete contract that can be activated immediately. No further editing is required. It contains all required consumer and provider information, as well as the message types.

    See Creating Contracts from Schemas

Procedure

  1. Open the Enterprise Services Wizard.

    You can also create a contract directly from a semantic contract by choosing Create Contract in the menu bar of the semantic contract editor. To do this, the semantic contract must be active.

    For more information, see Enterprise Services Wizard.

  2. Select Backend as the Generation Source.
  3. Specify the ABAP Name of the semantic contract that is referenced by the contract.
  4. On the Transport node, enter the Package name and transport Request (as appropriate).
  5. Choose Complete to close the wizard.
    The contract is displayed.
  6. On the Detail View tab, specify the Communication Type: Web Service and RFC are currently supported.
  7. On the Detail View tab, set the request, response, and fault messages for each operation, as needed.

    If RFC is set as the communication type, you need to specify values for the following parameters:

    • RFC Consumer - The RFC consumer that is called by the contract.
    • RFC Operation - The RFC operation that is called by the contract.
    • Synchronous flag - If the communication is synchronous or asynchronous.
    • RFC Name - The actual RFC function module called by the contract. Contains the RFC Operation.
    If you want to realize an opration as event, select Operation via Event.
  8. Save the contract and activate it.

Results

A contract has been created. You can now create a contract implementation for one of the actors. You can create a contract implementation directly from the contract by choosing Create Contract Implementation in the menu bar.