cancel
Showing results for 
Search instead for 
Did you mean: 

BAS new Fiori Application Template - Approuter Configuration

Jeff
Explorer

Hello,

I was using the newer Fiori Application Template (freestyle project) for the first time in Business Application Studio since the previous Fiori generator template is marked as deprecated now.

There are some nice new features, like being able to autogenerate the cross navigation properties, etc...

One thing I noticed is that the previous template options of choosing standalone approuter vs managed approuter are no longer in this template and the xs-security.json file and mta.yaml entries aren't added.

I was able to add this setup by using the MTA module from template, but that failed to deploy to CF because it missed some properties in the MTA.yaml for the destination service.

It was not terribly difficult to fix those issues and deploy, but just curious on why the template removed those options on the initial project creation and if there is any plan to add that to the new template?

Thanks,

Jeff Renshaw

RazK
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi jeff.renshaw ,

Can you add the "SAP Fiori tools" tag to your question?

This will allow our colleagues to pick it up.

Regards - Raz

Jeff
Explorer
0 Kudos

Hi Raz,


It is done.

Thanks,

jeff

View Entire Topic
jlongie
Advisor
Advisor

Hi,

Sorry to hear that you are experiencing these issues, however, we are actively working on them. Even in our latest release (Friday March 5th) there are improvements in how we manage and configure managed approuter flows. I've documented a number steps to allow you develop a Fiori Elements application, build and deploy it to CF and supporting FLP if that is your requirement.

Please ignore the FLP steps if this is not your requirement.

Also, a number of these manual steps are being automated as part of an upcoming release.

Prerequisites

1. As SAP customer, you have purchased the Launchpad service to support FLP (not required otherwise)

2. Ensure you have the latest @sap/generator-fiori npm module installed or create a new SAP Fiori Dev Space

3. Or In your existing dev space, update to the latest by running `npm i -g @sap/generator-fiori`, https://www.npmjs.com/package/@sap/generator-fiori for more info

4. Understanding Managed Approuter https://developers.sap.com/tutorials/appstudio-sapui5-create.html#5a114a0f-2e97-40cb-ba1c-8710e713a0...

5. Developing HTML5 Applications and Extensions https://help.sap.com/viewer/8c8e1958338140699bd4811b37b82ece/Cloud/en-US/c1b9d6facfc942e3bca664ae063...

6. You have a UI5 destination configured for your sub account https://help.sap.com/viewer/6d3eac5a9e3144a7b43932a1078c7628/Cloud/en-US/0a2e5a45d5494ec08318ead2019...

7. Integrate your SAPUI5 app into your launchpad site https://developers.sap.com/tutorials/cp-launchpad-integrate-sapui5-app.html

Type: HTP

URL: https://ui5.sap.com

Proxy Type: Internet

Authentication: NoAuthentication

Add a new property HTML5.ForwardAuthToken , value: false

Use default JDK truststore is enabled

7. Alternatively, you can update the resource `<mta-id>-destination-service` to include the destination as per attached screen shot;

Configuration

Step1. Open the command palette `View` -> `Find Command`


a. Enter `Wizard` and select `Open Template Wizard`


b Select `Basic Multitarget Application` and press `Next`


c. Enter a unique project name, unique within your organisation i.e. the name is used as MTA ID in the `mta.yaml` file

**Note**: SAP Application Studio will restart itself with the new project as root folder

Step2. Right click the newly generated `mta.yaml` and select `Create MTA Module from Template`
 a. Select `Approuter Configuration` and press `Start`


b. Select your HTML5 application runtime `Managed Approuter`


c. Enter a unique name for the business solution of the project | Enter a unique ID e.g. `<your-mta-id>-service` from step 1.c


d. Do you plan to add a UI? `Yes`

Step3. Open the command palette `View` -> `Find Command` -> `Fiori: Open Application Generator`


a. Create a `SAP Fiori application`


b. Module name: uniquemodulename (make sure its unique in your organisation)


c. Namespace: com.hostname


d. Select `Yes` to `Add deployment configuration`, ensuring the newly generated MTA file is selected, refer to next step `Target Name`


e. Select `Yes` to `Add FLP configuration`, refer to next step `Overwrite` for input params, this is required for Launchpad to show your application tile

Step4. Target Name


a. Please choose the target - should default to Cloud Foundry


b. Destination name: Keep selected destination, otherwise input a valid destination appropriate for your environment

Step5. Overwrite


a. Semantic Object - somename<sth_unique> (should be a unique name for within your site)


b. Action - display


c. Title - My App Desc


d. Subtitle - Fiori Rocks!

Step6. Validate everything is working by right clicking on your new application and selecting `Preview Application`


a. Ensure you are able to load and retrieve data

Step7. Within your new Fiori application, open `webapp`-> `manifest.json` and at the end, append the following where the service is the id generated in step 2
 "sap.cloud" { "public": true, "service": "<your-mta-id>-service" }

**Note**: Adding `sap.cloud` to the manifest will be automatically added in a future release

Step8. Change into the root folder containing `mta.yaml`, run `npm run build` which will build the MTA archives

Step9. In the same folder, run `npm run deploy` and your app should be deployed

Step10. Before configuring a tile in cFLP, validate that the app has been successfully deployed. You can see all applications in the `HTML5 Applications` section in your sub account -> HTML5 Applications list

Step11. Alternatively, from the command line, you can run `cf html5-list -d` to see a list of all your HTML5 deployed applications with `sap.cloud.service` exposed, for more information https://help.sap.com/viewer/584e0bcbfd4a4aff91c815cefa0bce2d/Cloud/en-US/83b0fb23e37d456caad1ad0448e...

screen-shot-2021-02-25-at-104015.png

Jeff
Explorer

Thanks John for all of the detailed information.

I had not yet seen the updates to that developers.sap.com tutorial which reference the new template and also mention the "glitch" in the MTA.yaml / managed app router setup (which was really what triggered my question in the first place).

There are a lot of improvements in this new template. And I certainly do appreciate SAP's continued efforts to improve these tools. They greatly improve and speed up the development process.

Sometimes it can be a challenge to keep up with all of the changes and improvements you deliver. But that doesn't mean I want them to stop 🙂

Have a nice weekend.

Jeff