Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Archana
Product and Topic Expert
Product and Topic Expert
SAP Process Automation is a service in SAP Business Technology Platform which combine capabilities from SAP Workflow Management (workflow, business rules, process visibility, Inbox) and SAP Robotic Process Automation (RPA Bots). This new combined offering was released in February this year. Since then, we have been releasing many features and functionality to enhance overall experience in the area of automation design, process design, form design, process execution, process lifecycle and governance. Learn more from the roadmap

Just this week, we released Action feature in SAP Process Automation. Action is a mean to connect processes with external systems, be it SAP or non-SAP systems. This is an important piece of the puzzle especially if you want to automate or extend your business processes for any available LoB processes like S/4HANA, Ariba, SuccessFactors etc. These extensions can be easily build using SAP Process Automation, and using Actions you can connect to your given S/4HANA, Ariba or other SAP LoB systems for any kind of GET, POST, PATCH and other calls.

For example, posting an invoice to the S/4HANA system after approval from business process or getting the employee details from SuccessFactors system for off-boarding process or updating purchase requisition details for the changes in the order in Ariba system or getting asset details from Asset Management system before sending it for approval for asset depreciation. There are many such real-world examples where you will need to create, fetch or update the data in the backend system based on the process outcomes (approval, validation etc.)

Through this blog, I will show you how to use Action feature in SAP Process Automation to post Business Partner master data in S/4HANA after approval via business process.

Let us start with the concept first. There are 3 main artefacts which will be needed to connect to external system from business process automation:

  1. Action Project: Simplify experience for citizen developers to consume business functions / APIs from the library of curated content (read this blog from Vivek Vishal on Action Project)

  2. Action Library: Enable citizen developers to quickly compose processes, automations and applications by consuming from the library of curated content


  3. Action: Simplify integration, interaction and invocation between external systems by providing a common skill (learn with simple example from Thomas Jentsch)


Here is the quick overview of the steps to:

  • Create, Configure and Test Action Projects

  • Add, Configure and Monitor Action in Business Process



Now let us realize the steps with very simple use case to create the business partner master data in the backend S/4HANA Cloud System.


  1. Create Destination in SAP BTP Cockpit





 

Note: The username and password are of the communication user created to access Business Partner OData API in my S/4HANA cloud system. This username, password and other credential parameters will differ based on the system you choose.


Also notice the additional parameters:






    • sap.processautomation.enabled = true is needed to add this destination in the SAP Process Automation Settings.

    • sap.applicationdevelopment.actions.enabled = true is needed if you want to use this destination while testing in Action Project.






  1. Prepare or Download the open API specification from API Business Hub.


    note: Action Project works only with OpenAPI specification 2.x or 3.x. You can find these specifications with the SAP published APIs in API Business Hub or you can also generate OpenAPI specification for your own custom API like calling integration flow or any custom OData API published from ECC system.


 

In this example, I have used Business Partner APIs published in API Business Hub



 

 


  1. Create and Configure Action Project




Now its time to create and configure Action Project from Application Development Workbench Lobby, with the given OpenAPI specification


Note: I have only added two methods (or Actions or APIs) to this project, and I have also updated the title and trimmed the Input fields based on my requirement.


It is suggested to use minimalist set of input and output fields to avoid cluttering the business process context with unwanted fields that will not be used anytime during the process design or execution. You can always add or update the fields later if the requirement changes.





  • Don’t forget to test the Action and check if it’s working fine with destination connection:

  • Once you have configured and tested, Release and Publish the Actions of the Action project in the Action Library




  1. Add Action in Business Process


    For this I have created a simple Business Partner Approval Process which has:

    1. Start form to fill the details of the Business Partner

    2. Enrichment form to add address details

    3. Business rules to setup default values for missing mandatory fields

    4. Conditional Flow to determine if the approval is needed based on Business Partner Category and Organization

    5. Approval Form to approve or reject by the manager





 

Once the approval is done, I have added an Action by browsing the actions published in the Action Library



Then, I have configured the Action to add destination variable, mapped the Action Input with the actual process context and check the output that will be appended in the process context after execution and this output can be consumed for further processing.





  • Do not forget the release and deploy the project. At the time of deployment, you will be promoted to associate the destination variable with the actual destination name. You can the select the one from the drop downnote: If you do not find the destination in the drop down, then ensure that you have added the destination via the Settings option.



 


  1. Monitor Action in Business Process


    As last step, run the process and monitor the outcome of Action execution from the Monitor Application.



 

Notice that the process context will be updated with the output from the Action execution including the newly created Business Partner ID. You can access this output for any further usage like sending email to the requestor or checking the backend S/4HANA system with the given Business Partner ID etc.


 

With the introduction of action project and actions, you can now build and manage business processes which involves connectivity using APIs. Watch the step-by-step video from Devtoberfest on how to create and use Actions in SAP Process Automation



Go and try out the Action Project and connect to external systems. If you have any suggestions, feedback or comments, please do let us know - we will be happy to take them and improve our product further.
25 Comments
SamannayaRoy
Explorer
0 Kudos
Hi Archana,

Nice blog. Is there any way we can configure outlook or Gmail with trial account SPA or BTP free subscription? I configured the destination in free tier but not able to test mail sending.
Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos
Yes you can send emails. No restrictions from SAP Process Automation side. Check your email server. With gmail, there are some additional settings you have to do in Gmail account.
Dan_Wroblewski
Developer Advocate
Developer Advocate
samannaya.roy There is documentation on sending emails, but I will publish soon a video on how to send emails 3 different ways within SPA. But if you need some help let me know.
Dan_Wroblewski
Developer Advocate
Developer Advocate

