You are on page 1of 27

PUBLIC

openSAP
Build Resilient Applications on SAP BTP with Amazon Web
Services

Week 2 Unit 1

00:00:05 Hello and welcome to the openSAP course, Build Resilient Applications on SAP BTP
00:00:12 with Amazon Web Services. My name is Marc Huber and I'm a product manager at SAP.
00:00:18 In this unit, you are going to learn more about low-code/no-code app development on SAP
BTP
00:00:25 and serverless capabilities on AWS, so let's get started. In this unit, you will get an
introduction
00:00:35 into low-code/no-code application development on SAP BTP and all the capabilities
00:00:41 of SAP's low-code/no-code portfolio SAP Build. Additionally, you will get an introduction
00:00:49 into the serverless capabilities in AWS. We will also present the business case
00:00:55 you are going to develop this week. Let's start with the motivation.
00:01:02 Organizations and their digitalization projects are challenged by limited development
resources.
00:01:10 They can respond to this challenge by empowering their business users to build solutions
00:01:17 and shifting development tasks to business users or improve the productivity of their
professional developers
00:01:25 with low-code/no-code solutions. This is why organizations invest
00:01:30 in low-code development solutions to bridge the gap between individual business
requirements
00:01:36 and a shortage of developers. At SAP, we are enabling our customers
00:01:45 to become an intelligent sustainable enterprise by bringing together our comprehensive
portfolio
00:01:52 of solutions and technology to our customers' business needs.
00:01:57 It starts with our Business Technology Platform that provides the foundation of application
integration,
00:02:06 extension to a robust ecosystem of solution, data, and AI. And like our professional
development tools,
00:02:15 SAP Build is part of the application development of SAP BTP. So let's have a closer look on
SAP Build.
00:02:25 SAP Build combines our low-code solutions, which enables the people closest to the
business problems
00:02:33 to create enterprise applications, automate processes, and design business sites
00:02:39 with drag-and-drop simplicity. SAP Build brings together SAP Build Apps,
00:02:47 SAP Build Process Automation, and SAP Build Work Zone into a unified development
experience
00:02:54 with new innovations to rapidly build apps, automate processes, and create business Web
sites.
00:03:03 Developers can integrate smoothly with SAP and non-SAP applications
00:03:08 and leverage hundreds of pre-built processes, bots, UX components to unify business data
and processes,
00:03:17 so business and IT can collaborate effectively as fusion teams with drag-and-drop simplicity

00:03:25 and governance built in throughout the application development lifecycle. Let's have a
closer look on the different tools,
00:03:34 and let's start with SAP Build Apps. SAP Build Apps empowers the business users
00:03:40 to build Web and also mobile applications with an intuitive no-code development
environment.
00:03:48 You can simply drag-and-drop user interfaces, components, define properties, styling, and
layout of your application.
00:03:57 You can easily access SAP and non-SAP data by REST APIs or OData services.
00:04:05 Sometimes, you maybe need an additional data model. Therefore, you can also build your
backend
00:04:11 with SAP Build Apps by dragging and dropping data entities and fields.
00:04:16 Additionally, you can also define backend logic and use it as functions in your frontend
application.
00:04:24 And you can also work together in fusion teams also in the application development area.
00:04:34 Let's continue with SAP Build Process Automation. It enables business users to automate
processes and tasks
00:04:42 without any programming experience. They can leverage their domain expertise
00:04:49 with an intuitive, easy-to-use, and powerful low-code experience.
00:04:54 You can build faster by accessing workflow management, RPA, decision management,
process visibility,
00:05:03 and embedded AI capabilities in a single solution. You can also get started immediately with
predefined content,
00:05:13 like templates from the SAP Build store. Let's come to the next component.
00:05:23 SAP Build Work Zone. SAP Build Work Zone enables you to easily build
00:05:29 business sites that provide centralized access to business application information on any
device,
00:05:36 so users can create beautiful custom business sites for themselves, suppliers, customers,
partners, and so on,
00:05:44 without writing any code. So business sites created with SAP Build Work Zone
00:05:50 providing a central access to relevant applications, processes, and information.
00:05:57 With SAP Build Work Zone, you can maximize productivity by enabling guided experiences
and also knowledge sharing.
00:06:09 SAP Build is designed to extend and automate SAP's line of business applications.
00:06:16 So for example, in SAP Sales and Service Cloud, we have embedded SAP Build apps,
00:06:22 so you can create applications and embed these applications in the service agent's desktop
easily.
00:06:30 SAP Build Process Automation has packages for all our line-of-business solutions,
00:06:35 especially for SAP S/4HANA. Here, we offer pre-built content
00:06:41 in SAP Build Process Automation to automate typical business processes in S/4HANA.
00:06:47 These are just some examples how we are embedding SAP Build in our line-of-business
applications
00:06:54 to show our customers how they can extend their solutions and get more value from SAP.
00:07:01 Now I'm going to hand over to my colleague Diego who will give you some insights
00:07:06 into the AWS serverless capabilities. Hello, I'm Diego Lombardini

2 / 27
00:07:12 and I'm an SAP partner solutions architect at AWS. Today, I'm going to talk about
serverless computing,
00:07:18 what it is, and why it is important. So what is serverless computing?
00:07:23 The set of services, practices, and strategies that enable you to design and build
applications
00:07:27 using built-for-purpose services without the need to manage servers or infrastructures.
00:07:32 We talk about three layers within the context of serverless. The first one is compute.
00:07:37 This is where your application code, your business logic runs.
00:07:40 The next one is integration, which is what is used for the different components
00:07:45 to talk to each other. And last one is the data stores.
00:07:48 This is where your data persists. Things like files and databases.
00:07:52 With serverless architectures, tasks such as provisioning, capacity provisioning,
00:07:58 and patching are managed by AWS, so you don't have to worry about that.
00:08:02 This means you can focus on building your applications, building your business logic,
00:08:06 which is basically what your customers and your business need to operate.
00:08:10 Things like automated scaling, built-in high availability, and pay-as-you-go model
00:08:15 are key attributes of serverless architectures. APIs are usually the entry door into your
systems
00:08:21 and what's used for the different components and features to communicate to each other.
00:08:25 At AWS, we have services to cover the three layers of the stack that we mentioned before,
00:08:30 and we're going to go through that in the next few slides. Now, what's the approach to
serverless?
00:08:36 How can we be successful for serverless applications? So the first thing is thinking about
the features, right?
00:08:42 So if we have an application, let's not think about that as one whole.
00:08:45 Let's talk about what features do I have within an application, and treat them independently.

00:08:50 So for example, if I have four functions within one application, I don't think about one
application with four functions,
00:08:56 I think about four different features that should work independently of each other.
00:09:00 We will use events to communicate between them, right? And this is effectively the key
thing
00:09:06 about the communication between different components. We'll talk about stateless,
00:09:10 meaning that each one of these components should be independent, it should have all the
information in the event
00:09:15 to be able to operate. The other key thing is about thinking about your data upfront,
00:09:21 thinking about the data structures and data flows when you start designing and know what
you're building.
00:09:26 This way you can design each one of these components and features independently.
00:09:31 And the last thing is to make sure that you use the services that are built for specific
functions
00:09:35 and not try to reinvent the wheel. If there's already a service that works for what you need,
use that.
00:09:42 But if there isn't, it's okay to create one. Now, what are the benefits?
00:09:47 We spoke about the approach to serverless, but why would we want to use serverless?
00:09:52 So the first thing, and the most important one is it enables your business to be more agile.
00:09:57 Because you don't have to worry about running infrastructure,

3 / 27
00:09:59 you worry about your business outcomes. This means that you can accelerate your speed
to market
00:10:04 and you can release quicker to your business and to your customers,
00:10:07 and you can actually iterate and adapt as you go. The next thing is about lowering your
cost.
00:10:14 Because you don't have to provision for what you think is going to be peak time for your
business,
00:10:19 you will only pay for what you consume. And this brings us to the next item, which is scaling.

