Application Programming Model for SAP Cloud Platform in Action!
I recently had the pleasure of attending Hack2Sol, or Hack to Solution, at the SAP AppHaus in Heidelberg, Germany. For those of you not familiar with the concept, Hack2Sol is a competition-style event, where customers bring their own use case and have 5 days to develop a working prototype using SAP Cloud Platform and SAP Cloud Platform services. To help them achieve this goal, customers receive needed trainings and get support from SMEs while they play around with the platform. Why did I say it was a competition-style event? Because at the end of the week, each team has to present their working prototype and a panel of SAP judges chooses a winner. Even though, as they say, all teams are winners.
Now you might be wondering, which role I had in this event. Was I an expert? No. Was I a judge? No. I was part of the SAP team that participates in the event alongside our customers. We had to come up with our own use case and try to bring together and integrate different SAP Cloud Platform products and services to create a solution that could potentially be implemented in the real world. In this case, our goal was to create an application that used the application programming model for SAP Cloud Platform to define the data and service model, add the UI using SAP Web IDE, and incorporate IoT Services and IoT Application Enablement to connect the actual hardware.
Our Use Case
We created a fictitious Logistics and Distribution company, called PackMasters Transport Services, that specialized in the distribution of pharmaceutical goods. Their specific requirement was that they needed to be able to monitor the temperature of the packages during transport. Why? Because if temperature thresholds are not complied with, the content might no longer be viable. This leads to unsatisfied customers and revenue losses. Two things no company can afford to have.
Every app needs a user. In our case, Daniel, a Logistics & Distribution Manager at PackMasters Transport Services was our target. He was responsible for making sure the goods arrived on time, at the required location and in the proper condition. He was also responsible for handling angry customers that complained about packages arriving with non-viable medical material. Daniel was not a happy camper.
Enter Pack&Track – a solution that lets you monitor the temperature of your packages during transport. If the configured temperature threshold is not met, an alert is generated and displayed in the UI. Right now, as you can see, there are no alerts, so I am sure Daniel is pretty happy:
You can act on alerts by sending messages to the driver or the customer, enabling you to proactively take action before packages arrive at their destination.
You can review shipment details and have an overview of the all the packages contained in the shipment. This view also displays alerts if they exist.
A reporting feature lets you download a list of all packages associated to a shipment that includes a detailed history of temperature measurements tracked during transport. Therefore confirming that quality requirements were complied with.
Technical Perspective – Using the Application Programming Model
Below you can see a simple representation of what we were trying to do. We leveraged Internet of Things services and IoT Application Enablement to connect the hardware. Remember, we needed to measure the temperature real-time with the sensors. As described here, the business application is comprised of 3 layers: data model, service model and UI
We defined the data and service model using Core Data & Services (CDS) and the principles of the application programming model. Our data model included the entities we needed to make Pack&Track work. For example, the Packets entity (which represented the packages) has a managed to-one association to DeliveryOrders (the shipments), because each package belongs to one shipment. The Alerts entity has a managed to-one association to Packets because we assumed that each package could have only 1 alert. For more information about which types of associations are supported by CDS, see Associations.
After defining the entities in our data model, we needed to create a service to expose those entities to the UI. Take a look at how we were able to do this in our simple service model:
With this service model, we were able to create a consumable OData service that we later connected to our UI.
For more service model examples, check out:
- Blog: ITelO – A Sample Business Application for the new Application Programming Model for SAP Cloud Platform
- Tutorial: Create a Business Service Using CDS
Want to find out more about the application programming model? These links are for you: