Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Aashish28
Contributor
This blog presents one of the approach for initiating SAP Build Process Automation from an S/4 Hana On-Premise system using ABAP code.

As you know, SAP Build Process Automation is the unified offering in SAP BTP that combines the capabilities of SAP Workflow Management and SAP Intelligent RPA and its staring point can be FORM or API.

You can read more on SAP Build Process Automation (here).

Prerequisite:

  1. Subscription of SAP Build process automation in BTP Trial Account

  2. S/4 Hana on-premise system with required access


To illustrate this, I have developed a sap build process which contain workflow rather than process automation, with its trigger point being an API.

Note: Numerous blogs and learning resources are readily available for SAP Build processes automation, which I won't reiterate here.

I will use the abbreviation SBPA for referring to SAP Build Process Automation.

Steps to be performed on SAP BTP:

Step 1.  Creating simple build process for Employee and deploy.

It has a form which display essential information such as Epmid, Name, Department and Status. This information we receive from build process instance payload. After receiving the information, you can either approve or reject it to finalize the process.


SAP Build Process


Step 2. Please make a copy of the triggering point URL as it will be required to initiate the instance.


 

Steps to be performed on S/4 Hana on-premises system :

 

Step 1: Establish an SM59 Destination (type G) in your S/4 system to obtain an OAuth token for SAP Build process automation. This token will use in sub sequent request to initiate the instance.



You can get host/token URL, user name(client id) and password(client secret) from service key instance of SBPA.


 

Step 2 : Create ABAP class with 2 methods

a. Get oAuth token using destination

b. Trigger SBPA instance



You can get full code from my Github repo (SCN-Sample-Code)

 

Step 3 : Create sample SE38 program to test.


 

Lets execute it.

Upon successful initiation of the instance, you will receive the instance ID along with its corresponding status.


 

To verify the successful initiation, you can open the SBPA Monitor tab and check the work item in the Inbox app.


 


You can approve/reject to complete the process.

 

Conclusion : 

We have successfully triggered the SAP Build process from your S/4 HANA on-premise system using ABAP code. This approach can also be applied to trigger instances from BAdi instead of a custom program. Additionally, you can utilize the same approach to trigger other instances based on SAP BTP services.

Are you interested in getting to use more Low-Code/No-Code capabilities with SAP BTP?

Are you interested to keep your S/4 Hana core clean ?

Lets learn and share!

 

Regards,
Ashish
12 Comments
Frank1
Participant
excellent sharing
MustafaBensan
Active Contributor
Hi ashish.ahire,

This is a good description of a technical approach for triggering an SAP Build Process Automation workflow from ABAP.  I would be interested to know in your experience, any examples of real business scenarios that have required implementation of this approach.

Thanks,

Mustafa.
Aashish28
Contributor
0 Kudos
Hello mbensan,

I had a custom business process scenario related to procurement where workflow was getting started from ABAP and its steps were changed/completed based on 3rd party applications ( outside of sap ), There I have implemented this approach.

BR,

Ashish
MustafaBensan
Active Contributor
0 Kudos
Hi ashish.ahire

Thanks for the clarification.  So that sounds like a hybrid scenario where part of the business process is executed in the on-premise S/4HANA business workflow which then triggers the SBPA workflow for the 3rd-party via ABAP.  Have I understood correctly?

Regards,

Mustafa.
Saswata89
Participant
0 Kudos
Hey Ashish,

Intriguing write up but your GitHub repo isn't actually taking us to github. Could you please check and update?

 
Aashish28
Contributor
Hello sas ,

Thanks for pointing, Please check again.
Aashish28
Contributor
Yes mbensan
MustafaBensan
Active Contributor
ashish.ahire, does that mean you have 2 Inbox apps, one in the S/4HANA on-premise Launchpad and one in the SBPA Launchpad?
Aashish28
Contributor
0 Kudos
Depends on scenario or you can use Task center.

https://community.sap.com/topics/task-center/faq

 

 
0 Kudos
Hi Ashish Ahire,

This is great idea to trigger SAP Build Process Automation from S/4 Hana on premises using ABAP.

I am trying to do the same using the steps you have given. I have created the destination when I test the connection I was getting the error. Can you please tell me how to add client id and client secret id (OAuth Authorization) in destination(sm59).


Thanks,

Abhilash
RBoninineto
Discoverer
0 Kudos
 

Hi Abhilash,

Congratulations for your post ! Very helpfull.

 

I just will add some information about a error a had.

The S4 server off my client, have network blockers to access some Hosts. When I try to call the API URL creating the Client by the URL, occurs a error:

 

"Direct connect to c6-application-dev.authentication.XXXX.hana.ondemand.com:443 failed: NIECONN_REFUSED(-10)"


But if I use another Destination, with the same URL to call my API. All works fine.

Destination type is G, with SSL active and no user and no password..



Att,

Renato Bonini

 
sangram007_
Discoverer
0 Kudos
Great Information. Good work Ashish.
Labels in this area