Today I will be covering the B2B Unit and B2B Customer Onboarding process, for your end client.
Companies are putting a lot of money into making the infrastructure, from long back years, they have built a historic data set, for
1. products,
2. customers,
3. content,
4. product prices,
5. their manufacturing warehouse/plant in SAP,
6. discounts,
7. promotion
and many more.
In this blog, I will be talking about SAP Commerce/SAP Hybris technical requirements which most customers have when we implement the SAP Commerce/SAP Hybris omnichannel solution design.
What could be our system? through which we will be integrating could be?
1. SAP S4 System.
2. SAP ECC System.
3. MDG System.
4. Oracle ERP System.
These are a few common systems, most of the legacy customers, we say legacy data.
Now SAP Commerce/SAP Hybris don't talk to this system directly, as each system has a different format of data they pass and they collect/data transformation, few systems accept data in Idoc format, few systems accept data in EDI format, and few in JSON based format, etc.
SAP Commerce/SAP Hybris has ODATA web service for inbound load requests, Odata are webservice which are Restful webservice.
Inbound Integration -> Data which is receiving to SAP Commerce/SAP Hybris from the Legacy system, basically the source data is getting replicated to SAP Commerce/SAP Hybris system.
In short, between SAP Commerce/SAP Hybris and Legacy system -> we need a middleware who transform the data, SAP Commerce/SAP Hybris accept the data in JSON based format(It is widely used industry acceptable format).
What are the middleware option we have?
1. CPI(SAP Cloud Platform Integrator)
2. PI/PO
3. Data Hub
Both three are equally imported, in transforming/cleaning and discarding data if any.
Lets talk on SAP CPI -> It is cloud based native application, which can dynamically scale up based on load, and accept wide set of data format and convert it into read able format for end system.
SAP Commerce/SAP Hybris <- --Connect to CPI----> SAP CPI <----Webservice/Odata connection--------> SAP S4 System
Now how the connection will work between SAP Commerce/SAP Hybris to SAP CPI system, in SAP Commerce/SAP Hybris, we have OOTB extension, provided in Module package whcih we need to download from SAP portal,
we have sapcpiadapter extension, saporderexchange extension, saporderexchangeb2b extension etc, using this integration we can implement the CPI connectivity, we only need to configure the Outbound destination URL, and Username & Password, for authentication.
SAP CPI OMM Order conversion service converts OrderModel to SapCpiOrder and OrderCancelRecordEntryModel to List.
public class SapCpiOmmOrderConversionService implements SapCpiOrderConversionService
in this class we have following method ->
public SapCpiOrder convertOrderToSapCpiOrder(OrderModel orderModel) which contain the completed logic for converting the order model to data obect or DTO.
SapCpiOrder sapCpiOrder = new SapCpiOrder();
Above functionality is for converting the order data model to CPI standard.
Action class to send the CPI Order Model to CPI odata endpoint -
public class SapCpiOmmOrderOutboundAction extends SapSendOrderToDataHubAction
public void executeAction(OrderProcessModel process) throws RetryLaterException {
final OrderModel order = process.getOrder();
getSapCpiOutboundService().sendOrder(getSapCpiOrderOutboundConversionService().convertOrderToSapCpiOrder(order)).subscribe(
// onNext
responseEntityMap -> {
if (isSentSuccessfully(responseEntityMap)) {
setOrderStatus(order, ExportStatus.EXPORTED);
resetEndMessage(process);
LOG.info(String.format("The OMM order [%s] has been successfully sent to the SAP backend through SCPI! %n%s",
order.getCode(), getPropertyValue(responseEntityMap, RESPONSE_MESSAGE)));
} else {
setOrderStatus(order, ExportStatus.NOTEXPORTED);
LOG.error(String.format("The OMM order [%s] has not been sent to the SAP backend! %n%s",
order.getCode(), getPropertyValue(responseEntityMap, RESPONSE_MESSAGE)));
}
final String eventName = new StringBuilder().append(SapOrderExchangeActionConstants.ERP_ORDER_SEND_COMPLETION_EVENT).append(order.getCode()).toString();
getBusinessProcessService().triggerEvent(eventName);
}
// onError
, error -> {
setOrderStatus(order, ExportStatus.NOTEXPORTED);
LOG.error(String.format("The OMM order [%s] has not been sent to the SAP backend through SCPI! %n%s", order.getCode(), error.getMessage()), error);
final String eventName = new StringBuilder().append(SapOrderExchangeActionConstants.ERP_ORDER_SEND_COMPLETION_EVENT).append(order.getCode()).toString();
getBusinessProcessService().triggerEvent(eventName);
}
);
}