0% found this document useful (0 votes)
157 views70 pages

BUPA EVENTS Collaborative Address Validation

This document describes a process for collaborative address validation between SAP S/4HANA Cloud and SAP Business Technology Platform. It involves setting up messaging between the systems so that when a customer address is changed in S/4HANA, an event is pushed to BTP. A back-end application on BTP then checks for these events and if a valid contact email is found, it will send an email to validate the new address. The document provides detailed steps for configuration on both systems, including setting up destinations, event topics, and deploying a sample application to test the end-to-end flow.

Uploaded by

Jerry Kelly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
157 views70 pages

BUPA EVENTS Collaborative Address Validation

This document describes a process for collaborative address validation between SAP S/4HANA Cloud and SAP Business Technology Platform. It involves setting up messaging between the systems so that when a customer address is changed in S/4HANA, an event is pushed to BTP. A back-end application on BTP then checks for these events and if a valid contact email is found, it will send an email to validate the new address. The document provides detailed steps for configuration on both systems, including setting up destinations, event topics, and deploying a sample application to test the end-to-end flow.

Uploaded by

Jerry Kelly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 70

Extensibility Guide | PUBLIC

Collaborative Address Validation Using SAP


Enterprise Eventing Services
© 2021 SAP SE or an SAP affiliate company. All rights reserved.

THE BEST RUN


Content

1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Prerequisites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Receive SAP Enterprise Messages on SAP Business Technology Platform. . . . . . . . . . . . . . . . . 7


3.1 Configure SAP Enterprise Messaging on SAP Business Technology Platform. . . . . . . . . . . . . . . . . . . 7
3.2 Configuration Steps within the SAP S/4HANA Cloud System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
Create Communication System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Create Communication Arrangement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16
Maintain Event Topics for a Channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3 Access Event Catalog with Event Hub UI on SAP Business Technology Platform. . . . . . . . . . . . . . . . 22
Create a new Destination on Subaccount Level. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Create and Explore Event Catalog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.4 Access Enterprise Messaging Dashboard and Create a Queue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4 Preparation in SAP S/4HANA Cloud. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33


4.1 Add Custom Fields to Business Partner Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2 Create Communication Arrangement for Business Partner Object. . . . . . . . . . . . . . . . . . . . . . . . . .35
4.3 Create Custom CDS View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Create a Custom Communication Scenario for Your CDS View. . . . . . . . . . . . . . . . . . . . . . . . . . 39
Create a Communication Arrangement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5 Configure and Deploy Consumer Application to SAP Business Technology Platform. . . . . . . . .41
5.1 Set Up Destinations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Set Up Mail Destination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Set Up RSA Key Pair Destination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Set Up Destination to Connect to SAP S/4HANA Cloud. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.2 Download the Consumer Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Create XSUAA Service on SAP Business Technology Platform. . . . . . . . . . . . . . . . . . . . . . . . . . 46
Create Destinations Service on SAP Business Technology Platform. . . . . . . . . . . . . . . . . . . . . . 47
5.3 Adapt the Application Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.4 Build the Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
5.5 Deploy the Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.6 Test Application End-to-End. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Prepare Sample Data in SAP S/4HANA Cloud. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50
Change Business Partner and Confirm Address. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

6 Appendix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

Collaborative Address Validation Using SAP Enterprise Eventing Services


2 PUBLIC Content
6.1 Run All Tests Locally. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.2 Run the Sample Application Locally. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.3 Issues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.4 Document History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67

Collaborative Address Validation Using SAP Enterprise Eventing Services


Content PUBLIC 3
1 Overview

 Note

This sample scenario is for learning purposes only. It is intended to give you an understanding of the
various technical aspects related to extending SAP S/4HANA Cloud. The sample scenario may not always
be available in a readily consumable state due to the continuous improvements being made in the
underlying products or services. If this is the case, appropriate adaptations based on the latest
documentation of the respective products or services are required.

Collaborative Address Validation Using SAP Enterprise Eventing Services


4 PUBLIC Overview
In this guide we use a collaborative use case that enables customers to validate their company address
changes. The following table provides you with a short overview of the steps in this scenario:

Step Details

1 Address Maintenance of Business Maintain an address for the business partner with the customer role
Partner and maintain a contact person relationship for this customer (the Has
Contact Person relationship category is used).

Since it's quite likely that for one customer multiple contact persons
are maintained, the following logic is implemented to make sure that
the e-mail is sent to only one contact person. The Department and
Function fields in the relationship are used. The logic is derived top
down:

● Contact with Department = Quality Assurance (0007) and


Function = Quality Officer (0005) receive the e-mail. If there are
multiple hits, the first one is used. If there isn't any hit, continue
with the next step.
● Contact with Department = Quality Assurance (0007) receive the
e-mail. If there are multiple hits, the first one is used. If there isn't
any hit, continue with the next step.
● The first contact person with a valid e-mail address is selected
and receives the e-mail.

2 SAP Enterprise Messaging Push Once a customer address is changed in the SAP S/4HANA Cloud sys­
tem, a business event is pushed to the connected SAP Business Tech­
nology Platform (Cloud Foundry) account.

3 Back-End Application The back-end application checks incoming events. If a customer ad­
dress is changed and a contact person with a valid e-mail address has
been entered for this customer, the back-end application triggers the
process of sending of an e-mail to the contact person. If the contact
person entry has not been properly maintained, the event is dropped.

4 Contact Person Receives E-Mail The respective contact person receives the e-mail. It includes the
maintained customer address, a request to validate the address, and
a link to the front-end application (sample address validation UI is
embedded in the e-mail).

5 Front-End Application (SAPUI5 Once the contact person has entered the sample application by using
Sample Application) the link from the previous step, the contact person can either adapt
the customer address if it contains any errors or simply confirm the
address.

6 Update the Business Partner The approved changes from the previous step are updated in the con­
Data. nected SAP S/4HANA Cloud system.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Overview PUBLIC 5
2 Prerequisites

To perform the steps in this document, you need to make sure that the following prerequisites have been met:

Prerequisites Details