00:10:26 Your systems will scale when needed, not based on what you think,
00:10:30 but based on what actually happens. And not only can you cope with that scaling,
00:10:34 but also it can be done fast because these services have been designed to support this.
00:10:39 And lastly, you can build better applications because all of the services have been designed

00:10:44 to be able to interact with each other, so you don't have to worry about how do you interact
00:10:49 the different services. Now we're going to go through some of the key services
00:10:55 within the suite of AWS services for serverless. As you know, we have more than 200
services,
00:11:02 so we're just going to go through eight of them. The first one is Amazon API Gateway.
00:11:08 As I mentioned before, APIs are the entry door to your applications.
00:11:12 And with Amazon API Gateway, you can secure and manage APIs
00:11:15 both from internal services as well as external. The next one is AWS Lambda.
00:11:22 This is effectively the engine room where you build your business logic,
00:11:25 where you run your code. This is where you will spend a lot of the time
00:11:29 designing more features and how they're going to operate. The next one, we're talking
about data persistent,
00:11:35 is Amazon DynamoDB. It's a fast and flexible NoSQL database
00:11:40 for modern and scalable applications. The next service is Amazon Simple Storage Service,
00:11:47 also known as S3, which is a resilient object store that allows you to store any amount of
data,
00:11:54 things like documents, data files, files for analytics, attachments, and logs.
00:12:02 The next service is Amazon EventBridge, where you can integrate all your services using
events
00:12:07 without needing to write code. AWS Step Functions allows you to automate workflows
00:12:14 across more than 200 AWS services, again, without the need to write code.
00:12:20 Amazon SQS is a managed queue service where you can send, store, and receive
messages
00:12:25 between different applications and software, without needing the services to be available
00:12:29 when the message is sent. And the last one is Amazon SNS,
00:12:35 which is a service for pub/sub message notifications that allows you to integrate applications
between each other,
00:12:41 as well as send emails, SMS, and push notifications to mobile devices. Now let's look at an
example of an AWS services architecture
00:12:56 utilizing AWS and BTP services. The use case in here, it's a monitoring of,
00:13:02 for example, temperature or pumps. So in in this case, in the past,
00:13:09 the business needed to monitor the temperature of fridges on a frequent basis.
00:13:15 This meant that there was someone that had to go through the different rooms where
fridges are located,

4 / 27
00:13:21 and they had to check the temperature every so often. This means two things.
00:13:25 First of all, they're spending quite a bit of time going through all the different rooms.
00:13:28 And the second challenge with that is that they would only be able to be at one place
00:13:33 at one point in time. Ao if a fridge stopped working
00:13:36 and they could only get to that fridge every two hours, there's a risk that in those two hours
the temperature drops.
00:13:44 So how can we resolve this with AWS and BTP services? So first of all, we start with IoT
devices.
00:13:50 We install IoT devices in the different fridges so we can monitor the temperature constantly.

00:13:56 On the other side, we have an application where you would be able to define
00:14:02 the thresholds for temperature. So for example, we define that certain fridges
00:14:06 need to be between this and this temperature. That basically is reflected in the admin app
00:14:10 in this architecture. So when we define that, that effectively defines a threshold
00:14:15 within our platform. And as the data starts streaming,
00:14:18 we can then monitor if the temperature's within that threshold.
00:14:22 If the temperature, it drops or goes above the temperature that we define as the threshold,
00:14:28 we will send a notification. So a technician will receive an email or an SMS
00:14:34 or a push notification depending on the architecture, and then they'll be able to react to that.

00:14:39 The first thing for them to do is to open their field application,
00:14:42 and they can see the data, they can see the trend, what's happening,
00:14:45 how long ago was the temperature starting to drop or increase. And once they receive that
information,
00:14:52 they can do certain things like, for example, they can go and visit the room and see what's
going on.
00:14:58 They may be close to that so they can do that. Or they may need to get a specialized
technician
00:15:02 because they may attend a place or they may know that they have to call someone.
00:15:05 In that case, they can integrate with S/4HANA, for example, they create a maintenance
order,
00:15:09 so someone can go and fix the problem that they identified. And now I'm going to hand it
over to Marc.
00:15:18 Thank you, Diego. So let's continue with the business scenario
00:15:22 that you are going to develop. In a user interface,
00:15:26 a business partner request form is created. In this form, the data and documents for
approval
00:15:33 are attached and automatically stored in AWS S3. Afterwards, an approval process is
triggered.
00:15:43 After the approval, the business partner is created in the backend system, the SAP
S/4HANA,
00:15:49 and an email confirmation will be sent out. Let's have a closer look on the architecture.
00:15:56 The Web app will be built with SAP Build Apps. The approval workflow will be modeled
00:16:03 in SAP Build Process Automation. These services run on SAP Business Technology
Platform.
00:16:12 We are using the Amazon API Gateway for the communication between the SAP BTP
platform and the AWS Cloud.
00:16:22 The documents from the UI are stored in the Amazon S3 service.
00:16:27 Finally, after completion of the approval, the business partner data will be stored

5 / 27
00:16:33 in the SAP S/4HANA system. On the BTP, you will need SAP Build Apps,
00:16:45 SAP Build Process Automation, SAP Build Work Zone, so the complete package of SAP
Build.
00:16:51 And additionally, you will need the SAP Cloud Identity Services for authentication.
00:16:58 Additionally, you will need an S/4HANA system for the development where you will store the
data.
00:17:06 On AWS, you need a free-tier account with API Gateway, Simple Storage Service, and
Simple Notification Service.
00:17:17 On the following slide, you will find links where you can get additional reading
00:17:22 if you want to dive deeper into a specific topic. With that, this concludes our unit
00:17:31 about low-code/no-code app development on SAP BTP and serverless capabilities on AWS.

00:17:39 You learned about low-code/no-code development. You got an overview about the SAP
Build portfolio.
00:17:46 You got the introduction into serverless computing and what AWS services provide in this
area.
00:17:54 Thank you very much for your attention and I wish you happy no-coding.

6 / 27
Week 2 Unit 2

00:00:05 Welcome to week two of our openSAP course, Build Resilient Applications on SAP BTP
with AWS.
00:00:12 I'm Praveen Padegal, working as a development expert at SAP. In this unit,
00:00:18 you will look at building low-code/no-code applications using SAP Build Apps.
00:00:24 In this unit, we will introduce the SAP Build Apps. You'll also learn how to build
00:00:30 business partner onboarding application and SAP S/4HANA extension app using SAP Build
Apps,
00:00:37 followed by a demo. An ERP clean core strategy helps ensure organizations
00:00:46 use the latest release, minimize, or eliminate modifications, and run with cloud-compliant
extensions and customizations.
00:00:55 SAP extension is a software that enhances the capabilities of products,
00:01:00 such as SAP S/4HANA, SAP SuccessFactors, SAP Ariba, and more. SAP Build Apps
assists customers
00:01:09 in building these extensions, and facilitates their transformation
00:01:13 towards becoming an intelligent enterprise through the provision of low-code/no-code
capabilities.
00:01:22 SAP Build Apps is a low-code/no-code solution to create enterprise-grade applications
00:01:28 for mobile devices and Web browsers with drag and drop functionality.
00:01:34 A citizen developer can create an end-to-end app from data model to business logic to UX,
00:01:41 all within SAP Build Apps by dragging and dropping the controls
00:01:45 and integrating with any SAP and non-SAP backend systems. Any SAP Build Apps project
starts in the unified lobby.
00:01:57 This is a central place for creating, accessing, and managing projects within the solution.
00:02:03 From the lobby, you can easily start to build an app, a process automation, or a business
site.
00:02:10 A build app is made of two main components, the frontend, where you'll create the user
interface
00:02:17 with data entry fields and UI logic and controls, and the backend, where you'll create visual
cloud functions
00:02:25 with custom data models and business logic functions. So let's explore the key capabilities
of SAP Build Apps.
00:02:36 SAP Build Apps provides powerful features for sophisticated application development.
00:02:42 Include a drag-and-drop app builder, more than 400 built-in formulas,
00:02:49 and pre-configured flow functions to add UI controls and business logic.
00:02:55 The look and feel of the app is highly customizable with design themes, including an SAP
Fiori theming.
00:03:03 The visual cloud functions empower users to assemble full-stack apps
00:03:09 with data models and business logic, without writing code. Citizen developers can easily
create data tables and data models
00:03:18 and compose APIs with the same no-code paradigm used for the frontend. A rich
marketplace for components and extensions
00:03:28 enables reuse of building blocks across projects and fuels collaboration between
developers.
00:03:36 It also provides the predefined integrations and custom connectors that help make
connecting to external data sources straightforward,
00:03:45 thereby speeding up the creation of SAP app extensions and third-party extensions.

