Lesson 3 of 6
Agreement templates and agreements
10 min
Listen to this lesson
Profiles say who the parties are. Agreements say what they exchange and how. TPM separates the reusable part of that answer, the agreement template, from the partner-specific part, the trading partner agreement. For Contoso, the reusable part is "how a fleet customer orders alternators by X12"; the partner-specific part is how Great Lakes Fleet Services does it.
The agreement template
SAP describes an agreement template as a template of a semantic choreography made of one or more business transactions. Its settings are defaults that each agreement reuses and may override. You create one under Design > B2B Scenarios, on the Agreement Templates tab, with Create. On the Overview you set:
- Name and Description, for example "X12 4010 fleet customer order-to-invoice".
- Initiator: the party that triggers the first business transaction. For customer orders that is the trading partner.
- Version: 1.0 by default.
- My Company Details: the company system, type system, type system version and the company identifier.
- Common Details for the partner side: the type system and version and aliases for the partner's system and identifiers, which each agreement fills with real values.
Templates come in a newer format. SAP notes that templates in the outdated format are read-only until you migrate them, so a tenant that has been in use for a while may hold both kinds.
Business transactions inside the template
On the template's B2B Scenarios tab you add business transactions with Create. Each transaction has a name, a Business Transaction Pattern (one-way or two-way), a Pass-Through option for documents that are only forwarded, and My Company Role: initiator or reactor. A one-way transaction has one business transaction activity (BTA); a two-way transaction has two. Each activity is configured as a chain of steps:
- Sender communicationThe adapter the document arrives on, such as AS2 or IDoc, and for AS2 the channel for the sender's functional acknowledgment.
- Sender interchangeThe MIG for the incoming message, transaction mode (Message or Interchange), whether to create a functional acknowledgment, and interchange number settings.
- MappingThe MAG from Integration Advisor, or a ProcessDirect call to your own mapping flow.
- Receiver interchangeThe MIG for the outgoing message and how the outgoing envelope is assembled.
- Receiver communicationThe adapter and channel the result leaves on, such as IDoc to SAP S/4HANA or AS2 to the partner.
For Contoso's template, Theo defines four transactions. Customer order: Great Lakes is initiator, X12 850 arrives by AS2, the MAG maps it to ORDERS05, and an IDoc goes to SAP S/4HANA, where it creates a sales order. Order response: Contoso initiates from an ORDRSP IDoc (basic type ORDERS05) and sends an 855. Ship notice: a DESADV IDoc (basic type DELVRY07) becomes an 856. Invoice: an INVOIC IDoc (basic type INVOIC02) becomes an 810.
Several sender-interchange settings matter for testing later. Transaction Mode decides whether one bad transaction set rejects the whole interchange (Interchange) or only itself (Message, the default). Create Functional Acknowledgement decides whether TPM sends a 997 or CONTRL. And Send Test Interchange to Target System decides whether interchanges flagged as test (ISA15 = T in X12, test indicator 1 in the EDIFACT UNB) are passed to the target system at all.
From template to agreement
A trading partner agreement is the binding arrangement between your company and one trading partner for a specific B2B exchange. You create it on the Agreements tab from a template, choose the trading partner, and then fill or override what the template left open: the partner's system, identifiers and type system version, the partner's MIG where it differs, partner-specific mapping, communication channels and number ranges. Everything you don't override stays as the template defined it.
| Setting | Usually in the template | Usually in the agreement |
|---|---|---|
| Business transactions and roles | Yes: the four fleet transactions | Rarely: drop one the partner doesn't use |
| Company identifier and system | Yes | No |
| Partner identifiers and system | As aliases only | Yes: GLFLEETEDI, Great Lakes' AS2 system |
| MIG versions | The standard version (X12 004010) | The partner's MIG if it differs |
| Mapping | The standard MAG | A partner-specific MAG only when rules differ |
| Communication channels | Adapter type | URL, AS2 IDs, MDN settings, certificates |
A practical split between template and agreement for Contoso's fleet customers.
Activating and updating
An agreement does nothing until it is activated. Open it and choose Activate, then pick a mode. Default activates the agreement and its communication channels but not referenced security configurations, identifier groups or custom rules; if any of those are still inactive, activation fails. Full activates the agreement and every referenced object, even objects already active. A successful activation sends the agreement to the Partner Directory; a failed one shows a Failed status you can open for details.
To change an active agreement you choose Edit, make the change, Save, choose an activation mode, select the transactions affected and confirm with Update. TPM also lets you copy an agreement, which is the fastest way to start a similar partner.
What would you do?
Theo activated the new Great Lakes agreement with the Default mode and it failed. The agreement uses a new security configuration and a new identifier group created yesterday and never activated. What should he do?
- An agreement template is a reusable choreography of business transactions whose settings act as defaults.
- Each business transaction activity runs sender communication, sender interchange, mapping, receiver interchange and receiver communication.
- Agreements bind the company to one partner and override only what is partner specific.
- Activation pushes the agreement to the Partner Directory; Default activation fails if referenced objects are inactive, Full activates them too.
Check your understanding · not graded
Lesson check
1. In Contoso's customer order transaction, who is the initiator?
2. What does the Transaction Mode setting Message do when one of five transaction sets in an interchange fails validation?
3. Which activation mode also activates referenced security configurations, identifier groups and custom rules?
4. Where should a mapping rule that only Great Lakes Fleet Services needs normally live?