SAP S/4HANA You have admin access to an SAP S/4HANA Cloud system.
Cloud system
Make sure that the following business catalogs are assigned to the roles that your user has.

SAP_CORE_BC_EXT

SAP_CORE_BC_COM

SAP_CA_BC_IC_LND

SAP Business Tech­ You have an SAP Business Technology Platform account.
nology Platform
The SAP Enterprise Messaging service is available on your SAP Business Technology Platform (Cloud
Foundry, currently only in AWS data centers in Frankfurt).

For more information on account types and on purchasing an enterprise account, refer to SAP Busi­
ness Technology Platform Accounts.

 Note
For non-productive/testing purposes, you can use an SAP Business Technology Platform trial ac­
count. Find more information here on how to get a trial account .

Collaborative Address Validation Using SAP Enterprise Eventing Services


6 PUBLIC Prerequisites
3 Receive SAP Enterprise Messages on SAP
Business Technology Platform

3.1 Configure SAP Enterprise Messaging on SAP Business


Technology Platform

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 7
SAP Enterprise Messaging offers mechanisms for an event-driven architecture. It enables you to:

● propagate/distribute events across distributed landscapes across cloud and on premise


● out-of-the-box event-enablement frameworks for SAP S/4HANA, SAP Business Technology Platform
● open standards and protocol-based communication
● scalable and high-volume communication infrastructure
● support for third-party events

Prerequisites

You have an SAP Business Technology Platform account with a (trial) version of SAP Enterprise Messaging.
Maintain the subaccount entitlements as follows:

● application runtime: 2 GB memory assigned


● destination: 1 instance of plan lite assigned
● xsuaa: 1 instance of plan application assigned
● SAP Enterprise Messaging: 1 instance of plan dev assigned

Collaborative Address Validation Using SAP Enterprise Eventing Services


8 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
Procedure

1. Navigate to the Cloud Foundry space where Enterprise Messaging is enabled. [1]
2. Go to Service Marketplace. [2]
3. Choose Enterprise Messaging. [3]

4. Go to Instances. [1]
5. Choose New Instances. [2]

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 9
6. Choose a service plan (for example, dev) and choose Next. Enter {"emname":"messaging"} as
parameter.

 Note

emname must be unique within the organization.

