SAP

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

Build an AI Sales Assistant Agent with Joule Studio, SAP Sales Cloud, and SAP S/4HANA Cloud

Overview

🎓 beginner ⏱ 25 min. Joule StudioJouleJoule WorkBeginner

You will learn

  • ✔How to identify a sales workflow that benefits from a data-grounded discount recommendation
  • ✔How to write a two-sentence intent statement that lets Joule Studio generate the whole solution in Fast Track mode
  • ✔How Joule Studio turns the intent into a Product Requirements Document (PRD), a Specification, and auto-generated MCP server integrations - with no manual coding
  • ✔How to review the generated agent, run the auto-generated test suite, and try the agent in Preview before deployment
  • ✔How the deployed agent gives a sales rep contextualized discount recommendations - discount range, margin impact, risk level, and rationale - inside Joule’s conversational interface
Rebecca Yang R Rebecca Yang October 6, 2026
Created on October 6, 2026
Contributors

Prerequisites

  • Access to Joule Studio
  • Access to an SAP S/4HANA Cloud system with:
    • Customer sales order history retrievable via the Sales Order OData API
    • Pricing conditions, margin configuration, and server-side margin reasoning (via Pricing Conditions or Sales Order Simulation OData APIs) accessible for the relevant sales areas
  • Access to SAP Sales Cloud with open opportunity, deal stage, and forecasting data retrievable via the Opportunity OData API for the sales reps in scope
  • Familiarity with the opportunity-to-order sales process across SAP Sales Cloud and SAP S/4HANA Cloud

Steps

Intro

IMPORTANT

Welcome to the Agent lab

You are working with a pre-release version of the Joule Studio. This gives you an early look at our upcoming capabilities. Please keep the following in mind:

  • Features are subject to change: The UI, terminology, and functionality you see may differ from the final product.
  • Educational use only: This environment is designed for learning and experimentation, not for production use.
  • Potential instability: As a preview version, you may encounter occasional instability or unexpected behavior.

Every sales negotiation turns on the same question: how much discount can I offer, and how do I justify it? Today, a sales rep answering that question has to cross-reference customer order history in SAP S/4HANA Cloud, open opportunity data in SAP Sales Cloud, and margin targets across the SAP landscape - then simulate the margin impact of a discount in their head. The decision is usually made from gut feel, and the margin impact only shows up at month-end.

In this tutorial, you build an AI Sales Assistant using Joule Studio. The agent reasons over live SAP data - customer order history, pipeline context, and pricing/margin signals from across SAP Sales Cloud and SAP S/4HANA Cloud - and gives the rep a structured discount recommendation (range, margin impact, risk level, and rationale) at the point of negotiation.

You will move through all phases of the Joule Studio intent-based development process: from a plain-language intent statement to a deployed Python agent that calls the SAP APIs through auto-generated MCP servers.

About the scenario: The customer, order, and margin values referenced in this tutorial are illustrative. The agent pattern applies to any organisation running the opportunity-to-order process across SAP Sales Cloud and SAP S/4HANA Cloud.

Why discount strategy is a strong automation candidate? The decision has a well-defined trigger (a rep considering a discount for an open deal), a bounded set of input data (order history, pipeline status, margin targets, pricing simulation), a structured output (a discount recommendation with rationale), and a clear success criterion (higher deal margin at protected win rate). Those characteristics make it an ideal target for a recommendation agent that augments the rep’s judgement rather than replacing it.


Step 1 Understand the Business Challenge
—

Before building the agent, it is important to understand the typical scenarios the agent must handle and the manual pain points it eliminates.

Three typical discount scenarios

A sales rep considering a discount is almost always in one of three situations. The agent reasons about each one differently - using different signals from across SAP Sales Cloud and SAP S/4HANA Cloud - which is why the intent statement explicitly names both source systems.

ScenarioWhat the rep is actually facingWhat the agent uses to help
Repeat customer renewing or re-orderingA known customer with purchasing history. The question is how to protect margin without losing a predictable deal.Order history from SAP S/4HANA Cloud - what this customer bought, at what price, how often, with what payment behaviour - plus current margin from the pricing/margin API in S/4HANA
New prospect with an aggressive discount askAn unknown customer, no purchasing history, often an upfront discount request to “earn the business”. The question is how much to concede on margin to win the first deal.Opportunity data from SAP Sales Cloud - deal stage, forecast, competitive context - plus the margin floor from the pricing/margin API to find the safest discount that still clears the floor
Strategic account mid-cycleA major account already in-flight on an opportunity, now asking for a mid-cycle discount concession. The question is how to decide without stalling the deal.All sources together - history (is this consistent with past behaviour?), pipeline (what else is open with this account?), and margin reasoning (what does this discount do to the deal margin right now?)

Current pain points

The manual approach to discount decisions creates well-understood operational challenges that sit on top of fully functional SAP standard scope:

  • Data lives across two systems, the decision happens in one head - customer order history is in SAP S/4HANA Cloud, open opportunities and pipeline health are in SAP Sales Cloud, and margin targets are maintained in SAP S/4HANA pricing configuration. The rep is the integration layer, done manually, in real time, under negotiation pressure.
  • No in-the-moment reasoning across the two systems - SAP Sales Cloud and SAP S/4HANA Cloud each cover their part of the process and expose APIs for the data. What is missing is an AI layer that correlates all three signals into a single discount recommendation at the point of negotiation.
  • Margin impact of a discount is invisible until posting - the rep offers a discount percentage without seeing what it does to the margin until the quotation is converted. SAP S/4HANA has APIs that can produce that number (pricing conditions, order simulation), but they are not surfaced at the point of quoting.
  • No rationale attached to the number - the discount offered is rarely written down with its reasoning. When margin erodes at month-end, there is no trace of why that specific percentage was chosen for that specific deal.
  • Inconsistent discounting across the team - without a shared recommendation layer, every rep applies their own heuristic. Discount-band consistency across the sales organisation is impossible to achieve from training alone.

The agent you build in this tutorial retrieves customer order history and margin signals from SAP S/4HANA Cloud, pipeline and opportunity data from SAP Sales Cloud, correlates them into a single ranked discount recommendation with rationale, and surfaces it to the rep inside Joule’s conversational interface at the point of negotiation.

Step 2 Open Joule Studio and Define the Agent Intent
+
Step 3 Review the Intent
+
Step 4 Product Requirements Document
+
Step 5 Inspect the Generated Specification
+
Step 6 Generate the Solution
+
Step 7 Validate the Agent with Automated Tests
+
Step 8 Deploy the Agent to Development Landscape
+
Step 9 Summary
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 9
1. Understand the Business Challenge 2. Open Joule Studio and Define the Agent Intent 3. Review the Intent 4. Product Requirements Document 5. Inspect the Generated Specification 6. Generate the Solution 7. Validate the Agent with Automated Tests 8. Deploy the Agent to Development Landscape 9. Summary