Hi guys, in this article I want to share a scenario end to end How to connect business processes with external system like SAP S/4 HANA on-premise, S/4 HANA public cloud by using action feature in SAP Process Automation.

You can use mode on-premise OR public cloud, it’s the same configuration.
In this article, I do not have account product for S/4 HANA public cloud so I will do this by using model ON-PREMISE.
PREREQUISITES
- SAP BTP trial account
- S/4HANA system where Sales Order business module is available – active service API_SALES_ORDER_SRV
- Communication user to access S/4HANA Sales Order inbound services – account on S/4 HANA
SETUP ENVIRONMENT
STEP 1 ACTIVE SERVICE API_SALES_ORDER_SRV
Step 1.1 To active service API-SALES_ORDER_SRV in backend S/4 HANA on-premise, do the following
- Login S/4 HANA
- Go to T-CODE SEGW
- Open Project API_SALES ORDER

- Register service

- Test by SAP Gateway Client

Step 1.2 Test service create sale order by POSTMAN
Next, we will create sale order.
Open POSTMAN and create new REQUEST
Endpoint | https://<host s4hana>:44300/sap/opu/odata/SAP/API_SALES_ORDER_SRV/A_SalesOrder?sap-client=<sap-client> |
Method | GET – to get CSRF TOKEN |
Method | POST – to create new sale order |
Content-Type | application/json |
Body | { “OrganizationDivision”:”string”, “DistributionChannel”:”string”, “SoldToParty”:”string”, “SalesOrderType”:”string”, “PurchaseOrderByCustomer”:”string”, “SalesOrganization”:”string” } |
Authentication | Basic Authentiation – username/password backend S/4 HANA |

STEP 2 CONFIGURATION SAP CLOUD CONNECTOR
Next we have to configure SAP Cloud connector connect to service of S/4 HANA.
You can reference here to configure SAP Cloud Connector

STEP 3 CREATE DESTINATION ON SAP BTP CONNECT TO ON-PREMISE


Type | HTTP |
URL | HTTP://<virtual-host-cloud-connector>:<virtual-port>/sap/opu/odata/SAP/API_SALES_ORDER_SRV/A_SalesOrder?sap-client=<sap-client> |
Proxy Type | OnPremise |
Authentication | BasicAuthentication |
Location ID | Location ID of SAP Cloud Connector |
User | User backend – S/4 HANA |
Pass | Password of user backend – S/4 HANA |
sap.applicationdevelopment.actions.enabled | true |
sap.processautomation.enabled | true |
Check destination on SAP Process Automation

Create Action Project in Lobby
STEP 1 Download open API specification
- Go to SAP Business API to download API specification of Sales order (A2X)

STEP 2 CREATE AND CONFIGURATION ACTION PROJECT IN SAP PROCESS AUTOMATION
- Go to SAP Process Automation
- Go to tab Lobby
- Create
- Build an automatic processe

- Choose Actions

- Browse to API Specification


- Go to project and choose request type is method POST by usung filter

- Add actions

- Next, we will choose fields input and output. Because boy for this API just a few field so another field we will remove. Base on your S/4 HANA on-premise we will have default value differently
OrganizationDivision | 10 |
DistributionChannel | 10 |
SoldToParty | 3000000 |
SalesOrderType | ZFOB |
PurchaseOrderByCustomer | 0272346 |
SalesOrganization | 1010 |


- Choose field for output
CreatedByUser |
CreationDate |
DistributionChannel |
OrganizationDivision |
PurchaseOrderByCustomer |
RequestedDeliveryDate |
SalesOrder |
SalesOrderDate |
SalesOrderType |
SalesOrganization |
SoldToParty |
TotalNetAmount |


- Enable X-CSRF


- TEST


- Save & Release & Publish to Library

DOWNLOAD TEMPLATE BUSINNESS PROCESS AND ADD ACTION INTO BUSSINESS PROCESS
STEP 1 DOWNLOAD TEMPLATE BUSSINESS PROCESS


STEP 2 ADD ACTION AND CONFIGURATION BUSINESS PROCESS
- Open Business Process


- Add action from library into business process




- Create destination for action


- Configuration Input for action
Next we have to binding data from business process trigger form into input data of action.

- Review output data of action

- Release and deploy business process
Next, we have to release and deploy business process, when deploy we have to choose destination which configured in SAP BTP

RUN BUSINESS PROCESS
STEP 1 RUN SALES ORDER APPROVAL BUSINESS PROCESS

STEP 2 MONITOR SALES ORDER APPROVAL PROCESS
- Go to monitor and search process


- Go to inbox and approve


SUMMARY
In this article, I shared one end to end scenario How to create sale order on S/4 HANA Onpremise from trigger form approval in SAP Process Automation. Thanks for your reading and any advise kindly leave your comment on this.
Thanks.
Joseph.