Product Documentation > Outbound messaging

Version: 9.32204-rev3 / Last update: June 15, 2022

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
page

Pre-requisite: How to identify event triggers?

Identifying the right SAP Business Object to capture creation/changes for is key for Event-driven integration.

Therefore we recommend in non-obvious cases to to perform an event trace. When a business event is triggered, you can see the complete transaction history and search for the specific type of object that was triggered.

  • Easily find which business object caused a specific event to trigger

  • Activate event trace transaction SWELS

  • Switch Off and On.

Important: Activating event traces increases system load. Therefore we recommend to make use of the ‘Restrictions’ settings, at least to the user name.

  • Perform an action in your desired business process — e.g. go to a typical business transaction or SAP Fiori app and perform the changes you are considering to trigger the change.

  • After that, display event trace in transaction SWEL

  • Look at the triggered Object Type.

For a list of all available SAP Business Objectsa and their events, you can use transaction SWO3. It shows a structured list of available objects.

Please also see section How to create custom events in case your desired SAP Business Object does not come with standard events.

Set-up outbound messaging

For outbound messaging, you can use and even combine the following methods:

  • Simple Notifications
  • Message Builder (Generic View Generator)
  • IDoc capturing
  • Custom-built triggers and extractors

Pre-requisite for all methods is to create a message type, which will be used throughout the configuration process.

The following articles explain the individual possibilities.

Create Message Type

Note: In the example below, we use the Sales Order (BUS2032) event.

Please use suitable data for your use-case as required.

For each object to be sent you need to create a message type:

  • Transaction: WE81
  • Add New Entry and specify:
    • Message Type: unique name for the integration
    • Description: description of the purpose

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Activate Message Type

  • Transaction: BD50
  • Add New Entry and specify:
    • Message Type: the created message type
    • Active: tick the checkbox

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Simple Notifications

Create Outbound Object configuration

  • Transaction: SPRO
  • Goto ASAPIO Cloud Integrator – Connection and Replication Object Customizing
  • Or go directly to transaction: /ASADEV/68000202
  • Select the created Connection
  • Go to section Outbound Objects
  • Add New Entry and specify:
    • Object: name of the outbound configuration
    • Extraction Func. Module: /ASADEV/ACI_SIMPLE_NOTIFY
    • Message Type: the created message type
    • Load Type: Incremental Load
    • Trace: activate for testing purposes

This example uses the built-in notification event.

Set-up target endpoint in ‘Header Attributes’

Configure the topic / queue / event hub name to send the events to:

  • Go to section Header Attributes
  • Add New Entry and specify:
    • Header Attribute: AZURE_TOPIC (mandatory)
    • Header Attribute Value: the topic/queue/event hub

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Set up ‘Business Object Event Linkage’

Link the configuration of the outbound object to a Business Object event:

  • Transaction: SWE2
  • Add New Entry and specify:
    • Object Category: BO BOR Object Type
    • Object Type: the Business Object Type sending the event
    • Event: the event to react to
    • Receiver Type: the message type of the outbound object (this is the link to the Addon configuration)
    • Receiver Call: Function Module
    • Receiver Function Module: /ASADEV/ACI_EVENTS_TRIGGER
    • Linkage Activated: tick the checkbox

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Test the outbound event creation

In the example above, please pick any test sales order in transaction /nVA02 and force a change event, e.g. by changing the requested delivery date on header level.

Message Builder (Generic View Extractor)

Message Builder uses SAP Data Dictionary Views (database views) to model the payload of a message. It can extract and format data based on the table and field selection of the database view. The formatter nests the data based on the relations of the tables.

Create database view

For the data events also configure the DB view that is used to define the extraction:

  • Transaction: SE11 (for SAP ERP or S/4HANA on-prem deployments with SAP GUI access)
  • Alternatively, you can use other supported development environments, e.g. WebIDE, Business Application Studio, Eclipse with ABAP Development Tools, or the SAP Fiori App “Create Custom CDS Views” to create a database view.

Example: Material master view (e.g. to be used for Material Master (BUS1001) change events)

Create Outbound Object configuration

  • Transaction: SPRO
  • Goto ASAPIO Cloud Integrator – Connection and Replication Object Customizing
  • Or go directly to transaction: /ASADEV/68000202
  • Select the created Connection
  • Go to section Outbound Objects
  • Add New Entry and specify:
    • Object: name of the outbound configuration
    • Extraction Func. Module: /ASADEV/ACI_GEN_VIEW_EXTRACTOR
    • Message Type: the created message type
    • Load Type: Incremental Load
    • Trace: activate for testing purposes
    • Formatting Function: /ASADEV/ACI_GEN_VIEW_FORMATTER
    • Extraction View Name: name of the DB view

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Set-up ‘Header Attributes’

Configure the topic / queue / event hub name to send the events to:

  • Go to section Header Attributes
  • Add New Entry and specify the header attributes and values

Please note the header attributes are endpoint/platform specific. Here are examples:

Header attribute Header attribute value Example required for Connector
AZURE_TOPIC the topic/queue/event hub MaterialMaster Microsoft Azure
ACI_ADD_LOGSYS To add the logical system to the top level of the payload.

Only works for the generic view extractors / formatters

X All connectors – optional

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Set up ‘Business Object Event Linkage’

