This is a sample app for the travel reference scenario, built with the SAP Cloud Application Programming Model (CAP) and SAP Fiori Elements.
The purpose of this sample app is to:
- Demonstrate SAP Fiori annotations
- Demonstrate and compare SAP Fiori features on various stacks (CAP Node.js, CAP Java SDK, ABAP)
- Run UI test suites on various stacks
Currently the app is only available for the CAP Node.js stack. A version for CAP Java SDK will follow soon.
The app still contains some workarounds that are going to be addressed over time. In some cases, the model and the handlers can be improved or simplified once further planned CAP features become available. In other cases, the app itself could be improved. For example, calculation of the total price for a travel currently simply sums up the single prices ignoring the currencies.
- In a console, execute
npm ci
in the root folder of your project. - In a console, execute
cds watch
in the root folder of your project.
Open this link in your browser: http://localhost:4004/travel_processor/webapp/index.html
To start OPA tests, open this link in your browser: http://localhost:4004/travel_processor/webapp/test/integration/Opa.qunit.html
Test documentation is available at: https://ui5.sap.com/#/api/sap.fe.test
- In a console, execute
npm ci
in the root folder of your project. - In a console, execute
mvn spring-boot:run
in the root folder of your project. - In another console, execute
npm start
in folderapp\travel_processor
of your project (this starts the middleware)
Note: If you access the CAP Java server directly without middleware, you will have to enter mock user credentials admin / admin which are maintained in file application.yml.
Open this link in your browser: http://localhost:8080/index.html
To start OPA tests, open this link in your browser: http://localhost:8080/test/integration/Opa.qunit.html
Test documentation is available at: https://ui5.sap.com/#/api/sap.fe.test
The project contains a configuration for deploying the CAP services (with Node.js backend) and the SAP Fiori app to the SAP Business Technology Platform (SAP BTP) using a managed application router. The app then becomes visible in the content manager of the SAP Launchpad service.
- Create a trial account on SAP BTP. See this tutorial for more information. Alternatively, you can use a sub-account in a productive environment.
- Subscribe to the SAP Launchpad Service.
- Create an SAP HANA Cloud Service instance or use an existing one.
-
Install the Cloud Foundry command line interface (CLI). See this tutorial for more details.
-
Install the MultiApps CF CLI Plugin:
cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org cf install-plugin multiapps
-
Install the Cloud MTA Build Tool globally:
npm install -g mbt
Build the project from the command line:
mbt build
The build results will be stored in the directory mta_archives
.
- Log in to the target space.
- Deploy the MTA archive using the CF CLI:
cf deploy mta_archives/capire.sflight_1.0.0.mtar
In the SAP BTP Cockpit, assign the role collection admin-{spacename}
to your user.
You need to have access to a HANA Cloud instance and SAP BTP.
- Deploy the HDI content to a HANA HDI container (which is newly created on first call):
cds deploy --to hana
. - Start the application with the Spring Profile
cloud
.- From Maven:
mvn spring-boot:run -Dspring-boot.run.profiles=cloud
- From your IDE with the JVM argument
-Dspring.profiles.active=cloud
or env variablespring.profiles.active=cloud
- From Maven:
The running application is now connected to its own HDI container/schema. Please keep in mind that the credentials for that HDI container are stored locally on your filesystem (default-env.json).
If you want to implement an SAP Fiori app, follow these tutorials:
- Create a List Report Object Page App with SAP Fiori Tools
- Developing SAP Fiori applications with SAP Fiori Tools
In case you've a question, find a bug, or otherwise need support, use the SAP Community to get more visibility.
Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.