SAP

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

Extend an MDK App with Customer Orders

Display a customer order list and its details.

Overview

You will learn

  • How to enhance customer details with its order information
  • How to create a new page for displaying the order details
Jitendra Kansal J Jitendra Kansal August 21, 2026
Created on October 16, 2022
Contributors

More from Jitendra Kansal

See all 34 tutorials by Jitendra Kansal →

Prerequisites

Steps

Intro

You may clone an existing metadata project from the MDK Tutorial GitHub repository to start with this tutorial.


To enhance your MDK app with customer order information, you need to carry out the following tasks:

  • Create a new order list page
  • Create a new order details page
  • Create a new navigation action to the new order details page
  • Write a JavaScript logic to calculate total number of orders for a customer
  • Display top 5 orders in customer details page
  • Add a header control to the orders grid of the customer detail page to display a text label
  • Add a footer control to the orders grid of customer detail page to show total order count

Customer Orders Feature App Overview
Customer Orders Feature App Overview

Step 1 Create a new order list page

This page will display customer orders list, you will add an Object Table control that is used to display information (like Sales order ID, order creation date, gross amount and life cycle status name) about an object.

You can find more details about available controls in section page.

  1. In your MDK project, right-click the Pages | MDK: New Page | select Section | Next.

    New Section Page Creation Dialog
    New Section Page Creation Dialog

    You can find more details about section pages.

  2. In the Base Information step, enter the page Name Customers_Orders and click Finish to complete the page creation process.

    Customers Orders Page Name Entry
    Customers Orders Page Name Entry

  3. Once the page opens in the page editor, click on the white area to select it’s Action Bar, and set the Caption to Customer Orders.

    Action Bar Caption Set To Customer Orders
    Action Bar Caption Set To Customer Orders

  4. Next, add an Object Table control to display information like sales order ID, order creation date, gross amount and life cycle status name.

    In the Layout Editor, expand the Controls | Data Bound Container group, drag and drop the Object Table control onto the page area.

    Object Table Control Drag And Drop
    Object Table Control Drag And Drop

  5. In the Properties pane, provide the below information:

    PropertyValue
    ServiceSelect com_sap_edm_sampleservice_v4.service from the dropdown
    EntitySetSelect SalesOrderHeaders from the dropdown
    QueryOptions$filter=CustomerID eq {CustomerID}&$orderby=CreatedAt desc

    Object Table Service And EntitySet Properties
    Object Table Service And EntitySet Properties

    The query expression will filter the top five order entries for a given customer ID, returning them in descending order when sorted by the order creation date property.

    Query Options Filter Expression Result
    Query Options Filter Expression Result

  6. Now, start binding Object Table properties with SalesOrderHeaders entity set properties.

    In the Appearance section of the Properties pane, provide the below information:

    PropertyValue
    DescriptionRemove the default value and leave it blank
    FootnoteRemove the default value and leave it blank
    PreserveIconStackSpacingfalse
    ProgressIndicatorRemove the default value and leave it blank
    StatusText$(C,{GrossAmount},{CurrencyCode},'',{minimumIntegerDigits:1,minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:true})
    Subheadbind it to {CustomerID}
    SubstatusTextRemove the default value and leave it blank
    TagsClick the item0 and then click the trash icon to delete the default item
    Title$(D,{CreatedAt},'','',{format:'medium'})

    Object Table Appearance Properties Bound
    Object Table Appearance Properties Bound

    $(C,{GrossAmount},{CurrencyCode},'',{minimumIntegerDigits:1,minimumFractionDigits:0,maximumFractionDigits:2,useGrouping:true}) is an expression of how to format currency value, end result would be like €200.44. By default it will be formatted to the device’s locale setting. More details on Currency Formatter is available in documentation.

    Currency Formatter Expression Preview
    Currency Formatter Expression Preview

    $(D,{CreatedAt},'','',{format:'medium'}) is an expression of how to format a date, end result would be like June 20, 2020. By default it will be formatted to the device’s locale setting. More details on Date Formatter is available in the documentation.

    Date Formatter Expression Preview
    Date Formatter Expression Preview

  7. In the Search section of the Properties pane, change both the Search Enabled property and Barcode Scanner property to true.

    Search Enabled And Barcode Scanner True
    Search Enabled And Barcode Scanner True

  8. In the Behavior section of the Properties pane, select DisclosureIndicator to AccessoryType property.

    AccessoryType Set To DisclosureIndicator
    AccessoryType Set To DisclosureIndicator

  9. In the Avatar Grid section of the Properties pane, remove the default Avatar by selecting the item0 and then clicking the trash icon to delete the default item.

    Avatar Grid Default Item Removed
    Avatar Grid Default Item Removed

  10. In the Avatar Stack section of the Properties pane, remove the default Avatar by selecting the item0 and then clicking the trash icon to delete the default item.

    Avatar Stack Default Item Removed
    Avatar Stack Default Item Removed

  11. In the EmptySection of the Properties pane, provide No Orders Found for the Caption property.

    EmptySection Caption No Orders Found
    EmptySection Caption No Orders Found

Step 2 Create a new order details page
+
Step 3 Navigate from Customer Order Page to Order Details Page
+
Step 4 Display top 5 orders in customer detail page
+
Step 5 Add Header control to orders grid
+
Step 6 Add Footer control to show total order count
+
Step 7 Deploy the Project
+
Step 8 Run the Project
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 8
1. Create a new order list page 2. Create a new order details page 3. Navigate from Customer Order Page to Order Details Page 4. Display top 5 orders in customer detail page 5. Add Header control to orders grid 6. Add Footer control to show total order count 7. Deploy the Project 8. Run the Project
Next