Automation of the electronic records generation process
As of the date of publication of this guide, SAP has not released the local event R_JournalEntryTP-Created that would allow you to automate the creation of the TicketBAI record without the need to configure the EventMesh service, we have already asked SAP to release the event and they plan to release it in 2025. +info
This section describes the steps to be followed to configure the EventMesh solution for managing the invoice creation event, in order to enable the TicketBAI record declaration automatically and asynchronously.
This task is composed of several parts, involving SAP BTP. If you have no experience or it is the first time you use this tool, please consult with your BTP instance managers, as the procedure can be complex and sometimes you will need to make decisions that depend on previous configurations, and an error in any of the steps may result in having to start the configuration again from the beginning.
The use of the SAP EventMesh tool has associated costs that will be passed on to the customer directly by SAP.
The tasks will be divided into 5 steps:
Enable communication from SAP S/4Hana Public Cloud to SAP BTP (Provider).
In the example shown in the video, the event sap/s4/beh/businesspartner/v1/BusinessPartner/Created/v1
is configured, but in our case it will be the event sap/s4/beh/journalentry/v1/JournalEntry/Created/v1
.
Notes: When creating the SAP S/4Hana Cloud Extensibility, it will ask for a value for the “Instance name” field, we recommend using the S/4Hana Cloud system id. When creating the Event Mesh consumer instance, it will ask for a value for the field “Receiver system”. (minuto 4:00), we recommend using the S/4Hana system id by concatenating a C (for consumer) at the end.
In this step we managed to configure the connection from S/4Hana Cloud to BTP, this configuration has generated an instance of Event Mesh that works as a provider, additionally we have created another instance of Event Mesh manually that will serve as a consumer of events that are published from our S/4Hana Cloud.
Enable communication from BTP to S/4Hana Cloud (Consumer).
In this step we are going to configure in our system what is necessary to consume the events of the EventMesh instance.
This task will be carried out in the “Communication Arrangement” Tile, we will create a new “Communication Arrangement based on the Communication Scenario SAP_COM_0092, it has the particularity that when it is created it asks for a Service Key, which is nothing more than a JSON where all the details of the connection with an Event Mesh instance are included.
The user can be a new one or a previously existing one, normally we will create one that will be used in this configuration.
The Service Key must be generated from BTP, from the Event Mesh instance we created in the previous step. We go to the list of instances and locate our Event Mesh instance, and select “Create Service Key”.
We will indicate a name for the Service Key, it is indifferent, for example our system ID, and we will press Create.
Once generated, copy the JSON generated and paste it in the Communication Arrangement configuration and click on create.
With this we now have the option of consuming events from this Event Mesh instance from our system.
Creation of the handler communication arrangement.
In the Communication Arrangement app, we must create a new arrangement based on the /TBAI/CS_EVENT_MESH scenario.
Create a new Communication System, called, for example, EVENT_MESH_CONSUMER. We will check the General>Inbound Only flag, activate the Event Mesh section and add the Channel we created in step 2 (Communication Arrangement of the Event Mesh consumer instance).
We also add the user we used in step 2 to the Users for Inbound Communication list and save.
Return to the Communication Arrangement and save.
Configure the event channel.
This task will be carried out in the “Enterprise Event Enablement - Configure Channel Binding” Tile and will need to be performed manually on each system.
We enter the channel that has the same ID as the Communication System we created in the previous step, and check that it has the following:
We only need to create a Subscription from the Queue we created in step 1, and we should have saved the ID, as discussed in that step.
If after adding the queue, in the Status column we can read Acknowledged, then we have performed all the configuration steps correctly.
Implement the SAP_COM_0002 agreement for the communications user.
To provide the communications user with the necessary permissions to consume the standard FI views used in the solution we must create a communications agreement based on the Finance scenario, for the same user and system we used in step 3. This may be unintuitive, but this way the EventMesh integration user will have the necessary permissions to query views such as I_JournalEntry and other views needed by the product.
In the “Communication Arrangement” application we must implement the SAP_COM_0002 scenario and in the configuration we will use the same system we used in step 3 and the same user, disabling the outbound services, so the Outbound User field will no longer be mandatory and will let us record.
To validate that the configuration is correct, we can access the “Enterprise Event Enablement - Event Monitor” application, where it is possible to view the output and input channels. In this tool, we will be able to observe how the events are generated in the output channel, sent to BTP through the EventMesh service and, finally, arrive at the system's input channel, confirming that the flow is correctly executed.
During our tests, from the creation of the JournalEntry to the reception of the event, the process takes approximately 10 seconds.
Related content
Avvale 2024