Really nice and helpful blog ... and your Devtoberfest presentation was great: https://www.youtube.com/watch?v=HU7Lir3AQbY

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos
Am glad you liked it. Thanks for posting it again.
0 Kudos
Informative blog but screenshot are blurred.
Bram
Explorer
0 Kudos
Hi Archana,

The action body fields are not pre-determined by the JSON when I create an action.

I follow the exact steps as in your video.

Is there something wrong with the product?


Thanks.

Kr,

0 Kudos
Thanks for the blog,

I am facing error 503 Unable to fetch CSRF token when the Action is added into Process however the action works fine if tested from action editor.
* CSRF path is updated already not sure if this is limitation with trial account
** I am trying to access on prem S4 system API.
Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Satyajit,
Have you configured the cloud connector for on-prem call?
Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Bram,

If you have not deleted the fields then all of them should appear when you create the Action Project for first time. Can you please try doing that again.
0 Kudos
Yes Cloud Connector is up and running for BTP and S4 on prem.

I can test the API from Action editor(POST call) and its successful. But when I add the action in process its gives 503 Unable to fetch CSRF token error . Seems this is limitation with Trail account.

** API POST call works fine in Action editor but not in process.
Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Satyajit,

Can you please let me know (attach a screenshot if possible) what is the path that you have configured for CSRF token in Action Project.
0 Kudos
Hi Archana,

Thanks for continues support please find below screenshot for CSRF enablement.


Action with Default CSRF

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Satyajit,

How many level of hierarchy you have in to_PurchaseReqItem in the body? Can you expand and show me. Currently we are supporting only one level of Hierarchy - which means you should not have any other tree node inside to_PurchaseReqItem
0 Kudos
Hi Archana,

 

yes there is one more entity in to_PurchaseReqItem. 

  • Still I am not getting is as it works in Action Editor and not in Process .

  • I have tried with single entity also it was not working



Hierarchy

0 Kudos
Hi Archana,

 

Please find below Hierarchy.
One question in my mind how it works in Editor but.


Hierarchy

SandipAgarwalla
Active Contributor
0 Kudos

archana.shukla 

Does the Action project takes care of csrf token automatically when we try to do a POST/PUT call?

 

Regards

Sandip

juliacimt
Member
0 Kudos
Dear Archana,

I followed your steps and calling the API Destination in Actions is working correctly. But if I run the process automation we keep receiving an Error 401. Do you have any idea how we can fix the problem?

Thank you so much in advance!

Best regards

Julia
0 Kudos
Hi Archana - we are also facing the same issue, please let us know if any solution to this issue. we have only 1 level of hierarchy.
patrickwenger
Participant
0 Kudos
I have the same problem. Works in Test mode (in Action Editor) but not in a process (same error as Satyajit and Pankaj have)

Thanks for any suggestions

Patrick
aamani_u
Explorer
0 Kudos
Hi archana.shukla

Guidance through this link (https://learning.sap.com/learning-journey/create-processes-and-automations-with-sap-build-process-au...) I have been learning SAP Build process automation with actions in my trial account. while connecting the action in Process automation project, I'm not able to get the details from the actions projects to add it in Inputs field.  For reference adding the screenshot.

 

If anyone has any idea on this please help me out. Thanks in advance.

 

HuyNguyen
Explorer
0 Kudos
Hi Archana,

I am facing issue when I call action from Automation, in action It works ok but when I call it from automation, I receive 401 Authorize although I configure destination. below is details my step.

Step 01 : Create action call API Business Partner of SAP HANA Cloud


Test on action configure is OK


Step 02: Create Destination HTTP at BTP Trial account and test connection is ok 


Step 03 : Import destination into SAP Build Process Automation.



Step 04 : Use action in automation and run test. This step, I receive 401 Authorization.




 


 

Informarton

I used

  • BTP Trial account

  • SAP S/4 HANA public edition.


 

Above is step by step I did and paste here for your support.

Kindly help to check and let me know any incorrect in my step configure.

 

Thanks.

 
HuyNguyen
Explorer
0 Kudos
Hi Archana,

I am facing issue when I call action from Automation, in action It works ok but when I call it from automation, I receive 401 Authorize although I configure destination. below is details my step.

Step 01 : Create action call API Business Partner of SAP HANA Cloud



Test on action configure is OK



Step 02: Create Destination HTTP at BTP Trial account and test connection is ok 



Step 03 : Import destination into SAP Build Process Automation.



Step 04 : Use action in automation and run test. This step, I receive 401 Authorization.







 



 

Informarton

I used

  • BTP Trial account

  • SAP S/4 HANA public edition.


 

Above is step by step I did and paste here for your support.

Kindly help to check and let me know any incorrect in my step configure.

 

Thanks.

 
HuyNguyen
Explorer
0 Kudos
Dear Archana,

I posted comment in this blog. I am facing issue 401 authorize although I configured destination and test in action ok. I used BTP trial account for SPA.

Can you check and help me ?
Sandeep_Verma
Explorer
0 Kudos
Hello officeofsatyajit pankaj.bagul9

Have you enabled CSRF and added URL prefix too in the action?

In URL prefix add the path below if not added already in BTP destination.

sap/opu/odata/sap/<SERVICE_NAME>/


 

Thanks