7 / 27
00:03:52 You can integrate APIs from SAP or non-SAP systems via REST APIs, OData, and SAP
BTP destinations.
00:04:01 Furthermore, introduced application publishing capabilities for the Web, iOS, and Android
00:04:08 help you connect to various platforms with these. Whether you are a professional developer

00:04:14 or a citizen developer, you can take advantage of SAP Build Apps
00:04:19 to build the applications quickly without writing any code. Let's look at some of the use
cases of customers
00:04:28 who built applications using SAP Build Apps. Verge built 10 apps, integrated them to the
backend,
00:04:37 to orchestrate the manufacturing process in a flexible manner.
00:04:41 Pif Paf Alimentos built a mobile solution to help their field technicians
00:04:46 to execute maintenance work at their production plants. Ernst and Young built ERA, a
mobile-first pro-bono app
00:04:55 that acts as a conduit to match people with resources during humanitarian crises.
00:05:02 Let's look at the high-level architecture of the scenario that we are building in this unit.
00:05:08 We'll first create an SAP S/4HANA extension application for onboarding the business
partner using SAP Build Apps.
00:05:17 Before developing, you need to first subscribe to the SAP Build Apps and Cloud Identity
Services.
00:05:25 Then you need to assign the relevant roles. You also have to create a destination for SAP
S/4HANA
00:05:32 that you can integrate with the business partner onboarding application that you are
building.
00:05:38 You can also optionally subscribe to SAP Build Work Zone, standard edition,
00:05:44 where you can host a Build Apps application after deployment.
00:05:51 Let us move to the demo. I have logged in to SAP BTP account
00:05:55 and subscribed to all the required services. Let us navigate to SAP Build Apps to get
started.
00:06:05 It opens the lobby, and the lobby is the central place
00:06:08 for creating and managing all the SAP Build artifacts. We can click on the Create button
00:06:13 to start creating the application. You can choose Build an Application
00:06:20 and then choose Web and Mobile Application. You can enter the project name and a short
description.
00:06:30 You can click on the Create button to start creating the application.
00:06:38 It opens the app builder. UI Canvas tab provides the controls
00:06:53 to create the user interface and bind the UI elements to data.
00:07:00 We can use the Auth tab to enable the authentication to the Build Apps application that we
are building
00:07:07 and click on Enable Authentication, SAP BTP Authentication,
00:07:11 and then click OK to enable the authentication.
00:07:18 We can use the Data tab to add the integrations to various data sources
00:07:23 that will be used in the application. In this demo, we'll be using S/4HANA mock server
00:07:30 with business partner API. In the real use case,
00:07:34 you'll use your S/4HANA cloud or on-premise system and create a destination for the same.

00:07:43 The steps for that are detailed in the exercises. I have already created
00:07:55 the business partner mock server destination, using the business partner API.

8 / 27
00:08:02 So we will be using this destination in our onboarding application.
00:08:09 So you can click on Add Integration, BTP Destination,
00:08:13 and then select the BTP destination that we have just created.
00:08:19 And you can click on Install Integration to install the integration.
00:08:24 And then you need to click on Enable Data Entity to enable the data entity.
00:08:33 Business partner API has many fields, and we'll be using some of the fields in our demo.
00:08:40 So we will navigate to UI Canvas tab to create the user interface.
00:08:47 We will change the title of the application to "Business Partner onboarding".
00:09:09 We can switch to variables view and create the variables that are required
00:09:14 for our business partner onboarding application. You can create different types of variables
00:09:21 based on the respective scope required in the application. If you want your variable to be
available globally,
00:09:28 then you can create an app variable. Page variables exist in the context of current page.
00:09:39 They are initialized when the page opens and removed from the app when the page is
closed.
00:09:46 And data variables are like page variables, but this schema is defined
00:09:52 by the data entity they are linked to. Additionally, they contain default logic
00:09:57 to fetch data from the backend and populate it to the variable.
00:10:02 So we will create a data variable for the business partner API.
00:10:16 And we are using it to create new data. So I'm selecting a new data record.
00:10:23 We can click on Save periodically to save the application progress.
00:10:34 We will make the business partner that we created in the blocked state,
00:10:40 and we will explain how to unblock it after the approval from the approver
00:10:45 in the subsequent units. We will switch back to View tab
00:11:14 to create the user interface. We will drag and drop the input field component.
00:11:28 We can change the label of the input field to Business Partner ID
00:11:36 and bind the value to business partner of the data variable that we create.
00:11:52 Similarly, we can drag and drop a couple more input fields
00:11:57 for the first name and last name of the business partner. We will bind the first name value
00:12:14 to the first name of the data variable, business partner. We will drag and drop the button
component
00:12:46 and we can rename the button label to create. We can define the logic that needs to happen

00:12:55 on top of this button using the logic edit. By default, most commonly used flow functions
00:13:07 are already pre-installed. You can use the marketplace
00:13:11 and search for the components and flow functions that you want to additionally use in your
application
00:13:17 and install them. We will drag and drop the "Create record" flow function
00:13:23 and bind the resource to the business partner data entity. We will bind the record
00:13:39 to the business partner data variable that we have created earlier.
00:13:54 This will create the business partner in the S/4HANA system when the user clicks on the
Create button.
00:14:02 Each flow function provides the input and output connections and you can build the logic
flow by using that.
00:14:14 The create record logic function provides two outputs - one when the creation is successful,

00:14:22 and the other when it is failed. We can bind the output of the create record

9 / 27
00:14:29 to show the respective message to the user by using the Alert dialog.
00:14:36 We can enter the dialog title as "business partner created successfully"
00:14:41 and bind it to the success output. And similarly, we can create another alert
00:14:49 when the business partner is failed and bind it to the respective output.
00:15:02 We can use the "Show spinner" to show the blocking UI loading spinner
00:15:07 when the API request is sent to the backend system, and then use the "Hide spinner" flow
function
00:15:13 to hide the spinner once we get back the response from the backend system.
00:15:34 We can click on Save to save the application. That's it.
00:15:47 We have created the business partner onboarding application. And now let us test this
application
00:15:53 by navigating to the Launch tab and then clicking on Open Preview Portal.
00:15:59 So the preview portal provides the functionality to preview the app on Web,
00:16:04 and you can also follow these steps to preview on your device.
00:16:16 So you can enter the business partner ID, the first name and last name,
00:16:21 and then click on Create to create the business partner. The business partner is created
successfully
00:16:32 and you can check the details in the S/4HANA system that you have used.
00:16:39 I'm using the business partner API to query whether the business partner
00:16:44 is created successfully or not. You can see the business partner is created successfully.
00:16:54 As we have tested our build app locally, you can now further deploy it to the SAP BTP
Cloud Foundry
00:17:01 and host it in SAP Build Work Zone, which can be given access to the business users.
00:17:08 The following diagram shows the detailed architecture. All right, now that we have
successfully completed the demo,
00:17:18 to learn more about SAP Build Apps, you can check these links.
00:17:25 This concludes our unit. Keep the code clean by extending SAP S/4HANA
00:17:30 with SAP Build Apps. So far, you have learned about what SAP Build Apps is
00:17:36 and its capabilities. Then you created the business partner onboarding application
00:17:41 with SAP Build Apps. In the next unit,
00:17:44 you will learn how to integrate SAP Build Apps with AWS services.
00:17:49 Thank you.

