Previously, we saw how to create a RAP Business Object and expose it via OData on BTP ABAP Environment, generating all the necessary objects automatically.

Now we’re going to generate a Fiori application via the Fiori Element Framework and deploy it on our Cloud Foundry environment on BTP. This application will use the OData previously generated on our BTP, ABAP Environment.

Note that the user running the Fiori application must have the necessary rights on BTP, ABAP Environment in order to call the OData API.

1. Create a DEV Space on BAS

2. Connect to our Cloud Foundry environment

Open “Command Palette”

And search for “Login to Cloud Foundry”

Enter credentials to connect to BTP

And fill in the Organization and Space for this Cloud Foundry environment

3. Create the Fiori application

Once connected, restart the Command Palette and search for “Open Application Generator” :

Then create a “List Report” application

Use our OData API created on our BTP, ABAP Environment, as a source.

Enter project and application name

Then select YES for “Add deployment configuration” and “Add FLP configuration”.

You will then need to enter the deployment information: make sure you enter “Cloud Foundry” and not “ABAP” since we are deploying on Cloud Foundry.

Finally, we specify the configuration of the Fiori LaunchPad

Once all this information has been entered, the application is generated. It can be previewed.

4. Build and Deploy

Once the application has been generated, you need to “Build MTA Project”.

This will generate an MTA archive that can be deployed.

Once deployed, the application is available in BTP, Cloud Foundry Environment and visible in the “HTML5 Applications” section.

Note: We can also see that when creating the Fiori application, the system checks/creates the destination needed to connect the user to BTP, ABAP Environment in order to consume the OData service.

Here, the OAuth2UserTokenExchange exchanges the token already held by the user after authenticating with the Fiori application, in order to authenticate with BTP, ABAP Environment.

This destination is then used in the Fiori application:

For more information, you can check documentation : https://help.sap.com/docs/sap-btp-abap-environment/abap-environment/routing-via-destination?locale=en-US

Conclusion

The Fiori application using an OData API deployed on BTP, ABAP Environment is now available on BTP, Cloud Foundry Environment.