Technology Blog Posts by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
AlexPfeil
Product and Topic Expert
Product and Topic Expert
524

Introduction

The AIFAEM AddOn provides a Framework to publish Events from ECC and S/4HANA Systems to AEM easily. I have explained it in one of my blogs. Unfortunately AIFAEM cannot send Custom HTTP headers to AEM without Custom Code. There are a couple of Solace-Specific Headers which can be used to add parameters or custom properties to the message, described here: https://docs.solace.com/API/RESTMessagingPrtl/Solace-REST-Message-Encoding.htm#solace-specific-http-... 

With this blog, I want to show you how to add Custom HTTP Headers with a Custom AIFAEM Action.

 

Custom Development Objects

For the Implementation of this you will need some Custom ABAP Objects. I have stored my Custom Objects here: https://github.com/alPfeil/AIFAEM/tree/main 

You will need

1) Structure Definition zaif_aem_http_header 

2) Table Type ZAIF_AEM_HTTP_HEADERS

AlexPfeil_0-1746890448460.png

2) Function Module ZAIF_ACTION_CALL_AEM_CUSTOM

 

Customization

Assuming you already have set up an AIFAEM Interface, you will only need to do the following:

Custom Action Definition

In /N/AIF/CUST -> Interface Development -> Define Action you´ll need to create a new Action

AlexPfeil_0-1746888611708.png

 

Custom Action Assignment

In /N/AIF/CUST -> Interface Development -> Define Structure Mapping you´ll need to assign the Custom Action instead of the Standard Action

AlexPfeil_4-1746890915747.png

 

 

Now, if provided, the Custom Action will attach custom HTTP Headers to the Request to AEM. Next Step is to extend the existing Interface.

Mapping of the HTTP Headers

Before the Mapping, the SAP Structure (Target Structure) needs to be enhanced (/N/AIF/CUST -> Define Interfaces)

AlexPfeil_6-1746891043012.png

 

How you fill up the Headers is up to you. I have added 2 more Structure Mappings:

 

AlexPfeil_11-1746891429585.png

 

 

Structure Mapping 40: Header Name is fixed. In order to add it as AEM Property we need the Prefix "Solace-User-Property-"

AlexPfeil_7-1746891259380.png

Header Value is dynamic (from the Target Structure, can be chosen by F4 Helpt -> Switch Structure):

AlexPfeil_8-1746891288158.png

Structure Mapping 50 is the same, except:

HeaderName = Solace-User-Property-BusinessPartnerNumber

HeaderValiue = @DATA-BUSINESSPARTNERTYPE-BUSINESSPARTNER

 

Test

Let´s change a BusinessPartner in Transaction BP now:

AlexPfeil_13-1746892445134.png

 

In BTP integration Suite i have set up an Iflow to consume this the topic "sap/businessPartner/>". Here we can see the Headers:

AlexPfeil_12-1746892428758.png