10 / 27
Week 2 Unit 3

00:00:05 Hello and welcome to week two, unit three of our openSAP course Build Resilient
Applications
00:00:10 on SAP BTP with Amazon Web Services. My name is Diego Lombardini
00:00:15 and I'm an SAP partner solutions architect with AWS. In this unit, you'll learn how to connect
SAP Build Apps
00:00:22 with AWS services. Let's get started.
00:00:27 So today we're going to cover an introduction to Amazon API Gateway
00:00:30 and Amazon Simple Storage Service, also known as S3. Then we're going to go through a
scenario
00:00:36 that you're going to build and I'm going to do a demo. But before we start, what is Amazon
API Gateway?
00:00:45 As we briefly covered in unit one, APIs are the entry door for your services architectures.
00:00:51 With Amazon API Gateway, you can manage and create all your APIs for enterprise.
00:00:58 This means both for AWS services as well as external APIs. It is very simple to expose
AWS services
00:01:05 as APIs using Amazon API Gateway. You can manage versions for your APIs,
00:01:12 security, access management, monitoring, throttling, and quarter management.
00:01:17 And it supports both RESTful APIs as well as WebSockets APIs.
00:01:24 Now, what is Amazon Simple Storage Service? It's a service also known as Amazon S3,
00:01:29 where you define buckets and objects. Now, what is a bucket?
00:01:33 A bucket is a container where objects are stored and objects are just files with associated
metadata.
00:01:41 Things like files for data and analytics, attachments, documents, pictures,
00:01:46 as well as static websites can be hosted in Amazon S3. The key features of S3 is that
00:01:54 it's a highly reliable service with 11 9s of durability. It supports versioning and replication
00:02:00 across geographical regions as well as encryption. And you can store objects within
different storage classes,
00:02:07 which means you can manage the cost depending on the frequency
00:02:11 that you need to access those files. Now the scenario that we're going to build today,
00:02:17 we're going to start from what we built in the last unit and we're going to add the option to
upload a file
00:02:22 using Amazon API Gateway and S3. Now to do this, we first are going to create an S3
bucket
00:02:30 where the files are going to be stored. Then we're going to create
00:02:33 an identity access management role and policy. So we can access these.
00:02:38 We're then going to define an API on top of this S3 bucket where we can actually upload the
file and read the file.
00:02:45 And lastly, we're going to add this API to our build app so the file can be uploaded.
00:02:53 Well, let's go into the demo. Okay, now I'm going to go through a demo
00:02:58 of the exercise that you'll be building this week. We're going to first start creating an S3
bucket.
00:03:04 This screen is the Amazon Web Services console where all the services are available and
accessible.
00:03:09 You can see recently visited services and this is where you can access S3 if you have it.
00:03:14 Otherwise you can add it to the favorites bar up here or you can search in the search bar.

11 / 27
00:03:21 So I'm going to use the search bar to access it and here's their Amazon S3 console.
00:03:27 I'm going to create the bucket and I'm going to call it bucket-build-apps.
00:03:34 One thing to keep in mind, the bucket name needs to be unique globally.
00:03:39 So only one account can have one bucket with a specific name.
00:03:44 I'm going to leave the region as US East 1 and I'm going to leave the rest of the settings by
default
00:03:50 including blocking all public access and encryption using the Amazon S3 managed keys.
00:03:56 And they're going to create the bucket now. And now my bucket is created.
00:04:03 Now, before we create an API, we need to make sure we have access to the bucket, right?

00:04:11 And we need to also be able to utilize this bucket via APIs. So I'm going to go into identity
and access management
00:04:21 which is IAM, which I have here in my favorites bar. And I'm going to first create a role.
00:04:36 So I'm going to roles and I'm going to create a role. This role will be a custom trust policy.
00:04:46 And what we need to do here is we need to allow our API to assume a role so then it can
access the S3 bucket.
00:04:58 The first thing we're going to do is we're going to use this policy here.
00:05:03 So what basically we saying here is we're allowing the API gateway service to assume a
role.
00:05:08 That means it is going to be able to access our API in the S3 bucket.
00:05:15 Now we're still not giving access to S3, in this case we're just allowing API Gateway
00:05:19 to assume the role. Next, we're going to need to create a policy
00:05:25 so we can actually provide access to our S3 bucket. Okay, so in here you can see a policy
editor
00:05:40 and it's a graphical representation where you can actually go through a wizard
00:05:46 where you can click on options for S3. In this case, I'm going to use a JSON definition.
00:06:02 Okay, so this policy, what basically we're saying is this is our resource, which is our S3
bucket
00:06:06 called bucket-build-apps. We provide an access to this bucket
00:06:10 and we are allowing, put object, which basically means save in an object
00:06:15 and get object, which means reading an object. So in the next step we are going to create
an API
00:06:20 which is going to have a put method and a get method. Now, we're going to go next.
00:06:28 We're going to define a name for this policy and I'm going to call it build-apps-policy-s3-api.

00:06:41 You can see here that it's already identified the JSON and it's already said in this role allows
me to read
00:06:47 and write and for a specific bucket name, which is called bucket-build-apps.
00:06:56 Creating the policy. Alright, so now, going to go back to our role
00:07:15 and we're going to add the policy we've just created called build apps policy S3 API.
00:07:24 And we're going to call this role build-apps-role-s3-api.
00:07:37 So again, we have a policy that gives us access to the S3 bucket to put and get files
00:07:43 and we're also allowing this role to be accessible via API gateway.
00:07:49 And now we create the role. Okay, now if we search for the role,
00:07:57 we can see the role is being created. Now the next step is to create our APIs.
00:08:04 So we're going to go into API Gateway and we're going to create a REST API.
00:08:20 You can see here that it supports AWS services which is effectively what we're doing.

12 / 27
00:08:27 So we're going to build. So in this case we just want to create a new API.
00:08:37 So we're going to leave it as REST and we're going to say create new APIs, new API
00:08:42 and we're going to define the name. In this case, I'm going to call it build-apps-api.
00:08:50 For the endpoint type, we're going to keep it regional, meaning it's within the region.
00:08:55 We could define it as edge, which is effectively in an edge zone or private,
00:09:00 which is within your VPC only, but in this case we need access externally.
00:09:05 And now we're creating the API. All right, so now the API is created
00:09:11 but we don't have any methods or any resources. So the first thing we need to do
00:09:17 is we're going to create resources. So the first resource, we're going to call it folder,
00:09:32 both the resource name and the path. This is going to basically define a path
00:09:36 within the URL of the API. And subsequently, we're going to create
00:09:48 another resource called item. And again, this is also going to be part of the URL.
00:09:59 And then we're going to be able to map this folder and item to the bucket and the file
00:10:04 that we're going to be able to put and read in our S3 bucket. Okay, now we have the paths.

00:10:16 The next step is to create the methods. We're going to first start with a put method
00:10:21 which is going to allow us to save the file in the S3 bucket.
00:10:26 So we create a method and we select put. Okay, now we need to define what this is going
to call,
00:10:35 what this put method is going to call. So in this case we're going to be using an AWS
service.
00:10:40 So this is part of the native integration that we mentioned in the beginning of this unit where
you can easily integrate
00:10:49 without having to write code. So first thing, we need to define the region.
00:10:54 In this case we define the bucket in US East 1 so we're going to use US East 1,
00:10:58 and now we're going to go for the service which is simple storage service or S3.
00:11:06 We're going to leave the subdomain blank. The method we're going to use is put
00:11:11 and we're going to override the path. So what we're going to do is we're going to use bucket

