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
396

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 one feature is not included: Displaying the JSON Data sent out to AEM. With this blog, I want to show you how to extend your System to persist and display JSON Payloads from your AIFAEM Events.

 

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) DB Table zaifaem_json

This Table provides Persistence for the JSON Payloads.

2) Function Module ZAIF_ACTION_CALL_AEM_CUSTOM

This Function Module is an extended Version of the Standard AIFAEM Action which will persist the Payload in zaifaem_json

3) ABAP Report ZAIF_AEM_DISPLAY_JSON

This ABAP Report selects the JSON Data from the DB Table and displays it as PopUp

4) Message Class ZAIF_AEM_MESSAGES

In this Message Class there is the Message which will provide the GUID to the UI for the Display Function. 

 

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_1-1746888631874.png

 

With this Action, your Interface will now persist the Data into the DB Table ZAIFAEM_JSON. Let´s test it.

Change of a Business Partner:

AlexPfeil_2-1746888718357.png

--> /N/AIF/ERR

AlexPfeil_3-1746888821253.png

In SE16N we can see the JSON:

AlexPfeil_4-1746888978666.png

In order to see it in AIF Error Monitoring we need a Custom Function.

Custom Function for Display

In AIF Error Monitoring you can simply add Custom Functions here

AlexPfeil_5-1746889046586.png

Just add the Report, the GUID Parameter and the Text + Icon. Also Skip Screen because the selection is done by the Message Paramter

AlexPfeil_7-1746889117934.png

Now when clicking the button we can see the JSON:

AlexPfeil_8-1746889154502.png

Last Step: In order to make this Custom Function availiable for every User and Interface + add it to a transport, we need to open Transaction /N/AIF/CUST_FUNC

Here we can see how the set up looks like when done in Customizing:

AlexPfeil_0-1746889641105.png

 

I recommend to change these 2 parameters:

AlexPfeil_10-1746889267631.png

Then the system should prompt you for a transport. If not, you can add it manually with Table View -> Transport. To make sure the System also takes the Parameter for P_GUID, please make a dummy change in "Define Parameter IDs and Values" and save.

AlexPfeil_11-1746889365065.png

Thats it! Happy Eventing 🙂