SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Create a List Report Floorplan

Use the SAP BTP SDK for iOS to build a simple List Report Floorplan containing an FUISearchBar

Overview

You will learn

  • ✔How to use the SAPFiori UI controls to build a List Report Floorplan
Sandeep T D S S Sandeep T D S January 9, 2023
Created on January 9, 2023
Contributors

More from Sandeep T D S

See all 10 tutorials by Sandeep T D S →

Prerequisites

Steps

Details

You will learn

  • How to use the SAPFiori UI controls to build a List Report Floorplan

Step 1 Make the Generated App Your Own
—

In this example, you build upon the Tutorial app created using the Sample OData service. If you examine the service’s metadata you can see entity Supplier has a one-to-many relationship with Products:

XML
<EntityType Name="Supplier">
  <Key>
    <PropertyRef Name="SupplierId"/>
  </Key>
  <Property MaxLength="40" Name="City" Nullable="true" Type="Edm.String"/>
  <Property MaxLength="3" Name="Country" Nullable="true" Type="Edm.String"/>
  <Property MaxLength="255" Name="EmailAddress" Nullable="true" Type="Edm.String"/>
  <Property MaxLength="10" Name="HouseNumber" Nullable="true" Type="Edm.String"/>
  <Property MaxLength="30" Name="PhoneNumber" Nullable="true" Type="Edm.String"/>
  <Property MaxLength="10" Name="PostalCode" Nullable="true" Type="Edm.String"/>
  <Property MaxLength="60" Name="Street" Nullable="true" Type="Edm.String"/>
  <Property MaxLength="10" Name="SupplierId" Nullable="false" Type="Edm.String"/>
  <Property MaxLength="80" Name="SupplierName" Nullable="true" Type="Edm.String"/>
  <Property Name="UpdatedTimestamp" Type="Edm.DateTime"/>
  <NavigationProperty FromRole="Supplier" Name="Products" Relationship="ESPM.Supplier_Product_One_Many0" ToRole="Product"/>
</EntityType>

The app you’ve generated with the SAP BTP SDK Assistant for iOS (Assistant) has currently its UI. You’re going to make that app your own now.

Open the Main.storyboard, select all displayed View Controllers and delete them.

Change UI
Change UI

Add a new UITableViewController to the storyboard and embed it in a UINavigationController.

Change UI
Change UI

Now change the UINavigationController to be the Initial View Controller.

Change UI
Change UI

To let the app load your newly added screen it is necessary to change the application screen code in the ApplicationUIManager.swift.

Open the ApplicationUIManager.swift class and locate the showApplicationScreen(completionHandler:) method.

Change UI
Change UI

Replace the following code inside the showApplicationScreen(completionHandler:) method:

Swift
  let appDelegate = (UIApplication.shared.delegate as! AppDelegate)
  let splitViewController = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "MainSplitViewController") as! UISplitViewController
  splitViewController.delegate = appDelegate
  splitViewController.modalPresentationStyle = .currentContext
  splitViewController.preferredDisplayMode = .allVisible
  appViewController = splitViewController

with:

Swift
   let navigationViewController = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateInitialViewController() as! UINavigationController
   appViewController = navigationViewController

Instead of instantiating the MainSplitViewController the UIStoryboard will instantiate the initial View Controller and cast it to the UINavigationController.

Lastly, you have to create a new class inheriting from UITableViewController. Create a new Cocoa Touch Class and name it SupplierTableViewController.

Change UI
Change UI

Set the created class as Custom Class in the storyboard for the added UITableViewController.

Change UI
Change UI

Step 2 Fetch All Available Suppliers From the Sample Service
+
Step 3 Implement the Table View to display a supplier list
+
Step 4 Add an FUIActivityControl to your FUIContactCell
+
Step 5 Implement the Navigation Between the Supplier List and the Product List
+
Step 6 Implement the loading and displaying of supplier-specific products
+
Step 6 Implement the FUISearchBar to search for certain products in the list
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Make the Generated App Your Own 2. Fetch All Available Suppliers From the Sample Service 3. Implement the Table View to display a supplier list 4. Add an FUIActivityControl to your FUIContactCell 5. Implement the Navigation Between the Supplier List and the Product List 6. Implement the loading and displaying of supplier-specific products 6. Implement the FUISearchBar to search for certain products in the list
Next