00:11:20 and object and the path. And this is going to allow us then to map bucket
00:11:24 to folder and object to item, and I'll show you that. Now the next step is to define the
execution role, right?
00:11:31 Which basically is a role that we have created before. So this will allow that when we call
this API,
00:11:44 it's going to use this role to call S3 and be able to put and read files.
00:11:52 So I'm going to paste this here and then we're going to leave the rest
00:11:58 with the default settings and we're going to save. So we have now defined our put method
00:12:06 and now we need to effectively do the mapping of the path to the bucket and the object,
00:12:13 and then we also need to change our integration or security method.
00:12:17 Let's start first with the mapping. So we're going to go to the URL path parameters
00:12:28 and we're going to add path. And the first parameter is going to be bucket,
00:12:34 and what we're doing is then we're mapping the bucket to method.request.path
00:12:42 and basically now we define the folder. So what this is saying is basically for the request
00:12:48 that we call through this resource, we'll map the folder to the bucket.
00:12:57 And now we're going to add mapping for the object which is going to be
method.request.path.item.
00:13:08 So again, we're going to now map the object which is effectively the file to the item.

13 / 27
00:13:11 So when we call the API with a /bucket/file. It's going to map to the bucket and the object in
the request.
00:13:26 Okay? So now we are going to go to create our get method.
00:13:52 Now similar to what we've done before, we're going to map it to AWS service,
00:13:56 same region, same service. But of course the method is going to be get
00:14:08 and we're going to use the same path override. And in this case, we're going to use
00:14:20 the same role that we used before. Now you would've noticed when we defined the role
00:14:28 we had both get and put so we could have split this using two different roles or two different
policies.
00:14:34 But in this case, we just using one for simplicity. Okay, so we've now created the get
method
00:14:45 and as we did before, we're going to need to map the parameters.
00:14:53 So I'm going to do a bucket. Folder.
00:15:09 Sorry, object to item. All right, now we've got a get and put,
00:15:26 one other thing we're going to do because we're going to be uploading a PDF file.
00:15:29 We need to make sure we treat that PDF file appropriately so we're going to go to the
settings of this API,
00:15:35 some of the parameters we had before, like the name and the endpoint type.
00:15:40 But here we're going to effectively allow to manage this PDF file as PDF, as opposed to
JSON.
00:15:47 So in here what we're going to do is we're going to allow application PDF.
00:15:55 If you were to use JPEG or any type of files, you also need to allow this here.
00:16:04 Alright, so now we've defined the API. The last thing we have to do is we need to allow API
keys.
00:16:18 So this means we're going to add security into our method. So we're going to add an API
key requirement
00:16:23 for a put method. So that's done within the method request.
00:16:32 So in here you can see we have the API key required. There's different ways that we can
secure this API.
00:16:39 In this case, we're going to use the API key and effectively we're going to set this to true.
00:16:45 And we then go back. Okay, so we've now defined in the method request
00:16:50 the API key to be required, and the next step is to now deploy this API.
00:17:04 We're going to deploy the API. When we deploy the API, the requests for a deployment
stage
00:17:11 in the description, deployment stage, it's effectively used for defining different stages
00:17:17 on different status of the APIs. This can be used for example
00:17:20 to manage different environments or the most popular use case is to manage version.
00:17:25 So if we want to release version two of the API, and version one, keep running,
00:17:29 we can use the stages to define that. And that's what we're going to do in here,
00:17:33 we're going to call it V1 and we say version one. And we can also add descriptions to the
deployment
00:17:40 so we can do multiple deployments within the same version and here we can add details
about it.
00:17:54 Now there's some settings for the API. So we're basically going to leave this by default,
00:18:07 we're going to save the changes. All right, so now the API has been published.
00:18:22 The next thing we now have to do is we need to create the API key
00:18:28 so we can actually connect to this API. So the first thing we need to do
00:18:33 is need to define a usage plan. And the usage plan is where you can define things

14 / 27
00:18:39 like throttling, quota, and this is where the API keys will also be mapped to.
00:18:44 So we're going to create a usage plan and this allows you to define things
00:18:51 like level of servicing depending on who's consuming the different apps via APIs.
00:18:57 So let's call this build API plan. We're going to keep it simple,
00:19:01 we're just going to turn off throttling and quota. And now we basically map this usage plan to
the API stage,
00:19:16 which we just created, which was build-apps-api and the stage v1.
00:19:30 We go to next. Now we need to associate the API keys
00:19:36 but because we don't have any, we're going to create one. So in this case you can see the
example talks
00:19:43 about customer name or user or application depending on what you're actually securing
here.
00:19:50 So we're going to call these build-api-key. We're going to leave it to auto generate a key in
this case.
00:20:07 Okay, so now we have the API key defined and you can see that here.
00:20:13 Once we start using it, we can actually look at the usage and how many calls we've got.
00:20:19 And in this case we have the ID for the key, and if we click and show, you'll be able to see
the API key.
00:20:26 So this is effectively what you're going to use when you call your API from build apps.
00:20:33 So now I'm going to pass it over to Praveen who's going to basically use this API and this
API key
00:20:38 to consume the API from SAP Build Apps. Thanks Diego.
00:20:46 We have built a business partner onboarding application in unit two.
00:20:50 Let us enhance this application by adding the functionality to upload supporting documents
to Amazon S3.
00:20:57 Let us open the business partner onboarding application that we have created using SAP
Build Apps from the lobby.
00:21:06 We need to create a few page variables that we will be using for this functionality.
00:21:12 So I have already created these variables. We'll use the fileupload variable
00:21:24 to store the selected files. The s3apikey variable is used for the API key
00:21:31 to access S3 APIs. The uploadurl variable is used to store
00:21:41 the Amazon API Gateway S3 bucket pack. We'll now add the option to select the files
00:21:55 by dragging and dropping the button. We'll rename it to Select Document.
00:22:22 SAP Build Apps provides the Pick files flow function that we can use to select the
documents.
00:22:29 We can install this Pick files flow function from the marketplace.
00:22:47 Pick files opens a native document picker allowing you to pick files from the device file
system.
00:22:55 Add the Pick files flow function to the logic of select document button
00:23:00 and save the selected file content to page variable file upload.
00:23:15 Enhance the Create button logic by adding upload files functionality.
00:23:23 Install the Upload files flow function from the marketplace. The Upload files flow function
uploads a file to the given URLs.
00:23:44 We will now add an Upload files flow function to the Create button logic.
00:24:08 We'll now bind file upload page variable to the files to upload input.
00:24:22 Let us add the content type and X API key to the headers. We will save the application
00:24:43 and let us test this application by clicking on Launch. Open the preview portal to test the
application.

15 / 27
00:25:12 So the business partner is created successfully, we can now go to the S3 bucket
00:25:17 and then see whether the file is uploaded or not. Yeah, we can now see the file is uploaded
successfully.
00:25:24 Thank you. Now that you have seen the demo,
00:25:27 to learn more about AWS services and SAP Build Apps, you can follow these links.
00:25:34 In this unit, you have learned how to set up Amazon S3 and API Gateway, configuring API
Gateway
00:25:42 to expose Amazon S3 APIs and consuming them from SAP Build Apps.
00:25:47 In the next unit, you'll learn how to enhance your business process with SAP build process
automation.
00:25:53 Thank you.

16 / 27
Week 2 Unit 4

