This article is mainly intended for Google Cloud Platform (GCP) Admins who can develop the applications locally in your cloud shell environment and deploy it to SAP Business Technology Platform (BTP) using SAP Commissions API’s to build custom dashboards ..

High Level Architecture flow

Pre-requisites

  1. Google Cloud Platform – Cloud Shell Environment
  2. SAP Business Technology Platform – Cloud Foundry Runtime
  3. SAP Commissions API – Payments Endpoint
  4. Python or any language you prefer
  5. Libraries used in this article to develop Dashboard ( HTML, Plotly – Dash)

Step 1 : Develop locally in Google Cloud Platform

  1. Sign into your Google account.
  2. In the top navigation, click Activate Cloud Shell

Select your project or create one if you don’t already have one.

Cloud Shell Editor is Cloud Shell’s built-in, browser-based code editor, powered by the Eclipse Theia IDE platform. To open it, click the Open Editor button from your Cloud Shell terminal:

You should be seeing below screen for connecting to Editor

Cloud Shell Editor has rich language support and debuggers for Go, Java, .Net, Python, NodeJS and more languages, integrated source control, local emulators for Kubernetes, and more features. With the Cloud Shell Editor open, you can then walk through a client library tutorial like Cloud Vision’s Detect labels guide, running terminal commands and code from one browser tab.

Open up a Google Cloud quick start and give it a try! This could be a game-changer for your learning experience.

Create below directories for development and this is just preparing for SAP Commissions Payments Dashboard and you can create your own ..

mkdir Payments-Dashboard
cd Payments-Dashboard

touch app.py
touch index.py
mkdir assets
mkdir apps
mkdir datasets

After you completed your development, you can run the below command to see the dashboard is exposed to local web server to test

python3 index.py

you should be seeing SAP Commissions Payment dashboard running locally in GCP

you can select Processing Unit 1 and Select Payees from dropdown list

you can select Processing Unit 2 and Select Payees from dropdown list

After you selected one of Payee from dropdown list, you can see their Bonus & Clawback information

Step 2 – Deploy now Globally in SAP BTP

Login to SAP BTP .. API Endpoint and Cloud Foundry Entitlements should already be pre-configured from your side.

Install Cloud Foundry CF v7 or v8 in GCP Cloud Shell


wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list

sudo apt-get update
sudo apt-get install cf7-cli

After Installing CF.. try this below command for getting ready to deploy BTP

cf -v  ### Cloud Foundry version

cf login  ### Cloud Foundry Login

cf -a <api endpoint>  ##Cloud Foundry API Endpoint 

cf login --sso      ## Cloud Foundry Login through One time Passcode

After successful login with Pass-code, you should be able to see your Sub-account and Org details

For deployment, create this files in your local directory

touch requirements.txt
touch Procfile
touch runtime.txt
touch manifest.yml

manifest.yml

  
---
applications:
  - name: payments-dashboard
    memory: 128MB
    disk_quota: 1GB
    random-route: true
    buildpacks: ["python_buildpack"]
cf push

Pushing app to SAP BTP..

App is successfully pushed to BTP with Portal Link for accessing the Dashboard

            Running setup.py install for pathlib: started
              Running setup.py install for pathlib: finished with status 'done'
          Successfully installed Flask-2.1.1 Flask-Caching-1.10.1 Jinja2-3.1.1 MarkupSafe-2.1.1 Werkzeug-2.1.1 brotli-1.0.9 click-8.1.2 dash-2.3.1 dash-core-components-2.0.0 dash-extensions-0.0.71 dash-html-components-2.0.0 dash-table-5.0.0 editorconfig-0.12.3 flask-compress-1.11 importlib-metadata-4.11.3 itsdangerous-2.1.2 jsbeautifier-1.14.3 more-itertools-8.12.0 numpy-1.22.3 pandas-1.4.2 pathlib-1.0.1 plotly-5.7.0 python-dateutil-2.8.2 pytz-2022.1 six-1.16.0 tenacity-8.0.1 zipp-3.8.0
   Exit status 0
   Uploading droplet, build artifacts cache...
   Uploading droplet...
   Uploading build artifacts cache...
   Uploaded build artifacts cache (66.8M)
   Uploaded droplet (131.9M)
   Uploading complete
   Cell c2098343-8d23-46ae-9e87-7d29bf794c68 stopping instance 4e49eb21-24ba-44ff-aa34-94362f49bb19
   Cell c2098343-8d23-46ae-9e87-7d29bf794c68 destroying container for instance 4e49eb21-24ba-44ff-aa34-94362f49bb19
   Cell c2098343-8d23-46ae-9e87-7d29bf794c68 successfully destroyed container for instance 4e49eb21-24ba-44ff-aa34-94362f49bb19

Waiting for app payments-dashboard to start...

Instances starting...
Instances starting...
Instances starting...
Instances starting...
Instances starting...

name:                payments-dashboard
requested state:     started
isolation segment:   trial
routes:              payments-dashboard.cfapps.us10.hana.ondemand.com
last uploaded:       Wed 13 Apr 13:43:12 CEST 2022
stack:               cflinuxfs3
buildpacks:
isolation segment:   trial
        name               version   detect output   buildpack name
        python_buildpack   1.7.48    python          python

type:            web
sidecars:
instances:       1/1
memory usage:    128M
start command:   python index.py
     state     since                  cpu    memory   disk     details
#0   running   2022-04-13T11:43:34Z   0.0%   0 of 0   0 of 0

Application is now available in BTP with instance running and as you can see python buildpack

Finally, the portal is available globally and Admins can access the dashboard at anytime and anyplace to see how Salesreps doing their business.


 References

News, updates, and best practices for running SAP environments on Google Cloud.

Getting Started with Google Cloud Platform – by the SAP HANA Academy

SAP BTP –  perfect match for SAP + Google Cloud customers

 

 

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x