Wednesday, 27 January 2021

ABAP RAP Covid-19 List Report

Introduction

In this blog post, I am going to show you how to create the Covid-19 app using Abap restful application programming model. I guess many of us have hard times due to the coronavirus but every cloud has a silver lining. I’m sure that we will come across better days soon after the vaccination process. There has been a remarkable increase in the number of people who are affected by the virus and increasing every minute. According to social science theory “sixth degrees of separation” we all have connected each other at most six steps. I can reach the president of any country within six steps, I know the guy who knows the guy. That means we are all connected and we can spread the virus easily.  The purpose of this block is to raise awareness and show how to use RAP for external data.

SAP ABAP Development, ABAP RESTful Programming Model, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Preparation
Figure1: List Report Page

Data Sources


First of all, I used open disease data from the website which provides data from WorldoMeter and Johns Hopkins University. When I tried to collect data from different sources I ran into some problems, for example, one data source give abbreviation of some countries but other provide the full name of countries(United Kingdom or UK), service haven’t provided country code and province names have begun with lower case for one service but it was the upper case for another. I created database tables and data generation class, playing with data for normalization, and saved them to the database to follow RAP principle after that I have created interface views, projection views, metadata extensions, etc.

SAP ABAP Development, ABAP RESTful Programming Model, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Preparation
Figure2: Data Provider Class

I saved all package to GitHub, if you would like to inspect codes click here. I didn’t use all database tables but at the begging of this little project I was planning to create List Report Page (LRP), Overview Page, and Analytical List Page, but I only give you (LRP). Maybe other types of pages can be issues of another blog. You can see country details and province data if countries have provinces and give province details. Also, you can see the last 30 days’ details to observe changes in object view details.

SAP ABAP Development, ABAP RESTful Programming Model, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Preparation
Figure3: Object View Detail-1

SAP ABAP Development, ABAP RESTful Programming Model, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Preparation
Figure4: Object View Detail-2

Source: sap.com

No comments:

Post a Comment