00:00:05 Welcome to week two, unit four of the openSAP course, Build Resilient Applications on SAP
BTP with AWS.
00:00:13 In this unit, you will look at enhancing your business processes with SAP Build Process
Automation.
00:00:19 I'm Mahesh Pallavalli, a senior developer at SAP Labs. In this unit, we will introduce
00:00:26 the SAP Build Process Automation. You will also learn to enhance
00:00:30 the business partner onboarding application that was built in the earlier units
00:00:35 using the SAP Build Process Automation workflow, along with the demo.
00:00:45 SAP Build Process Automation enables business users to automate processes and tasks
without writing code.
00:00:54 Everyone can automate and optimize processes with drag and drop functionality
00:00:59 and embedded AI capabilities. You can achieve extremely short project times
00:01:06 leveraging pre-built content and easily connect your automations
00:01:10 with SAP and non-SAP systems. And you can also foster collaboration
00:01:15 by enabling fusion teams of business users and developers to work together
00:01:21 and solve challenges better and faster. Users can create forms, manage decision logic
00:01:29 and build, adopt, and organize process flows with drag and drop simplicity.
00:01:35 They can automate repeated manual tasks such as copy and paste operations,
00:01:39 data extraction, data entry, data creation, using no-code and low-code capabilities,
00:01:45 or the built-in automation recorder, and the built-in AI capabilities
00:01:50 enable intelligent document processing like extracting data from structured
00:01:54 or unstructured documents to transfer it to your enterprise systems for processing
00:01:59 without needing data scientist support. Let's look at some of the capabilities
00:02:04 of the SAP Build Process Automation. With process builder, users can create
00:02:11 and manage processes and workflows with a no-code approach. It is a central component
for many projects.
00:02:19 Using simple drag and drop functionalities, users can create forms for requests and
approvals.
00:02:24 Users can access the forms editor, either from the lobby or, when needed,
00:02:30 while building a process flow from within the process builder.
00:02:34 Users can also create clean and easy-to-consume layouts
00:02:38 simply by dragging and dropping controls on the canvas. The embedded AI-based
document understanding capability
00:02:47 uses pre-trained machine learning models and easy template creation feature to extract
data
00:02:53 from structured and unstructured data sources, example, Excel, PDF.
00:03:00 Task automation, also known as Robotic Process Automation, can be tackled in multiple
ways.
00:03:07 Depending on the complexity of the automation, users can use either the no-code editor
00:03:13 or, when the automation requires the use of JavaScript, they can switch to the low-code
experience.
00:03:20 UI-based automations from both SAP and third-party applications can be created fast and
easily
00:03:26 using the built-in automation recorder. Decision management capabilities enable you
00:03:34 to codify corporate policies and business rules into repeatable processes.

17 / 27
00:03:41 The Business Rule Editor enables everyone to create spreadsheet-like decision tables
00:03:46 or text-based rules. To simplify access and improve operations
00:03:51 with a seamless user experience, you can use Unified Launchpad and Task Center.
00:03:56 Users can access and process all notifications and tasks from across different solutions via
Web or mobile access.
00:04:05 As you can see, SAP Build Process Automation has a lot of capabilities,
00:04:10 but in this unit we are using only two capabilities, one is a workflow and the other one is an
action.
00:04:18 Let's look at the architecture of the scenario that we are building.
00:04:22 In the earlier units, we have developed the business partner onboarding application using
SAP Build Apps.
00:04:30 When the business partner is initially created, it will be in the blocked status.
00:04:35 Now we'll extend the application with the SAP Build Process Automation
00:04:39 and provide an approval workflow to unblock it. Once this is approved
00:04:44 the business partner will be unblocked in the SAP S4HANA system.
00:04:49 Before developing this, you need to first subscribe to the SAP Build Process Automation
00:04:54 and create a service instance for it. Then you need to as assign the relevant roles
00:05:00 and you also have to create a destination for this service in the SAP BTP cockpit,
00:05:06 which you will use in the business partner onboarding application to call this workflow.
00:05:12 In the demo, we'll create an actions project to update the business partner.
00:05:16 Then we will create a business process project to integrate the action into the approval
workflow
00:05:21 to unblock the business partner. Let's get started with the demo now.
00:05:27 First, we need to create an actions project to read the business partner
00:05:32 and to update the business partner status to unblocked. For that, let's create an actions
project.
00:05:41 We need to upload the specification here. And for that we need to save our metadata to a
local folder,
00:05:50 and then we need to select it. And then click Next.
00:05:58 So here we need to provide a unique name let's call it as BusinessPartnerApproval API.
00:06:16 So here it will list out the different types of requests that can be possible with this metadata.

00:06:25 We only need to read the business partner and update the business partner to unblock it.
00:06:30 So we'll only select those two requests and then click Add.
00:06:34 First we'll update the description for the read get request to read business partner.
00:06:45 Click Save. And now let's update, the update description to
00:06:51 unblock business partner. Update.
00:07:00 And now whenever this unblocked business partner action is called, we need to pass both
business partner
00:07:08 and also the flag false to the IsUnblockedBusinessPartner field.
00:07:15 So in order to pass, avoid that, because this action itself says
00:07:20 that to unblock the business partner, we don't need to pass the flag again.
00:07:24 So further we can define that flag as static here. Let's search for that field,
BusinessPartnerIsBlocked,
00:07:32 and make it a static field, and pass the static value as false.
00:07:37 So whenever this action is called, it will automatically unblock that business partner.
00:07:48 So we have to release it. And we have to publish to library

18 / 27
00:08:03 so that it can be consumed from the build process automation projects.
00:08:09 Now let's go and create the workflow. Click Create, Build an Automated Process,
00:08:14 and Business Process. Give the name as BusinessPartner Approval Process.
00:08:34 This will take us to the Build Process Automation editor. Now call this Approval Process.
00:08:46 So this will create a workflow for us. So whenever this workflow is called,
00:08:52 we need to pass the business partner ID and the supporting document.
00:08:58 So for that we need to define the inputs. So as we have defined the inputs now,
00:09:19 the next step is to read the business partner. So we need to add an action to read the
business partner.
00:09:29 Select our action project, and select Read Business Partner.
00:09:41 And now we need to define the inputs to read the business partner,
00:09:44 which is a business partner ID. This will read the business partner
00:09:49 and give the output here. Here there is also one more mandatory parameter
00:09:56 called destination variable. So this destination variable connects our workflow
00:10:02 to the destination in the subaccount. Now this destination variable can also be reused in
multiple actions.
00:10:12 Now let's go to the destination in the SAP Build lobby. Go to the Settings, go to the
Destinations,
00:10:19 and then add our destination BusinessPartner-Updation-Mock.
00:10:24 So here we are just importing the destination to the SAP Build. When we deploy our
business partner workflow,
00:10:33 then at the time we need to connect our destination variable, that we define over here
00:10:40 to the destination we imported in the SAP Build. We need to create the approval form now.
00:11:13 Click on New Approval Form. And define some subject as Business Partner Approval.
00:11:31 We also have to pass the users. Ideally, we will select the groups or users by using
decision.
00:11:43 Now for the testing purpose I'm going to add my e-mail ID here.
00:11:55 Now we need to go to the editor to define the form. So first, let's add a heading
00:12:02 and call it Business Partner Approval. And we'll also add three more fields
00:12:09 to show the business partner ID, first name, and last name.
00:12:32 We also have to make them read only, as it's only going to show the business partner
00:12:38 that it is getting from the API. We also have to add the supporting document,
00:12:50 in the form of a link. Now click Save.
00:13:02 And here you need to select the inputs. So the business partner, first name, and last name

00:13:10 are coming from our Read Business Partner Action. So now we'll go and select the details.

00:13:31 We also have to select the supporting document link, which is coming from the input.
00:13:42 As you can see, it is still showing. This is because our reject is not going to click to the end,

