Sales Order Simulation is one a key module which is used when we need to integrate with S4HANA for fetching real time price, stock, or to perform a credit check. It also allow to create orders, fetch order history, order details in real time by calling S4HANA API.
We have often seen that many b2b Application has a complex pricing, Stock Management which varies as per the customer, quantity of products and there are other multiple factor. These complexities can not be managed using hybris. So Hybris provides a provision to connect with S4HANA real time to get the pricing, stocks, credit checks.
Order Simulation modules also allow us to create an Order in S4HANA. And they can be retrieved as a real time call when customer try to access the my account section of order history and order details.
The Action which can be performed using Order Simulation are mentioned below:
- Synchronous Pricing
- Availability Check
- Credit Check
- Order Creation
- Order History
- Order Details
- Billing Invoice
Technical Architecture of Order Simulation Module
How to use Order Simulation Module
In order to use Sale Order simulation module in you project you need to include below extensions in your localextension.xml:
saps4omservice
This extension contains the service classes that connect to the SAP S/4HANA backend and fetch the stock and price details. It also contains the services which handle synchronous order creation and history, and verify the user’s credit limit.
Caching of prices and stock availability can also be managed using this extensions.
This extension depends on below extension of running functionalities
- outboundservices
- sapmodel
- b2bapprovalprocess
This extension override below service to intract with backend
- calculationService
- stockService
- externalTaxesService
- priceService
- futureStockService
- commerceStockService
Different service like “sapS4OMAvailabilityService”, “defaultS4OMSapFutureStockService”, “sapS4SalesOrderSimulationService” calls “sapS4OMOutboundService“. This class is a common service class which calls APIs provided by the SAP S/4HANA system. It uses the CSRF token from session for authentication. It makes call to below endpoints
Scenarios | Method | API Endpoints |
---|---|---|
get latest price, stock availability, and credit limit details | POST | API_SALES_ORDER_SIMULATION_SRV/A_SalesOrderSimulation |
Synchronous Order Creation | POST | API_SALES_ORDER_SRV/A_SalesOrder |
Fetch Synchronous Orders (Order History) | GET | API_SALES_ORDER_SRV/A_SalesOrder?&$filter=SalesOrderType eq {‘SalesOrderType’}and SoldToParty eq {‘SoldToParty’}&$top={value} |
Fetch Synchronous Order Details | GET | API_SALES_ORDER_SRV/A_SalesOrder({‘order number’}) |
saps4omfacades
It contains the populators which convert the model object retrieved from above extension to POJO objects.
saps4ombackoffice
It provide the backoffice structure for order simulation feature.
saps4omocc
It provides the OCC layer for order simulation module.
These 2 extensions are now deprecated and there functionality can be achieved using above extension “sapsalesordersimulation”, a”sapsalesordersimulationbackoffice”
Feel free to connect for any assistance and support.
Leave a Reply