Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
farihakazi
Active Contributor
963

Handling Deletion Scenarios at Item Level in SAP ASAPIO Outbound Integration to Solace AEM

In complex SAP integration scenarios, managing item-level deletions effectively is essential for maintaining data accuracy across connected systems. This blog explores how ASAPIO’s Outbound Integration framework can be configured to detect, process, and publish deletion events at the item level toward Solace AEM (Advanced Event Mesh). We’ll use the Change Document–based event model (CDHDR/CDPOS) and review how to ensure deleted line items are correctly represented in outbound payloads.

Understanding ASAPIO Outbound Messaging

ASAPIO’s Outbound Messaging framework integrates tightly with SAP’s Business Object and Change Document architecture. When a data change occurs, ASAPIO listens to the event (e.g., through SWEC or SWE2 linkage), captures it as a change pointer, and transforms it into an outbound message—usually in JSON format—to external systems such as Solace AEM.

The Challenge: Deletion at Item Level

Deletion events at the item level can be tricky because SAP’s Change Document entries often represent deleted items with blank item numbers. Without proper filtering and mapping, this can result in incomplete or missing data in the outbound message. To address this, we configure the SWEC event linkage and apply field restrictions to correctly trigger deletion events.

Configuration Steps

  1. **SWEC – Events for Change Documents**
       - Define the Change Document Object relevant to the business object (e.g., Sales Order, Purchase Order).In this case, we are using custom BO for opportunity and for item level we have created two events Edit and Deleted . We are interested in the deletion scenario here.

farihakazi_0-1762586024192.png

 


   - Apply a field restriction on the *Item Number* field, which will be blank upon deletion. We have also added Item type to limit the number of events raised only for a particular type.

Change Document History in Tcode CRMD_ORDER 

farihakazi_13-1762586537388.png

 

farihakazi_1-1762586024194.png

 



  1. **Event Linkage (SWE2)**
       - Create an event linkage between the Business Object and the outbound configuration.
       - Receiver Function Module: `/ASADEV/ACI_EVENTS_TRIGGER`
       - Activate the linkage to ensure deletion events are captured.

farihakazi_2-1762586024196.png

 



  1. **Outbound Object Configuration**
       - Transaction: `/ASADEV/68000202`
       - Define Extraction FM: `/ASADEV/ACI_GEN_PDVIEW_EXTRACT`
       - Message Type: Custom message type created in WE81/BD50.

farihakazi_3-1762586024208.png

 

 

The ASAPIO payload designer adds value by allowing configuration-based access to design query. Below is an example payload designed for this opportunity object, the item level tables have outer joins to enable payload preview as inner join would yield no data after deleting the item level table.

farihakazi_4-1762586024212.png

 



  1. **Header Attributes**
       - Configure endpoint-specific attributes:
         - `SOLACE_TOPIC`: Name of the Solace AEM topic.
         - `ACI_CP_INFO`: X (to include change pointer metadata)                                                                                     
                                         - `CLOUD_EVENTS` attributes to indicate type of object changed

farihakazi_5-1762586024215.png

 



  1. **Field Mapping and Formatter Sequence**
       - If you are using dynamic topics , you can design a uniform topic convention and apply to the Replication Object.
    farihakazi_6-1762586024220.png

     


       - Use formatter sequence to add multiple formatters. We are conforming to the cloud events schema for interoperability using FM /ASADEV/ACI_CLOUDEVENT_FM 
    farihakazi_7-1762586024223.png

     

 

Before and After:

 

When we trigger the deletion of the product which is at item level the change indicator shows up as ‘D’

farihakazi_8-1762586024225.png

 

The payload is restricted to show only the GUID and other details are absent despite data being present in the header level table. (CRMD_ORDERADM_H)

farihakazi_9-1762586024230.png

 

 

In order to enable details of the opportunity we update table /ASADEV/ACI_CP_I using SM30

farihakazi_10-1762586024231.png

 

 

After this setting, the change indicator turns into U

farihakazi_11-1762586024234.png

 

And the payload now shows up correctly.

farihakazi_12-1762586024240.png

 


Event-driven architecture 

 

2 Comments