00:13:47 so just drag and drop to the end. Once the approval form is approved by the user,
00:13:55 it has to unblock the business partner, so click on Add, and select the unblock action.
00:14:11 Here we'll select the same destination variable, under inputs we'll pass the business partner
ID.
00:14:21 And now our workflow is completed. But in order for it to be consumed
00:14:25 from the SAP Build Apps project, which is the business partner onboarding app
00:14:30 that we have developed in the earlier units, we need to create an API trigger.

19 / 27
00:14:46 I click Save, and Release.
00:14:55 Now we have to deploy this project. And as you can see here, the destination variable,
00:15:04 it's asking to select the destination, which we have added in the destinations in SAP Build
settings.
00:15:10 So select the destination, click Next, and click Deploy.
00:15:17 As we have now created the business partner onboarding workflow,
00:15:23 we need to consume it from the SAP Build Apps project.
00:15:28 So now in order to consume this, we need to know the payload.
00:15:33 So we will go to the Monitor tab and select the Triggers.
00:15:38 As I have mentioned earlier, we created the API trigger to consume it
00:15:43 from the external parties. So as you can see, it provides us a URL
00:15:49 and the payload. So now let's save this payload to a local file.
00:16:09 And now go back to our SAP Build Apps project, go to Data tab, and click on Create Data
Entity
00:16:20 and select SAP BTP Destination REST API Integration. Here we give the name as Business
Partner Workflow.
00:16:32 So as you can see, our payload has definition ID, context, business partner, and supporting
document.
00:16:40 So we need to add them one by one. Now we have added this, then now go to the Create,
00:17:22 we need to enable it, and we also have to define the request headers. So the request
header is where
00:17:32 the data we are trying to send is in the form of JSON,
00:17:35 so we need to add the content type as application JSON. Click Save, and now we also have
to define the body mapper,
00:17:52 because we need to encode it in the JSON format. So once this is done,
00:18:14 you need to connect it to a destination. So this destination is the sap-build-pa destination
00:18:21 that is available in the cockpit. As you can see, this is created
00:18:26 from the SAP Build Process Automation instance. And we also need to enable here,
00:18:32 AppgyverEnable as true. So then only this will be visible
00:18:37 in our SAP Build project. So now click on Save Data Entity,
00:18:42 and go back to our UI Canvas, click on Create,
00:18:48 go to add logic. After the files are uploaded,
00:18:53 we are now going to call our workflow. So we need to call create record,
00:18:58 place it over here. So connect create record.
00:19:11 And here you need to select the resource name as Business Partner Workflow. And we also
need to map the data.
00:19:19 The definition ID, we will hard code it. This is a definition ID,
00:19:25 we got it from the payload. And business partner,
00:19:33 will be the data variable. And supporting document
00:19:44 is from the page variable. Click Save, and now Launch.
00:19:55 Open Preview Portal. Open Web Preview,
00:20:08 Business Partner Onboarding. Let's call it as BPINT01.
00:20:19 Test First Name. Test Last Name.
00:20:25 Select the supporting document, and click Create.
00:20:33 Now let's go back to our SAP Build lobby and open our inbox.
00:20:44 Now as you can see, we called the business partner for the approval.

20 / 27
00:20:51 And now once you approve, the business partner is approved successfully.
00:20:57 Now that we have successfully completed the demo, to learn more about the SAP Build
Process Automation,
00:21:04 you can follow these links. This concludes our unit on enhancing
00:21:10 the business processes with SAP Build Process Automation. So far, you have learned about

00:21:16 what SAP Build Process Automation is and its capabilities.


00:21:21 Then you enhance the business partner onboarding application
00:21:25 with SAP Build Process Automation. In the next unit, you will learn
00:21:29 how to integrate SAP Build Process Automation with AWS services.
00:21:34 Thank you.

21 / 27
Week 2 Unit 5

00:00:05 Hello and welcome to week two, unit five of our openSAP course,
00:00:09 Build Resilient Applications on SAP BTP with Amazon Web Services.
00:00:14 My name is Diego Lombardini and I'm an SAP partner solutions architect with AWS.
00:00:19 In this unit, you will learn how to integrate business processes with AWS services.
00:00:24 Let's get started. The agenda for today, we're going to cover an introduction
00:00:31 to Amazon Simple Notification Service, or SNS. We're going to go through the scenario that
we're going to build
00:00:37 and I'm going to provide a demo. And lastly, because this is the last unit of the week,
00:00:42 we're going to wrap up with a summary and an outlook for the coming week.
00:00:48 So, what is Amazon Simple Notification Service? It's a fully managed pub/sub
00:00:53 messaging and notification service. It supports application-to-application
00:00:57 and application-to-person notifications. This means email, SMS, and push notifications.
00:01:05 It supports a large volume of messages and is highly reliable.
00:01:09 It utilizes the concept of topics and subscriptions. Applications and individuals subscribed to
topics,
00:01:16 and when a message is sent to this topic, it's then distributed to the subscribers.
00:01:21 So, you get your emails and your SMS and push notifications.
00:01:27 So, the scenario we're going to cover today, we're going to start with what we built last unit,

00:01:32 and we're going to add an email notification utilizing SNS via an API
00:01:36 that we build in Amazon API Gateway. To be able to do that,
00:01:41 we're going to need to create an SNS topic in AWS. We're going to then expose that topic
using an API.
00:01:48 We're going to need to create an IAM role and policy to have access to this API and the
topic.
00:01:54 We're then going to integrate this API with BTP using a destination.
00:01:59 And lastly, we're going to create an action in the process that we built last unit,
00:02:03 so we can integrate and send a message. All right, we're now going to go through the demo

00:02:12 for this week's exercise. So we're first going to start creating an SNS topic.
00:02:19 So, as you saw, we can access it through the console in the search bar, or through the
favorites.
00:02:28 So, we're going to create a topic, and I'm going to call it build-automation-notification.
00:02:40 Here, we can define the topic to be either first-in, first-out, or standard.
00:02:44 In this case, we're going to keep it standard. Name, display name.
00:02:51 I'm going to call it Process Automation Notification. There's a few settings in here
00:03:00 where we can actually define some parameters. In this case, we're going to keep it all
default.
00:03:10 And we have now defined our SNS topic.
00:03:18 Now, the next step is to create a subscription. This is where we effectively
00:03:23 will be able to add an email address, so we can receive the notifications.
00:03:34 So, in this case, I'm going to create a subscription. And here, we have the different types
00:03:38 of integrations that we can enable. In this case, I'm going to do email.
00:03:43 But you can see here SMS, SQS, and a few others. So, I'm going to do email.

22 / 27
00:03:49 In this case, I'm going to put my email address. So, what's going to happen -
00:03:57 once I create the subscription, as you can see here, I will need to confirm it.
00:04:02 So, when you do this exercise and you put your email address,
00:04:04 you're going to receive an email. And what you have to do is you have to go click and
confirm that.
00:04:08 I'm not going to go through that because you can do that in your own time.
00:04:12 So, I'm going to create the subscription now. All right.
00:04:20 So, now, we basically created a subscription to this topic. So, what's going to happen
00:04:27 is when we send a notification to this topic via API, I'm going to receive an email with that.
00:04:39 Okay, so now we first need to create an IAM role and policy, like we did in unit 2.3, to be
able to then create the API.
00:04:49 So, we're going to go to IAM and we're going to create a role.
00:05:01 I actually need to also get the name or the ARN, which is the AWS resource name for the
topic we just created.
00:05:13 So, I'm going to open that in a new tab, so we can access that. So, let's first create the role.

00:05:21 So, let's call this build-process-role-sns.


