SAP-samples/on-stack-partner-reference-extension
The 'Loyalty Hub' reference application: an on-stack RAP extension to the standard Manage Sales Orders app on SAP S/4HANA Cloud Public Edition, built to the clean-core rules a partner extension must follow.
Loyalty Hub adds membership management, loyalty points and gift-card redemption to Manage Sales Orders – Version 2 without changing that standard app, integrating instead through a Z-namespace RAP application, a background job that promotes membership categories, and email notifications when a category changes. Step-by-step tutorials build the same application from scratch: data modelling and OData generation with RAP and CDS, business logic, authorization, event-based integration with the sales order, the gift-card extension, and finally a custom Fiori UI with navigation. It targets multi-off, customer-specific delivery for SAP S/4HANA Cloud Public Edition consumers rather than a single customer's own system.
Facts
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainersachin-bk-22Contributes to this
In the atlas: contributes to 2@sachin-bk-22Sowrabh-MehetreContributes to this
In the atlas: contributes to 1@Sowrabh-Mehetre2 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
As a sample
- Form
- A reference application
Connections
Changing delivered behaviour without modifying it
Defining business object behaviour and who owns the transaction
Download
README
quoted from SAP-samples/on-stack-partner-reference-extension under Apache-2.0, readOn-Stack Partner Reference Application 'Loyalty Hub'
Description
The Partner Reference Application is a reference implementation that provides clear guidance on the golden path for partners. It is built as an on-stack extension on SAP S/4HANA Cloud Public Edition, demonstrating how to extend core business processes while adhering to SAP’s clean-core principles.
This application is integrated with Manage Sales Orders – Version 2, a standard SAP Fiori application, enabling simple, transparent, and event-driven loyalty program management for customers. It showcases how standard SAP business processes can be enhanced without modifying the core.
The repository includes the Loyalty Hub application as a ready-to-run reference implementation. It also provides detailed, step-by-step tutorials to build, run, and deploy the application from scratch using an incremental development approach.
This tutorial covers how to build, run, and integrate applications using the ABAP RESTful Application Programming Model (RAP). The application architecture enables partners to deliver a multi-off (customer-specific) on-stack extension for SAP S/4HANA Cloud Public Edition consumers, ensuring seamless integration, scalability, and upgrade stability.
By leveraging the SAP S/4HANA Cloud Public Edition on-stack extensibility and the ABAP RAP model, the application aligns with SAP’s standards for enterprise-grade business solutions. It delivers a consistent and harmonized user experience along with robust and secure integration capabilities, including:
- A pre-built RAP application in the Z namespace for faster partner onboarding
- Step-by-step code walkthroughs to support learning and implementation
- Implementation based on SAP RAP standards and best practices
- A clean-core architecture that ensures upgrade safety and independent lifecycle management
- An on-stack extension tightly integrated with Manage Sales Orders – Version 2 using ABAP RAP for efficient and extensible design
- Secure, reliable, and future-ready integration with SAP S/4HANA Cloud Public Edition
About the Sample Application Loyalty Hub
Imagine you're responsible for managing customer loyalty within SAP S/4HANA Cloud Public Edition and your goal is to reward repeat customers and encourage long-term engagement using memberships, loyalty points, and gift cards.
In this scenario, Aarti, a loyalty administrator, manages memberships, awards loyalty points, and issues gift cards. Julia, a customer, earns and redeems rewards during sales transactions. The image below outlines their roles, goals, and interactions with the Loyalty Hub application.
The image below illustrates the end-to-end user flow for Aarti, the Loyalty Hub administrator. It shows how she navigates the Loyalty Hub application to onboard sold-to parties and manage their memberships.
The image below illustrates the end-to-end user flow for Julia, the Sold-to Party. It shows how she navigates from the Manage Sales Orders – Version 2 application to the Loyalty Hub application to view membership points, redeem points for gift cards, and apply gift cards to sales orders.
Key Features
The Loyalty Hub application offers the following key features and capabilities:
- Seamless integration with the Manage Sales Orders – Version 2 application.
- End-to-end management of memberships, categories, transactions, and gift card redemption.
- Built-in email notification services to inform customers when their membership category is upgraded.
- Background job execution to automatically evaluate and promote membership categories based on defined criteria.
Key strategies and tools for developing the application are:
- Develop and manage ABAP applications using ABAP development tools for Eclipse (ADT).
- Leverage a modern web architecture with SAP Fiori for user experience, ABAP for business logic, and SAP HANA Cloud for high-performance data processing.
- Apply model-driven development using ABAP RAP, Core Data Services (CDS), and SAP Fiori elements.
- Provide an SAP standard user experience with predefined floor plans, theming options, and personalization features.
- Enable multi-step data changes using the draft concept, allowing users to save incomplete changes before final submission.
- Ensure enterprise-grade security with SAP-standard authentication and role-based authorizations.
- Deploy the application as on-stack extensions with multi-off delivery.
Architecture and User Interaction Flow
The diagram below illustrates the end-to-end architecture and user interaction flow of the Loyalty Hub application integrated with the Manage Sales Orders – Version 2 application in SAP S/4HANA Cloud Public Edition. It shows how administrators and sold-to parties interact with SAP Fiori apps, back-end business objects, event-based integrations, background jobs, and email notifications within a secure SAP standard landscape.
Entity Relationship Diagram
The diagram below represents the Loyalty Hub data model, showing core entities such as business partners, memberships, transactions, gift cards, and categories along with their relationships. It highlights how a sold-to party is linked to a membership and how that membership drives related transactions, gift cards, and category assignments.
Requirements
The application is based on SAP S/4HANA Cloud Public Edition. Here's what you need:
- Eclipse with ABAP Development Tools (ADT) – This is used for back-end development and ABAP RAP modeling.
- An SAP BTP account, which includes SAP Business Application Studio as a standardized development environment.
- GitHub Repository – Use this repository to manage source code versioning and collaboration.
- SAP S/4HANA Cloud Public Edition – This acts as the digital core, providing business processes and data integration.
Overview
If you prefer a quick start with a deployment of the Loyalty Hub application including all features without further explanation, follow the quick start guide.
Tutorials
-
Develop the core application focusing on business models, business logic, and UI:
- Prepare Your SAP BTP Account and SAP BAS for UI Extension
- Business Configuration Maintenance Object for Maintaining Categories
- Developing RAP Applications - Data Modeling and OData Service Generation
- Developing Business Logic
- Add Authentication and Role-Based Authorization
- Core Data Services
- Message Handling
-
Integration and gift card extension
-
Custom UI extension navigation
Known Issues
There aren't any known issues.
Get Support
This repository is provided "as-is", we don't offer support. For questions and comments, join the SAP Community.
License
Copyright (c) 2026 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.
Disclaimer
This repository contains sample code provided “as‑is” for instructional purposes only. SAP makes no warranties and accepts no liability, except in cases of gross negligence or willful misconduct. All included data is fictitious and contains no real personal, confidential, or sensitive information. Do not use this tutorial app productively with real personal data. SAP is not responsible if anyone uses it to capture personal data.
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-on-stack-partner-reference-extension- JSON
- /artifacts/sap-samples-on-stack-partner-reference-extension.json
- MCP
- Connecting an agent