Link the configuration of the outbound object to a Business Object event:

  • Transaction: SWE2
  • Add New Entry and specify:
    • Object Category: BO BOR Object Type
    • Object Type: the Business Object Type sending the event
    • Event: the event to react to
    • Receiver Type: the message type of the outbound object (this is the link to the Addon configuration)
    • Receiver Call: Function Module
    • Receiver Function Module: /ASADEV/ACI_EVENTS_TRIGGER
    • Linkage Activated: tick the checkbox

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Test the outbound event creation

In the example above, please pick any test sales order in transaction /nVA02 and force a change event, e.g. by changing the requested delivery date on header level.

How to change the payload

There are three different possibilities:

  • Rename table: renaming for the tables involved
  • Rename field: better and more JSON friendly names for the fields
  • Append a new field: e.g. a custom computed field or some additional fixed values

Each option is described below.

To rename a table:

  • Go to Field Mapping, add New Entry and specify:
    • Target structure: TABLE_RENAME
    • Target field: the new name as it should appear in the JSON (e.g. MaterialMaster)
    • Source structure: the original name of the table (e.g. MARA)

To rename a field you:

  • Go to Field Mapping, add New Entry and specify:
    • Target structure: FIELD_RENAME
    • Target field: the new name as it should appear in the JSON (e.g. ChangeDate)
    • Source field: the original name of the field (e.g. ERSDA)

To append a new field you:

  • Go to Field Mapping, add New Entry and specify:
    • Target structure: APPEND_<tablename> (e.g. APPEND_MAKT); the table name is used to determine the level where the new field is added to the JSON
    • Target field: the name of the field as it should appear in the JSON (e.g. CustomField)
    • Default value: if the field should be set to a fixed value
    • Conversion class/method name: name of a class and method used to determine the value of the field; the class must implement interface /ASADEV/ACI_CONVER_IF

Set-up Packed Load (split large data)

Create Outbound Object configuration

  • Transaction: SPRO
  • Goto ASAPIO Cloud Integrator – Connection and Replication Object Customizing
  • Or go directly to transaction: /ASADEV/68000202
  • Select the created Connection
  • Go to section Outbound Objects
  • Add New Entry and specify:
    • Object: name of the outbound configuration
    • Extraction Func. Module: /ASADEV/ACI_GEN_VIEW_EXT_PACK
    • Message Type: the created message type(optional)
    • Load Type: Packed Load
    • Trace: activate for testing purposes
    • Formatting Function: /ASADEV/ACI_GEN_VIEW_FORMATTER (depending on your use case)

Create database view

Note
Please also refer to section Message Builder

For the data events also configure the DB view that is used to define the extraction:

  • Transaction: SE11 (for SAP ERP or S/4HANA on-prem deployments with SAP GUI access)
  • Alternatively, you can use Eclipse with ABAP Development Tools, or the SAP Fiori App “Create Custom CDS Views” to create a database view if you have this app available in SAP S/4HANA.

Example: Material master view

Example

Set-up ‘Header Attributes’

  • Go to section Header Attributes of the outbound object created previously
  • Add New Entry and specify the header attributes and values
Header attribute Header attribute value Example
ACI_PACK_BDCP_COMMIT Flag for changepointer creation.

If set, changepointers will be generated for every entry.

IF this flag is set, a messagetype has to be maintained in the outbound object.

Caution:

This may heavily impact performance.

X
ACI_PACK_TABLE Name of the table to take the keyfields from. This is typically different then the db view specified in ‘ACI_VIEW‘ as we only want to build packages based on the header object and the db view typically contains sub-objects as well  MARA
ACI_PACK_RETRY_TIME Time in seconds. This is the duration in which the framework will attempt to get a new resource from the servergroup 300
ACI_PACK_WHERE_COND Condition that is applied to the table defined in ‘ACI_PACK_TABLE
ACI_PACK_SIZE Number of entries to send 500
ACI_PACK_KEY_LENGTH Length of the key to use from the ACI_PACK_TABLE (e.g. MANDT + MATNR) 13
ACI_VIEW name of a SAP database view that is key compatible with the ACI_PACK_TABLE Z_MARM_TEST

Ein Bild, das Tisch enthält. Automatisch generierte Beschreibung

Test the initial load

Warning

depending on the amount of data this can stress the SAP system servers immensely.
Please always consult with your basis team for the correct server group to use.

  • Transaction: /ASADEV/ACI
  • Select the Connection and hit enter
  • Select Upload Type: P
  • Select Replication Object 
  • Select a Servergroup (this is mandatory)

Ein Bild, das Text enthält. Automatisch generierte Beschreibung

Custom events, extractors, formatters and triggers

The following chapter explains how you can build and use your own extractors, formatters and how you can trigger events/data transfer from your own program. This might be required in the rare occasions where there are no SAP standard triggers available.

 Ths section is being edited currently, please check back next week for more content!

How to create a custom event for an SAP Business Object?

For certain business objects, there are no standard events delivered by SAP.

An example is BUS3006, the master data object for GL accounts.

For such objects, you can create a custom event on your own in the system:

  • Please proceed as following screenshots indicate.
  • After creating the custom business objects and events, you are able to select it in ASAPIO customizing

Start transaction SWU_EWCD

Please choose package name and object namespace as required

Scroll to Top