00:05:29 As with the previous one, it's a custom trust policy. And this is similar to the role we've
created before
00:05:41 where we allow to assume the role they are API Gateway.
00:05:46 So, I'm creating a new role, but you could use a previous role,
00:05:49 and you could also add that policy in there. Of course, you need to change the policy.
00:05:56 Okay, so let's do as we did before, we create a policy now. And this is what we're going to
need,
00:06:07 the resource ARN. So, I'm going to paste this here,
00:06:14 and then I'm going to go to SNS. So, this is what I was talking about before.
00:06:23 When we created the role on the S3 bucket, we just needed the S3 bucket name.
00:06:27 But in this case, we need ARN. So, I'm going to copy this,
00:06:32 and I'm going to go back to the policy, and I'm going to add this.
00:06:38 So, what does this mean? So, effectively we are saying
00:06:41 that we are allowing this policy, which then is attached to the role,
00:06:46 to publish a message to this topic. So, when we call the API,
00:06:52 it's going to use this policy attached to the role to authenticate and to allow you to do this.
00:07:04 And we are going to call this build-process-policy-sns. Same as before, it's interpreting the
JSON
00:07:15 and it's actually telling me what I'm allowed to do or not here.
00:07:24 Okay. So, now, we have the policy. If we go back, oops, to the role,
00:07:33 we can now see the policy we just created. So now we're creating the role.
00:07:40 That's not the right one, this is the right one. Click Next.
00:07:46 And now, we give the role name. Okay, so again, we're allowing this role
00:07:57 to be using apigateway and assuming this role. All right, so now we have the SNS topic,
00:08:13 I subscribed to that topic, and we have the role and the policy to access it.
00:08:20 So, now, we're going to go to API Gateway and we're going to create the API.
00:08:30 So, this is the API we created in the previous unit. I'm going to create a new one,
00:08:34 and as before, it's going to be a REST API. In this case, I'm going to call it
00:08:44 build-process-api. REST API and New API.

23 / 27
00:08:53 And we're going to keep it to be original. And now, we're creating the API...
00:09:26 So now we're going to create a resource. We're going to call it sendnotification,
00:09:37 and then we are going to create a method. In this case, we're going to use POST.
00:09:47 And now, we're going to select a region. The region in my case is us-east-1.
00:09:52 The service, which is SNS. We're going to leave subdomain blank,
00:09:59 and we're going to map this to, of course, the POST method. And in this case,
00:10:03 the action that we're going to use is Publish. Now if you've done unit 2.3,
00:10:08 you'll see that this is slightly different. And now, we have to include here the IAM role
00:10:17 that we've created before. So, I'm going to need to go copy that ARN now.
00:10:27 So, we go into Roles, search for build-process-role-sns.
00:10:32 And here's the ARN that we need. So again, as before, this allows this API
00:10:42 to use this role to call the AWS services. Okay, so now, we've got the POST method.
00:10:51 And now, we need to, first of all, update your method request.
00:10:58 So, what we're going to do here is, in this case, we're not using the query string URL as we
used before,
00:11:03 we're going to use request headers. So the data's not visible on the call.
00:11:10 So, the first thing we're going to do is we're going to create three headers.
00:11:15 One is the message, which is effectively the message we're going to be sending.
00:11:21 The next one is the subject. So, this will be a subject for the email.
00:11:29 And the last one, it's the topic. So, this is what we're going to be mapping
00:11:33 from process automation and the SNS topic that we created earlier.
00:11:41 Now, we're going to go to Integration Request. As before, we now need to map these
parameters
00:11:47 that we've defined to the SNS parameters. So, in this case, we're using URL query string
parameters.
00:12:04 So, the first one is the message. I'm going to map this to method.request.header.message.

00:12:20 Notice this is different to what we had before in unit 2.3. Then, we're going to add the
subject.
00:12:34 And lastly, the topic. Now, last step, or second last step, is to enable API key.
00:13:02 So, we will set the API key to True, and then we're going to deploy this API.
00:13:15 As before, stages can be used to manage versions or environments.
00:13:19 In this case, we're going to assume we're creating in version one. So this is version one.
00:13:30 We are going to deploy the API. We're going to save the changes,
00:13:34 leaving all the default settings. And now, the last thing we're going to do
00:13:41 is we're going to add this stage for this API to a usage plan. We could create a new usage
plan,
00:13:49 but for simplicity, we're going to reuse the one we created in unit 2.3.
00:13:54 So, if I go to Usage Plans, I can add an API stage,
00:14:02 and we're going to add this API, version one. So, if you look at the keys here,
00:14:11 it's the same key that we had before. Now, I'm going to hand over to Mahesh,
00:14:16 who will integrate this API with SAP Build Process Automation.
00:14:24 We will now integrate the SNS API into our business partner approval process workflow.
00:14:30 For this, first, we have to create an action project. And the mandatory step for the actions
project
00:14:36 is to upload the API specification document. So, we will get the API specification for the
SNS API here.

24 / 27
00:14:46 In the stages, go to Stages and go to Export. Select OpenAPI 3 and click Export,
00:14:52 and download it to your local system. Then, proceed with the creation of the actions project

00:14:59 and upload the specification that you downloaded and give a name, SNS Business Partner
API.
00:15:13 Now, it will take us to the action later. Here you need to select that particular action.
00:15:20 We have to pass the topic. We will make it as static
00:15:25 and we pass a topic that was created earlier. And we'll also pass the subject
00:15:32 as Business Partner is Successfully Unblocked. And click Save.
00:15:52 So, now, we need to release and publish it to library. In order for the action project to
connect
00:16:13 and send the notification, we will use a subaccount destination.
00:16:19 So, I already have created the subaccount destination. And I'm also passing the x-api-key
00:16:26 and other parameters in order to be consumed from the SAP process automation and from
the action product.
00:16:32 And this has to be imported in our destinations. In the SAP Build,
00:16:38 select that destination from the cockpit and click Add. So, now, this is added in our SAP
Build.
00:16:48 And now, go back to our approval process. So here, after the business partner is unblocked,

00:17:08 we are going to send a notification. Now, go on and add our action.
00:17:19 Click Add. And we need to provide the input,
00:17:29 the message we will pass, our business partner. And we also have to provide the
destination
00:17:38 which connects our approval process to the cockpit destination.
00:17:44 So first, we need to create a local variable. Let's call it our SNSDestination.
00:17:56 And that's it. Now, once we save and release it,
00:17:59 it will ask us to map this destination with the destination SAP Build.
00:18:10 And deploy. So, as I have mentioned, it asks us to select the destinations.
00:18:21 And deploy. And our workflow is now successfully deployed.
00:18:28 Let's go test it. Let's give it as BPINT03.
00:18:38 First Name Test. Last Name Test.
00:18:43 And select the supporting document, and Create. Now, we can visit our inbox
00:18:56 to see the notification. This is just a workflow that was triggered.
00:19:02 And once you approve it, now this will trigger the SNS notification
00:19:07 to the mailbox. Now, as you can see, I have received this mail
00:19:18 with the details. Now that we have seen the demo,
00:19:21 to learn more about the AWS services and SAP Build services that we have used in this
demo, you can follow these links.
00:19:31 All right. So, in this unit, you learned
00:19:34 to set up the Amazon SNS service, and then integrated it
00:19:37 with the SAP Build Process Automation. This concludes week two,
00:19:43 building apps with SAP low-code/no-code tools and AWS services. So far in this week, we
have learned
00:19:51 about SAP Build Apps and SAP Build Process Automation. We also have introduced the
AWS services,
00:19:58 such as S3, API Gateway, and SNS. We develop the business partner onboarding
application

25 / 27
00:20:05 using all these services. In the coming week, you will learn about
00:20:11 pro-code development options on SAP BTP and develop a simple SAP CAP application
00:20:17 and integrate it with SAP S/4HANA and AWS services. Thank you.

26 / 27
© 2023 SAP SE or an SAP affiliate company. All rights reserved.
See Legal Notice on www.sap.com/legal-notice for use terms,
disclaimers, disclosures, or restrictions related to SAP Materials
for general audiences.

You might also like