Integrating SAP AppGyver with SAP Commissions - PA...
Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
The SAP's AppGyver is a low code platform which allows you to build apps with limited to no coding. For more information on SAP's AppGyver please refer to the below links:
In this blog I'll be showing you how you can build a simple app using SAP's AppGyver to fetch commission information from SAP's Commissions using REST APIs.
if __name__ == '__main__':
if cf_port is None:
app.run(host='0.0.0.0', port=5000, debug=True)
else:
app.run(host='0.0.0.0', port=int(cf_port), debug=True)
Please note that you have to provide your SAP commission tenant's url and credentials(basic auth with rest api user) in the App.py file before pushing this app to SAP BTP.
In order to deploy this app to SAP BTP you will need 4 other files along with the App.py file.
Procfile
manifest.yaml
requirements.txt
runtime.txt
All of these files will have to be saved in the same directory as the App.py file.
Go to the directory/folder where you have saved the above files using your command line or code editor(like VS Code) and login to your CF using your email id and password using the below command
cf login
Push the app to SAP BTP using the below command
cf push testAppgyver
Once successfully hosted, you can login to your SAP BTP cockpit and check if the app is up and running.
Once the app is deployed successfully you should get an Application route url, copy this. We will be using this when we create our app in SAP's AppGyver.
Create app in SAP AppGyver
Create a new app and add the required UI components as shown in the below video.
Next let us add the Data Resource for this App. We will be using the REST API Data Resource. Follow the steps provided in the below video to set up the data resource.
Please note the following before watching the video
The Resource URL will be the Application route URL that was generated when you deployed the app in SAP's Business Technology Platform.
Setup the BASE, GET RECORD (GET) as shown in video
Make sure you have a valid position name and a period name handy which has a payment value from your commission tenant. You will need this to set the schema response
Next step is to setup the variables. The below video will show you how you need to setup the App and the Data Variables. For this you will need to switch the view to variables.
Now that we have our data resources and variables setup it is time to add functionalities to each of the components in our UI and your app should be ready. The formula to be used for Paragraph 1 in Container 2 has been shared below for your reference.
You can add some images and makes changes to the styling of your UI to make it a little more appealing. You can now access the app using your mobile. For this you will have to download the app from AppStore or PlayStore depending on whether you use and Android or iPhone.
Login using your credentials or use the Scan QR Code option in the Launch section shown below
This is how my final app looks like after adding some styling and images.
Conclusion:
We were able to successfully build a simple app using SAP's Appgyver which can fetch the payment information from SAP's Commissions. The data processing and data exchange between SAP's Appgyver and SAP's Commissions was achieved using a python-flask app which was hosted on SAP's Business Technology Platform.
Coming soon....
In this part we have hard coded a position and period name into the App Variable list we have created. In PART-2, I will show you how we can get more than one position and period name from SAP Commissions and have them all available in the dropdown list.
Please drop in your comments, questions if any and also share your feedback.