7. Choose Next.
8. Choose Next again (there isn't any application to which you could assign this service).
9. In the last step, enter messaging as the name for the new instance.

 Note

It is recommended that you use the same name as emname that you specified in Step 6.

Please make sure that you stick to this exact name since it'll be reused in the sample application.

10. Select the newly created service instance.

11. Go to Service Keys. [1]

Collaborative Address Validation Using SAP Enterprise Eventing Services


10 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
12. Choose Create Service Key. [2]

13. Enter a name, for example, Eventing. Under Configuration Parameters, enter {"type":"external"}.
14. Choose Save.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 11
 Note

The newly created service key contains information that you need in the subsequent configuration steps:

● clientid: This ID is used to log on to the SAP Enterprise Messaging endpoint from outside.
● clientsecret: This is the password to be used with the clientid.
● uri: You need this information to get the host name and the path required for the configuration of the
communication arrangement in the SAP S/4HANA Cloud system (token endpoint).

SAP Enterprise Messaging provides several end points supporting different protocols (for example,
AMQP1.0 over WebSocket and MQTT 3.1.1 over WebSocket).

3.2 Configuration Steps within the SAP S/4HANA Cloud


System

In this scenario, a side-by-side application receives business events from an SAP S/4HANA Cloud system. For
that purpose, you're using the SAP Enterprise Messaging mechanism of SAP S/4HANA and SAP Business
Technology Platform.

To enable the communication between SAP S/4HANA and SAP Business Technology Platform, you need to
create a communication system and a communication arrangement. In the communication system, the
information that is required to set up a connection to another system is defined (for example, authorization
mechanism and host name). The communication arrangement defines which system (communication system)
can use which communication scenario of SAP S/4HANA.

In this example, you’re creating a communication system, which represents your SAP Business Technology
Platform, and a communication arrangement, which allows your system to use the communication scenario
(SAP_COM_0092) for SAP Enterprise Messaging.

Once you've set up the communication, you define all events that are to be sent to SAP Business Technology
Platform.

3.2.1 Create Communication System

Prerequisites

Your user has a role to which the SAP_CORE_BC_EXT business catalog has been assigned.

Collaborative Address Validation Using SAP Enterprise Eventing Services


12 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
Procedure

1. Access the SAP Fiori launchpad of your SAP S/4HANA Cloud system.
2. Navigate to Communication Management.
3. Choose Communication Systems and choose New.
4. Enter a unique system ID and a system name. Choose Create.

5. Enter the host name. [1]

 Note

To find this information, go to Service Instance: Eventing under Service Keys (which was created in the
section Configure SAP Enterprise Messaging on SAP Business Technology Platform [page 7]

6. Enter the logical system and a business system (with 00).


7. Under OAuth 2.0 Settings and under Auth. Endpoint, make an entry and replace the last path segments
with /oauth/authorize. [2]
8. Under OAuth 2.0 Settings and under Token Endpoint, make an entry according to the Service Key
information ending with /oauth/token. [3]

 Note

The screenshots below shows further details on how to maintain and/or retrieve the values.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 13
9. In the User for Inbound Communication section, choose Add. The inbound communication user is needed
to access the SAP S/4HANA system from outside.

10. If you already have an inbound communication user, you can reuse it. Otherwise, to create a new user,
choose New User.

11. Enter a unique user name and a description. [1]


12. Either enter a password or choose Propose Password. [2]

 Caution

Make sure that you remember this password. For example, store the proposed password in a secure
place. Note that there is no other way to retrieve the password. You'll need the password later for
further configurations. [3]

13. To complete the user creation, choose Create.

Collaborative Address Validation Using SAP Enterprise Eventing Services


14 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
14. The newly created inbound communication user is automatically selected in the dialog box. Choose OK to
assign this user.
15. In the User for Outbound Communication section, choose Add. The outbound communication user is
required to set up a connection from the SAP S/4HANA system to the SAP Enterprise Messaging on SAP
Business Technology Platform. The required credentials have been generated when creating the service
key on SAP Business Technology Platform.

16. Under Authentication Method, select OAuth 2.0.. [1]


17. Under OAuth 2.0 Client ID, enter the information from Service Instance: Eventing - Service Keys. [2]
18. Under Client Secret, enter the information from Service Instance: Eventing - Service Keys. [3]
19. Choose Create.
20.Create an additional user using User ID and Password as authentication method.

 Note

This is required for the same application.

21. Choose Save.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 15
3.2.2 Create Communication Arrangement

Prerequisite

Your user has a role to which the SAP_CORE_BC_EXT extensibility catalog has been assigned.

Procedure

1. Access the SAP Fiori launchpad of your SAP S/4HANA system.


2. Choose Communications Arrangements to create a new communication arrangement.
3. Choose New.

Collaborative Address Validation Using SAP Enterprise Eventing Services


16 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
4. Under Scenario, select SAP_COM_0092 via the value help icon. [1]
5. Enter a unique arrangement name. [2]
6. Choose Create.

7. Assign the communication system that you created in the previous step.

 Note

Make sure that the OAuth user is automatically selected under Outbound Communication. If this is not
the case, select the OAuth user you created in the previous step).

(Note:
8. Enter a name for the channel. [1]
9. Enter a description for the channel. [2]
10. Under Topic Space, enter the system name to see where events are coming from. [3]
11. Set QoS (Quality of Service) to 1 (at least once). [4]
12. Under Reconnect Attempts, enter a number for the amount of reconnection attempts in case of connection
error. [5]
13. Under Reconnect Wait Time, enter a number to indicate the idle time between two reconnection attempts.
[6]

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 17
14. Enter the details for the Outbound Services: Under Path, enter /protocols/mqtt311ws.

 Note

The Path information can be seen under Service Instance: Eventing - Service Keys.

15. Save the communication arrangement.

Collaborative Address Validation Using SAP Enterprise Eventing Services


18 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
16. To test the configuration, go to the Inbound Services section of the communication arrangement where you
find the URL to call the event browser service.

17. Copy this URL to your browser and log on with the user you provided in the communication system.
18. Here's an example of what your browser might look like:

3.2.3 Maintain Event Topics for a Channel

This section describes how to enable events that should be sent to SAP Business Technology Platform. In this
example, you're enabling the events for a business partner change and creation.

Prerequisite

Your user has a role to which the SAP_CA_BC_IC_LND business catalog (End-to-End Implementation
Experience – Feature Management) has been assigned.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 19
Procedure

1. Access the SAP Fiori launchpad of your SAP S/4HANA Cloud system.
2. Go to Implementation Cockpit. [1]
3. Choose Manage Your Solution. [2]

4. Choose Configure Your Solution.

5. In the filter, enter Messaging. [1]


6. From the results list, select the Event Handling. [2]

Collaborative Address Validation Using SAP Enterprise Eventing Services


20 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
7. Go to the Maintain Event Topics entry and choose Configure.

8. Select your event channel via the value help icon.


9. To confirm your selection, choose the green checkmark.

10. Choose New Entries.


11. Go to the first empty line of the table and use the value help icon to open the list of available topics.
12. Select the topics that you want to add to your channel. Choose between specific topics only or select
subpaths. For this particular scenario, you need to add the topic filters BO/BusinessPartner/Changed BO/
BusinessPartner/Created.
13. Choose Save.
14. Choose Exit.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 21
3.3 Access Event Catalog with Event Hub UI on SAP
Business Technology Platform

Once you've set up the communication on SAP S/4HANA Cloud, you can now start to set up the
communication on SAP Business Technology Platform. Since the SAP Enterprise Messaging service of SAP
Business Technology Platform reads from SAP S/4HANA, you enable the communication by setting up a
destination that contains all information necessary to connect to the API of the SAP S/4HANA system such as
authentication credentials and the URL of the API endpoint.

In addition, you set up an event catalog in the SAP Enterprise Messaging service of SAP Business Technology
Platform to explore all available events coming from SAP S/4HANA.

3.3.1 Create a new Destination on Subaccount Level

Procedure

1. Enter the SAP Business Technology Platform cockpit and select Cloud Foundry.
2. Navigate to your subaccount.
3. Choose Connectivity.
4. Choose Destinations.
5. Choose New Destination.
6. Enter the following values:

Property Value

Name <any unique name>

Type HTTP

URL <URL of the inbound service defined in the SAP S/4HANA


communication arrangement>

Proxy type Internet

Authentication BasicAuthentication

User <SAP S/4HANA inbound user that was created/maintained when


configuring the communication system on SAP S/4HANA>

Password <password of the inbound user>

Collaborative Address Validation Using SAP Enterprise Eventing Services


22 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
7. Add additional properties:

Property Value

EnterpriseMessaging True (only destinations with this property will be available in the Event Hub UI)

8. Save the destination.

3.3.2 Create and Explore Event Catalog

Prerequisite

Your SAP Business Technology Platform user is a security administrator of the subaccount. Initially, the person
who created the subaccount is the security administrator. Any other users don't see the Security section in the
menu.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 23
Procedure

1. Go to your subaccount. [1]


2. Navigate to Security Role Collections . [2]
3. Choose New Role Collection. [3]

Collaborative Address Validation Using SAP Enterprise Eventing Services


24 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
4. Enter a name for the role collection (for eample, XBEMUser) and choose Save.

5. To assign the newly created role collection to your users, select your subaccount.
6. Navigate to Security Trust Configurations .
7. Choose SAP ID Service.

8. Enter the user e-mail address to access the eventing UIs.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 25
 Note

To register the notification channel created in the SAP S/4HANA Cloud system, use the SAP Enterprise
Messaging – Events Administration app on SAP Business Technology Platform. Maintain all e-mail
addresses of the users who should have access to this application.

9. Choose Show Assignments.


10. Choose Add Assignment.

11. Select the previously created role collection and choose Add Assignment (repeat this step if you want to
grant access to other users as well).

12. To subscribe to the SAP Enterprise Messaging service, go to Subaccount.


13. Navigate to Subscriptions Enterprise Messaging

 Note

If you don't have the option to subscribe to the service, get in contact with the administrator of your
global account. The enterprise messaging hub might not have been assigned to your account.

Collaborative Address Validation Using SAP Enterprise Eventing Services


26 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
14. Choose Subscribe.

15. Once you've subscribed to the service, choose Manage Roles.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 27
16. Go to the ManageRole role and choose Add.

17. In the dialog box, select the role collection that you created in step 2 (for example, XBEMUser) and
choose Save.

18. Go to the Overview tab again and choose Go to Application.

Collaborative Address Validation Using SAP Enterprise Eventing Services


28 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
19. The Event Hub UI is displayed without any errors.

20.Go to Manage Event Channel Groups.


21. Choose Create Event Channel Group.
22. Enter the following data:

Property Value

Event Catalog <enter any unique name>


Name

Description <enter a description>

Event System The event system is the destination that you created in the previous steps (Create a new Destina­
tion on Subaccount Level [page 22]). You can select it from the dropdown list.

Channel all available channels are listed in the dropdown list after you've select the event system. You've
configured the available channels in the section Maintain Event Topics for a Channel [page 19].

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 29
 Note

Once you've selected the event system, all available channels are displayed that have been defined
for the communication arrangement ID SAP_COM_0092. If the list is empty or an error occurs, the
configuration of the SAP S/4HANA system is incomplete or incorrect.

23. Choose Exploring the Event Catalog to show all events assigned to the catalog.
24. Select the correct SAP Enterprise Messaging service instance from the dropdown list. [1]
25. Under Event Channel Group, select the event channel group from the dropdown list. [2]
26. Expand the Event/Topic Name tree. [3]

Collaborative Address Validation Using SAP Enterprise Eventing Services


30 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
 Note

To check if your service instance has been configured correctly, select /BO/BusinessPartner/Changed and
choose Show. If everything has been configured correctly, you see a green checkmark right next to the
service instance name. Otherwise, you'll see a message that tells you what went wrong.

3.4 Access Enterprise Messaging Dashboard and Create a


Queue

In this section, you're creating the first queue and map the topics that you defined in your SAP S/4HANA
system to this queue.

Procedure

1. To launch the SAP Enterprise Messaging dashboard, go to your subaccount.


2. Choose Spaces.
3. Select your space.
4. Choose Service Instances.
5. Search for any of the instances for the SAP Enterprise Messaging service. Under Actions, choose the
dashboard icon.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Receive SAP Enterprise Messages on SAP Business Technology Platform PUBLIC 31
6. Enter your user credentials.
7. Choose Queues.
8. Choose Create.
9. Enter a queue name, for example BusinessPartnerQueue.

 Note

If you change the name in this step, make sure that you adapt the manifest.yml file of the application
later that you're deploying to your SAP Business Technology Platform.

10. Choose Create.


11. Go to Queue Subscriptions.
12. Choose Create.
13. From the dropdown list, select the queue name you created.
14. Enter a Topic Name or Pattern. This should match one of the topics you saw in the sections previously (for
example, CCF/BO/BusinessPartner/Changed or use CCF/BO/BusinessPartner/* for all business partner
events that are triggered by SAP S/4HANA). For this scenario, you need both the Changed and Created
events, so that you either create two separate subscriptions or just one with the asterisk character *. Your
configuration should look like this:

Collaborative Address Validation Using SAP Enterprise Eventing Services


32 PUBLIC Receive SAP Enterprise Messages on SAP Business Technology Platform
4 Preparation in SAP S/4HANA Cloud

Prerequisite

Make sure that the SAP_BCR_CORE_EXT (Extensibility) business catalog is assigned to your user role.

4.1 Add Custom Fields to Business Partner Object

For the address validation extension, you need to add two custom fields for the confirmation state and the
checksum of the address to the business partner:

● The confirmation state indicates if the current address has already been confirmed or if a confirmation e-
mail has been sent.
● The address checksum is used to detect if there has been an address change. Without the address
checksum, the application would react on every other change of the business partner as well.

Procedure

1. Access the SAP Fiori launchpad.


2. To launch the Custom Fields and Logic SAP Fiori app, choose the corresponding SAP Fiori tile in the
Extensibility catalog.
3. To create a new custom field, choose + on the Custom Fields and Logic tab.
4. Choose the context business partner core view.
5. Enter the label of the field: Address Checksum.

 Note

Since the name will be reused in the sample application, don't change it. Otherwise, the integration
won't work.

6. The Identifier and Tooltip in plural fields are automatically populated according to the value provided for
Label.
7. For Type, select Text from the dropdown list.
8. For Length, select 40.
9. Choose Create and Edit to create and edit the custom field.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Preparation in SAP S/4HANA Cloud PUBLIC 33
10. A new window is displayed. Go to the UI and Reports tab and select the OData model for which the field has
to be extended and choose Enable Usage . In this case, API_BUSINESS_PARTNER 0001 needs to be
Enabled.
11. Choose Save and Publish.
12. Once the extended field has been successfully published, it'll be part of the metadata of the OData service
and the corresponding database.
13. To create another field, repeat these steps (Address Confirmation State).

 Note

Maintain all values exactly as shown in the screenshot below. Otherwise, the integration might not work.
When creating the address confirmation state, under Type, select Code List instead of Text (for the address
checksum). Make sure that the Identifier is maintained as shown in the screenshot. Here's an example of
what your configuration should look like:

 Note

Don't change the names. Stick to the names of fields and identifiers because they will be reused in the
side-by-side application.

Collaborative Address Validation Using SAP Enterprise Eventing Services


34 PUBLIC Preparation in SAP S/4HANA Cloud
4.2 Create Communication Arrangement for Business
Partner Object

In this scenario, a side-by-side application reads and updates business partner data in the SAP S/4HANA
system. For that purpose, you're using standard, resource-based APIs of SAP S/4HANA.

To find an overview of all available APIs, refer to the SAP API Business Hub . Navigate to APIs SAP S/
4HANA Cloud .

The SAP API Business Hub contains technical documentation and references to business documentation. You
can find the technical name of the communication scenario (for example, SAP_COM_0008) and the
corresponding scope item in the SAP API Business Hub.

To allow inbound communication to the SAP S/4HANA tenant, create a communication arrangement first. The
communication arrangement defines which system (communication system) and which user can call which
APIs (communication scenarios).

In this example, you're creating a communication arrangement. You're allowing access to the Business Partner
API (SAP_COM_0008) using a technical user.

Procedure

1. Access the SAP Fiori launchpad.


2. Go to the Communication Arrangements app.
3. To create a new communication arrangement, choose New.
4. To create a communication arrangement for the standard business partner API, select SAP_COM_0008.
5. Adapt the Arrangement Name if required.
6. Choose Create.
7. In the Common Data section, select the Communication System that was created in section Configuration
Steps within the SAP S/4HANA Cloud System [page 12] via the input help.
8. The technical user that was created in the previous step is automatically added to the Inbound
Communication section.
9. If this communication scenario has outbound services, deactivate all outbound services.
10. Although an outbound user is not relevant in this scenario, you must create an outbound user for the
SAP_COM_0008 communication arrangement. Otherwise, you'll receive an error message.
11. Save your changes.
12. Check that the communication arrangements have been activated (the status Active must be visible).

4.3 Create Custom CDS View

SAP S/4HANA uses the two-letters ISO codes for countries. When the country field of an address needs to be
changed, the new address must be part of the two-letters ISO codes list. To make sure that humans can read

Collaborative Address Validation Using SAP Enterprise Eventing Services


Preparation in SAP S/4HANA Cloud PUBLIC 35
the country field on the UI, the country codes that are supported in SAP S/4HANA will be used. To get the list,
you're creating a custom CDS View.

Procedure

1. Access the SAP Fiori launchpad.


2. To launch the Custom CDS Views SAP Fiori app, choose the corresponding SAP Fiori tile in the Extensibility
catalog.
3. Choose Create.
4. In the Name field, enter YY1_COUNTRIES. Enter a label.

 Note

Make sure that you stick to the naming since it will be reused in the sample application. If the naming
doesn't match, integration won't work.

5. Select the External API checkbox.


6. Choose Add Add Primary Data Source .
7. Select the I_CountryText data source and choose Add.
8. Choose Add Add Associated Data Source .
9. Select the I_Language data source and choose Add.

 Note

At the end of this step, your CDS View should look like the one on the screenshot below:

Collaborative Address Validation Using SAP Enterprise Eventing Services


36 PUBLIC Preparation in SAP S/4HANA Cloud
10. Choose Edit Association Properties in the Actions column.
11. In the Associated Data Source Fields, select Language. Leave the Operator the same (=) and under Value,
select Language.

 Note

At the end of this step, your association poperties should look like those on the screenshot below:

12. Choose OK.


13. Choose Save Draft.
14. Go to the Field Selection tab.
15. Select the CountryName field.

 Note

At the end of this step, your field selection should look like the one on the screenshot below:

Collaborative Address Validation Using SAP Enterprise Eventing Services


Preparation in SAP S/4HANA Cloud PUBLIC 37
16. Go to the Filters tab.
17. Choose Edit.
18. Choose Fields.
19. Select the LanguageISOCode field from the dropdown list.

 Note

The field name may vary with the variable name given to the language field in the previous steps. This
field name is _I_Language.LanguageISOCode if you haven't changed the default settings.

20.Complete the formula with ='EN'.

 Note

Here's an example of the complete formula: _I_Language.LanguageISOCode='EN'.

21. Choose Apply.


22. Choose Save Draft and choose Preview.

 Note

In the table, you see the following fields: Country Key (two-letters ISO code) and Long Name of the
countries in English. While these two fields are mandatory, you may also see other key fields (for
example, Language Key) - this doesn't indicate any problem.

23. Choose Publish. Afterwards, the OData API will be created automatically.

Collaborative Address Validation Using SAP Enterprise Eventing Services


38 PUBLIC Preparation in SAP S/4HANA Cloud
4.3.1 Create a Custom Communication Scenario for Your
CDS View

Procedure

1. Access the SAP Fiori launchpad.


2. To launch the Custom Communication Scenarios SAP Fiori app, choose the corresponding SAP Fiori tile in
the Extensibility catalog.
3. Choose New and enter a name and description, then choose New.
4. Go to the Inbound Services tab and choose Add.
5. In the dialog box, select the service that was created in the previous step while creating the custom CDS
view.

 Note

The service name is the name of the custom CDS view followed by _CDS.

6. Choose OK.
7. Choose Publish.

4.3.2 Create a Communication Arrangement

Procedure

1. Access the SAP Fiori launchpad.


2. To launch the Communication Arrangement SAP Fiori app, choose the corresponding SAP Fiori tile in the
Communication Management catalog.
3. Choose New.
4. Choose Scenario.
5. In the dialog box, select the custom communication scenario that was created in the previous step.
6. Enter an arrangement name.
7. Choose Create.
8. Choose the Communication System value help icon and select the system that you created in the section
Create Communication System [page 12].

 Note

The User Name field for Inbound Communication is automatically populated.

9. Choose Save.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Preparation in SAP S/4HANA Cloud PUBLIC 39
 Note

In the Inbound Services section, you can see the Service URL / Service Interface.

Collaborative Address Validation Using SAP Enterprise Eventing Services


40 PUBLIC Preparation in SAP S/4HANA Cloud
5 Configure and Deploy Consumer
Application to SAP Business Technology
Platform

Prerequisite

● You've installed a JDK 8, which is available on the Oracle Download page . Consider the JAVA_HOME
environment variable.
● You've downloaded and installed Maven 3.0, which is available on the Apache Maven Project Download
page .
● You've downloaded and installed the Git Command Line Interface, which is available on the Git Download
page .
● You've downloaded and installed the Cloud Foundry Command Line Interface, which is available on
cloudoundry.org .
● Optional: You may want to use an integrated development environment such as Eclipse. Refer to the step-
by-step procedure on how to configure an Eclipse IDE for Java development on SAP Business
Technology Platform.

 Note

Make sure that all binaries are maintained in your environment PATH variable. If you're behind a web proxy,
make sure that you configure the proxy settings accordingly (for example, settings.xml for Maven,
environment variable HTTPS_PROXY for Git, network settings in Eclipse).

5.1 Set Up Destinations

The destination feature of SAP Business Technology Platform enables you to externalize configurations from
your applications. For the sample application, you need three destinations:

● One destination to configure the mailing service you want to use to send e-mails
● One destination that holds a key pair for the RSA encryption and decryption
● One destination to establish a connection to the SAP S/4HANA system that will be connected to the
application

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 41
5.1.1 Set Up Mail Destination

Purpose

This section describes how to set up the e-mail destination that securely stores SMTP server data and user
credentials, which are used to send notification e-mails from a Java application using JavaMail API.

Procedure

1. Go to the SAP Business Technology Platform cockpit and select your region in Cloud Foundry environment.
2. Navigate to your subaccount.
3. Choose Connectivity.
4. Choose Destinations.
5. Choose New Destination.
6. Enter the following values:

Property Value

Name Enter any unique name.

The default value is MailSession. You can configure it via the DESTINATION_NAME constant
in the com.sap.cloud.s4hana.eventing.sendmail.SessionConfig class of Java
application.

Type Enter

MAIL.

User Enter the user name of the user account that is used to authenticate to the SMTP server. For de­
tails, please refer to the documentation of your e-mail service provider. Usually, the user name the
same as the e-mail address.

Password Enter the password of the user account that is used to authenticate to the SMTP server.

Collaborative Address Validation Using SAP Enterprise Eventing Services


42 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
7. Add additional Properties:

Property Value

mail.from E-mail address to be specified in the From header of e-mails to be sent via the destina­
tion. Usually, SMTP servers require that the e-mail specified here is the same as the e-
mail user account. You can also specify your name or name of your service here, for ex­
ample:

Any Text <your_address@your_provider_address.com>

mail.transport.protocol Mail transport protocol to be used to send e-mails. In this example, you use smtps.

If you want to use another protocol, please refer to the JavaMail API documentation for
the required properties.

mail.smtps.auth BooleanProperty that specifies whether the outbound SMTP server requires authentica­
tion. Most of e-mail service providers require the value to be set to true.

For details, please refer to the documentation of your e-mail service provider. The prop­
erty can only be used if the e-mail transport protocol is smtps. If you want to use an­
other protocol, please refer to the JavaMail API documentation for the required proper­
ties.

mail.smtps.host Host of the outbound SMTP server.

For details, please refer to the documentation of your e-mail service provider. The prop­
erty can only be used if the e-mail transport protocol is smtps. If you want to use an­
other protocol, please refer to the JavaMail API documentation for the required proper­
ties.

mail.smtps.port Port of the e-mail outbound server.

For details, please refer to the documentation of your e-mail service provider. The prop­
erty can only be used if the e-mail transport protocol is smtps. If you want to use an­
other protocol, please refer to the JavaMail API documentation for the required proper­
ties.

8. Save the destination.

5.1.2 Set Up RSA Key Pair Destination

Purpose

The key length should be at least 2048 bits. To generate the key pair, you can use any RSA key generator
(including online generators).

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 43
These steps describe how to securely store the RSA encryption keys using the destination service of SAP
Business Technology Platform. The keys can be accessed by the Java application using the
DestinationAccessor class of the SAP S/4HANA Cloud SDK.

Procedure

1. Go to the SAP Business Technology Platform cockpit and select your region in Cloud Foundry environment.
2. Navigate to your subaccount.
3. Choose Connectivity.
4. Choose Destinations.
5. Choose New Destination.
6. Enter the following values:

Property Value

Name Enter any unique name.

The default value is RSAKeyPairStorage. You can configure it via the DESTINATION_NAME
constant in com.sap.cloud.s4hana.eventing.security.CloudRSACipher class
of the Java application.

Type Enter MAIL.

User Enter your public RSA key. It starts with -----BEGIN PUBLIC KEY----- and ends with
-----END PUBLIC KEY-----.

Password Enter your private RSA key. It starts with -----BEGIN RSA PRIVATE KEY----- and ends
with -----END RSA PRIVATE KEY-----.

7. Save the destination.

5.1.3 Set Up Destination to Connect to SAP S/4HANA Cloud

Purpose

This section describes how to set up a destination that holds the information that is required to connect to the
API of an SAP S/4HANA system.

Collaborative Address Validation Using SAP Enterprise Eventing Services


44 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
Procedure

1. Go to the SAP Business Technology Platform cockpit and select Cloud Foundry.
2. Navigate to your subaccount.
3. Select Connectivity.
4. Select Destinations.
5. Choose New Destination.
6. Enter the following values:

Property Value

Name ErpQueryEndpoint

Type HTTP

URL <URL of your SAP S/4HANA APIs, for example https://my123456-


api.s4hana.ondemand.com>

Proxy type Internet

Authentication BasicAuthentication

User <SAP S/4HANA inbound user that was created/maintained when


configuring the communication system on SAP S/4HANA>

Password <password of the inbound user>

7. Add additional properties:

Property Value

TrustAll true

 Note
Do not use this for productive usage.

For productive usage, upload the SAP S/4HANA certificate to the Trusted Certifi­
cates list on SAP Business Technology Platform.

8. Save the destination.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 45
5.2 Download the Consumer Application

Purpose

In this step, you're downloading an application.

Procedure

1. Access the sample app repository on GitHub .


2. Download and extract the ZIP file that you get from the GitHub repository.
Alternatively, you can clone the repository via the command line.

git clone https://github.com/SAP/s4hana-ext-address-valid-app.git


cd s4hana-ext-address-valid-app

 Note

Sample extension scenarios are designed to help you get an overall understanding of various extensibility
concepts/patterns. SAP recommends that you don't use these samples for productive usage.

5.2.1 Create XSUAA Service on SAP Business Technology


Platform

Procedure

1. Navigate to your Cloud Foundry space.


2. Go to Service Marketplace.
3. Select Authorization & Trust Management.
4. Select Instances.
5. Click New Instances.
6. Choose the application service plan and choose Next.
7. Leave the text field empty and choose Next.
8. Choose Next again (since there isn't any application to which you could assign this service).
9. As Instance Name, enter xsuaa and choose Finish.

Collaborative Address Validation Using SAP Enterprise Eventing Services


46 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
5.2.2 Create Destinations Service on SAP Business
Technology Platform

Procedure

1. Navigate to your Cloud Foundry space.


2. Go to Service Marketplace.
3. Select Destination.
4. Select Instances.
5. Choose New Instances.
6. Choose Next.
7. Choose Next.
8. Choose Next again (since there isn't any application to which you could assign this service).
9. As Instance Name, enter, for example, destination and choose Finish.

5.3 Adapt the Application Configuration

The application has been designed as a ready-to-use example. However, you need to make small changes to
two files (manifest.yml deployment descriptor and application.properties file of Spring).

Procedure

1. Open the project in your files system.


2. Open the manifest.yml file of the application. You find it under ./application/)
3. Specify the application route in the routes.route section. It should match your Cloud Foundry region host.
See the full list of regions on the SAP Help Portal : https://help.sap.com/viewer/
65de2977205c403bbc107264b8eccf4b/Cloud/en-US/
350356d1dc314d3199dca15bd2ab9b0e.html#loiof344a57233d34199b2123b9620d0bb41 For example, if
your region is Europe (Frankfurt). then your route might look like:

- route: my-eventing-app.cfapps.eu10.hana.ondemand.com

4. Specify the same route in the addressConfirmation.url property of the JSON object, stored in the
SPRING_APPLICATION_JSON section. The line should look as follows:

"url": "https://my-eventing-app.cfapps.eu10.hana.ondemand.com/#/
confirmAddress/%s"

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 47
 Note

It should be in a single line without any word-wrapping.

5. Specify the names of your destination, messaging, and xsuaa services in the services section.

5.4 Build the Application

In this step, you're packaging the application using Maven (for more information, refer to Apache Maven
Project ). Maven generates a JAR file that you can import to SAP Business Technology Platform.

 Note

In this step, you're skipping all unit and integration tests. If you want to run all tests and/or deploy the
application locally, please refer to the Appendix of this document.

Procedure

1. To build the application, go to the command console.


2. Switch to the application directory, for example .\application.

 Note

You should be in the application folder, not in the root folder of the project.

3. Enter:

mvn clean package

4. After Maven has downloaded all dependencies and successfully compiled the Java source files, you receive
a success message:
[INFO] BUILD SUCCESS
5. In the Target folder, you'll find the WAR file that you created, for example: S4HANA-Eventing-
application.war

Collaborative Address Validation Using SAP Enterprise Eventing Services


48 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
5.5 Deploy the Application

Prerequisite

The Cloud Foundry Command Line Interface (cf CLI) tool is installed on your computer.

Procedure

1. To deploy all applications at once, use the Cloud Foundry Command Line Interface (cf CLI) tool.
2. Go to command console.
3. Switch to the application folder of the project structure (.\application).
4. Use the Cloud Foundry command to log on to your Cloud Foundry account:

cf login

 Note

You're prompted to specify the API endpoint to which you want to connect. You can find it in your
subaccount:

5. After you've entered the API endpoint, enter your user name (your p-user) and password.
6. Push the applications to the cloud with the command:

cf push

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 49
5.6 Test Application End-to-End

5.6.1 Prepare Sample Data in SAP S/4HANA Cloud

Prerequisite

Your user needs the SAP_BR_BUPA_MASTER_SPECIALIST role.

Procedure

1. Access the SAP Fiori launchpad.


2. Go to Maintain Business Partner.
3. Choose Person.

4. From the dropdown list, select Contact Person.

Collaborative Address Validation Using SAP Enterprise Eventing Services


50 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
5. Choose Create in the dialog box.

6. Maintain the mandatory fields.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 51
7. Choose Save.
8. A success message is displayed:

9. Choose Home to return to SAP Fiori launchpad.


10. Start the Manage Customer Master Data app.
11. Choose Create Organization .

Collaborative Address Validation Using SAP Enterprise Eventing Services


52 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
12. Maintain the following fields:

Property Value

Grouping Internal numbering for standard use

BP Role FLCU01

Title Company

Name1, Address <Choose any valid value>


Fields, Country,
Language

SalesOrg 1010

Distribution 10
Channel

Division 00

Currency <Choose any valid value>

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 53
13. Choose OK.

14. Choose Save.


15. Assign the previously created contact person to the customer by choosing Contacts.
16. Choose Edit.

Collaborative Address Validation Using SAP Enterprise Eventing Services


54 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
17. Choose +.

18. Enter your Contact Person number.

19. Choose Save.


20.Now the contact has been assigned to the customer. You can check the details by choosing the newly
created line.
21. Go back to the SAP Fiori launchpad.
22. Open the Maintain Business Partner app again.
23. Enter the number of the contact person that you created previously.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 55
24. Choose Enter.
25. Choose Relationships.

26. Choose Maintain.

Collaborative Address Validation Using SAP Enterprise Eventing Services


56 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
27. Enter values in the Function and Department fields.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 57
28. In the Communication section, enter an e-mail address under E-Mail.

29. Choose OK and Save.


30.Return to SAP Fiori launchpad.
31. Open the Manage Customer Master Data app.
32. Under Business Partner, enter the business partner number (or another search term).
33. Choose Go.

34. Go to the Contacts tab and choose the details.

Collaborative Address Validation Using SAP Enterprise Eventing Services


58 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
35. See the e-mail address.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 59
5.6.2 Change Business Partner and Confirm Address

Procedure

1. Access the SAP Fiori launchpad.


2. Go to Maintain Business Partner.
3. Search for the customer you created in the previous steps.

4. Change some details about the business partner's address, for example the house number.

Collaborative Address Validation Using SAP Enterprise Eventing Services


60 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
5. You will receive an e-mail that includes the address and a link to the confirmation UI.

 Note

It might take some time until you receive the e-mail. However, if you haven't received any e-mail after a
few minutes, restart the application on SAP Business Technology Platform to make sure that it works
properly. Then repeat the previous step. You will only receive the e-mail with the link if your e-mail
address is assigned to the contact person you created and assigned previously.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 61
6. Click on the link to open the UI.

Collaborative Address Validation Using SAP Enterprise Eventing Services


62 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
7. Confirm the address or make a change and approve it.
8. Access the SAP Fiori launchpad.
9. Go to Manage Business Partner Master Data.
10. Search for the customer whose address you confirmed in the previous steps. Check if the business
partner's address has been updated and check if Address Confirmation State is set to Confirmed.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Configure and Deploy Consumer Application to SAP Business Technology Platform PUBLIC 63
Collaborative Address Validation Using SAP Enterprise Eventing Services
64 PUBLIC Configure and Deploy Consumer Application to SAP Business Technology Platform
6 Appendix

6.1 Run All Tests Locally

To run all unit and integration test on your local machine, you need to change the configuration that is used in
the tests. The configuration is mainly within the CloudFoundryEnvironmentMock.java class, which, as the name
suggests, imitates the Cloud Foundry environment on your local machine. The platform feature that you need
to run the tests is the destination feature. That’s why you find all necessary destinations in that class. In this
step, you're changing the destination for sending e-mails and connecting to your SAP S/4HANA system.

Procedure

1. Open the CloudFoudnryEnvironmentMock.java file with your IDE or a text editor.

 Note

You can find it under \s4-sidebyside-eventing\unit-tests\src\main\java\com\sap\cloud


\s4hana\eventing\testutil\CloudFoundryEnvironmentMock.java.

2. Change the DefaultMailDestination in accordance with your mail server settings (same input you used to
set up the mailing destination on SAP Business Technology Platform):

3. Change the DefaultErpDestination in accordance with your SAP S/4HANA Cloud system setup (same input
you used to set up the ErpQueryEndpoint destination on SAP Business Technology Platform):

4. Since the integration tests are connecting to an SAP S/4HANA system, you need to provide the ID of a test
business partner and the ID of the business partner's address. Open the EntitySupplier.java class, which
you can find under \s4-sidebyside-eventing\unit-tests\src\main\java\com\sap\cloud
\s4hana\eventing\testutil\EntitySupplier.java.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Appendix PUBLIC 65
5. Change the variables EXISTING_BUSINESS_PARTNER_KEY and EXISTING_ADDRESS_ID to correspond to
an existing entity in your SAP S/4HANA system.
6. Within the application.properties file, change the variable spring.profiles.active to Local (Note the
uppercase L).
7. Open the command prompt and navigate to the root folder of the project.
8. To execute all tests, run

mvn test

6.2 Run the Sample Application Locally

To run the application on your local machine, you need to define all required environment variables, which are
provided by Cloud Foundry, in the Cloud and on your local machine. In the next steps, you're defining an
environment variable for destinations and the VCAP services.

Procedure

1. Define an environment variable called destinations.

 Note

Find an example of such a variable within the localEnvironmentSetup.txt in the root folder of the
project. You need to change this example in accordance with your current setup.

2. Define an environment variable called VCAP_SERVICES .

 Note

Find an example of such a variable inside the localEnvironmentSetup.txt in the root folder of the
project. You can use the same variable to make it work.

3. Open the command prompt and navigate to the application folder of the project.
4. To deploy the application on your local machine, run

mvn spring-boot:run

6.3 Issues

Please note that SAP does not offer any official support for the sample code (see the SAP SAMPLE CODE
LICENSE AGREEMENT on GitHub). However, feel free to use the Issues section on GitHub if you have any

Collaborative Address Validation Using SAP Enterprise Eventing Services


66 PUBLIC Appendix
problems. We recommend that you browse through the known issues section before creating a new issue
.

6.4 Document History

Revision Date Change

1.0 2018-05-28 Document created.

1.1 2018-06-11 Overview section revised.

1.2 2018-08-24 Minor amendments added.

2.0 2019-04-12 Document updated.

2.1 2019-05-31 Prerequisites [page 6] and Configure


and Deploy Consumer Application to
SAP Business Technology Platform
[page 41] updated with new URLs.

2.2 2019-09-13 Issues [page 66] section added.

Collaborative Address Validation Using SAP Enterprise Eventing Services


Appendix PUBLIC 67
Important Disclaimers and Legal Information

Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:

● Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:

● The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
● SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.

● Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such
links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.

Videos Hosted on External Platforms


Some videos may point to third-party video hosting platforms. SAP cannot guarantee the future availability of videos stored on these platforms. Furthermore, any
advertisements or other content hosted on these platforms (for example, suggested videos or by navigating to other videos hosted on the same site), are not within
the control or responsibility of SAP.

Beta and Other Experimental Features


Experimental features are not part of the officially delivered scope that SAP guarantees for future releases. This means that experimental features may be changed by
SAP at any time for any reason without notice. Experimental features are not for productive use. You may not demonstrate, test, examine, evaluate or otherwise use
the experimental features in a live operating environment or with data that has not been sufficiently backed up.
The purpose of experimental features is to get feedback early on, allowing customers and partners to influence the future product accordingly. By providing your
feedback (e.g. in the SAP Community), you accept that intellectual property rights of the contributions or derivative works shall remain the exclusive property of SAP.

Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.

Gender-Related Language
We try not to use gender­specific word forms and formulations. As appropriate for context and readability, SAP may use masculine word forms to refer to all genders.

Collaborative Address Validation Using SAP Enterprise Eventing Services


68 PUBLIC Important Disclaimers and Legal Information
Collaborative Address Validation Using SAP Enterprise Eventing Services
Important Disclaimers and Legal Information PUBLIC 69
www.sap.com/contactsap

© 2021 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form


or for any purpose without the express permission of SAP SE or an SAP
affiliate company. The information contained herein may be changed
without prior notice.

Some software products marketed by SAP SE and its distributors


contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for


informational purposes only, without representation or warranty of any
kind, and SAP or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP or
SAP affiliate company products and services are those that are set forth
in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an
additional warranty.

SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.

Please see https://www.sap.com/about/legal/trademark.html for


additional trademark information and notices.

THE BEST RUN

You might also like