Programming with ABAP on SAP Cloud Platform

The entire concept of the Cloud and how it fits into the old on-premise-based approach of software infrastructure might still be confusing to some. The bad news is, this seems to be the direction the IT world is heading in. The good news is, there are tones of material out there to help you catch that Cloud train.

SAP Cloud Platform (SCP) is a name you have probably been hearing a lot in the recent years and this writeup is based on the assumption that you already posses some general knowledge in this area. If you do not, don’t worry! I will try to structure this post in a way that’s easy to understand. Let’s roll!

What is so special about the Cloud?

  • Affordable

  • Quicker to deploy

  • Scalable

  • More maintainable

  • Simpler integration

These are just some of the advantages common among various cloud solutions. We will not go into too much detail on them. Instead, let’s focus on the last one on the list – “Simpler Integration”

Why program in the cloud?

You might be wondering, why is this needed at all? What is a realistic use case for writing ABAP in the cloud and what can I actually achieve with it? The simple answer is – almost everything.

Java and Node.js are 2 environments that have, for a long time been available for use on SCP. Quite recently, they have been joined by ABAP on top of the SAP HANA database infrastructure. In simple terms, you can now have a HANA DB along with ABAP-based logic in a single box – the SAP Cloud Platform. What used to only be available as part of a SAP licence can now be subscribed to using flexible PaaS packages.

Here are some questions that might already be popping up in your mind:

  • Should I copy the custom ABAP code from my on-premise system to the cloud environment? – No! Firstly, ABAP in the cloud is different and a 1-to-1 copy would not be possible. Secondly, any data access that you might have programmed which relates to your on-premise DB will not work after moving it to the cloud, this is a totally separate environment, remember?  
  • Is the mentioned HANA DB in the cloud just a copy of my on-premise HANA DB? – No! It is a separated environment and there’s no common structure or data between them
  • Can I log into the ABAP instance using SAP GUI? Unfortunately, you cannot. ABAP in the cloud only allows Eclipse as the access and development tool
Illustration showing interconnected devices

Programming with ABAP in the Cloud – Use Case

The high level idea might already be known to you at this stage. However, you might still be questioning the need for such an environment in the cloud. Hence, I decided to create a use case that we’ll follow throughout these tutorial series. Here it is.

Background

Your company uses an external service to get information on some relevant topics. The information is structured in form of posts. Unfortunately, they do not contain any quality indicators. There is an employee in your company (Mark), whose task is to read the posts one by one and grade them from 1 to 5 depending on how much value he thinks they bring into your researched topic. You need to build an interface which fetches the blog posts, gives Mark the option to grade them and gives other employees the option to view the graded posts.

App Setup

  • The blog posts come from a public REST API : https://jsonplaceholder.typicode.com/posts
  • Our app should be able to fetch the posts from the external API
  • It should include a database which stores the ID of the post and the grade it has received.
  • The frontend should include 2 views – Grader View (for Mark) and the default – Researcher view
  • The 2 views should be decided at runtime, depending on the assigned role and they should be built using Fiori
  • The app should have the option to search and sort in both views

Services to be used

We will consume various services that are part of the SAP Cloud Platform:

  • ABAP Cloud
  • HANA
  • Authorization & Trust Management
  • WebIDE
  • Destination

Side note: I want to keep this tutorial as flexible as possible. It isn’t staged, it hasn’t been practiced a 100 times before writing and therefore, things can go wrong and will most likely be changed as we go on. At the same time, I will try to make it more enjoyable and challenging than the usual “to do” tutorials on the web.

What’s next?

Before the next tutorial, make sure you have

Thanks and see you next time!

Mateusz

P.S. Don’t forget to subscribe, not to miss the next tutorial series!

OUR MINDS RUN ON

SAP SOFTWARE.