SAP Builders Discussions
Join the discussion -- ask questions and discuss how you and fellow SAP Builders are using SAP Build, SAP Build Apps, SAP Build Process Automation, and SAP Build Work Zone.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BPA - Environment Variables

hugo86
Explorer
325

Hi All,

I'm working on an approval workflow on BPA (a simple Business Process with a step for an approval) and as of now, the approvers are simply "hardcoded" in the approval step:

 

hugo86_7-1730978914948.png

 

As is, if we release and deploy the project and we want to change the approver in the future we would need to undeploy, go into the step and update the recipients, release and deploy again a new version of the project. Is there a cleaner way of doing this?

I was investigating the use of Environment Variables but I'm note sure if I understand the goal of these:

hugo86_3-1730976587002.png

My idea was to have a variable for which I can define its value without having to deploy a new project version each time. I was expecting for this string environment variable to be available as a process input or variable to be referenced in the different steps, but I can't find it anywhere. Ideally, I'd like to change the value of this environment variable having it referenced in the approval step instead of a 'harcorded' user ID.

In Task Automation projects though I can see and use the environment variables that I define, but not in Business Processes.

hugo86_5-1730978466343.png

 hugo86_6-1730978477624.png

I have been navigating the SAP Help Portal regarding environment variables but can't figure out how to use them, or if I can use them to achieve what I explained in this post.

If the intent of environment variables is not the above, does anyone have a better way of updating recipients of a task without having to deploy new project versions? Maybe @Dan_Wroblewski, any ideas?

Thanks!

5 REPLIES 5

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
248

The values of environment variables are set when you deploy the process, so I don;t think that would meet your needs.

Off the top of my head, you could create a decision in a separate project, and then create a dependency to the decision in your project to take the output of the decision. Everytime you want to change the user you would just need to update the decision project. See this Devtoberfest session where they talk about making decisions as dependencies: https://www.youtube.com/watch?v=ajbnWJvVNuQ

Not sure this is the best, since you still have to deploy the decision each time, but that is simpler than the entire project.

If this isn't clear let me know. I also see if there is a better way.




--------------
See all my blogs and connect with me on Twitter / LinkedIn

0 Kudos
204

Hi Dan,

Thanks for the quick reply.

The downside of this is that you would still need to redeploy the project, unless I'm missing something; if you update the decision project it would create a new version, and you won't be able to update the dependency to the newer version on a deployed project, so you will end up deploying again regardless.

hugo86_0-1731332519954.png

I do think this is actually valuable information, on bigger projects with complex approver determination rules it seems good practice to keep this separate from the business process workflow, so thank you for the tip!

It seems that for now all we can do is having a service with a table of approvers maintaned somewhere else, and simply calling its content from BPA

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
195

A simpler way to do it would be to create a group in the Custom IDP with any users who can approve, and specify this group as the approvers. Whenever you want to change the users you just change the users in the group.




--------------
See all my blogs and connect with me on Twitter / LinkedIn

Jakub_Roguski
Product and Topic Expert
Product and Topic Expert
0 Kudos
150

Environmental variable will not work for you. The IDP / IAS based solution, proposed by Dan will work, but each change will require IDP or IAS admin privileges. Another solution, where approvers could be managed by designated person without any IDP / IAS admin privileges would be as follows:

1. get a database like HANA Cloud or any other, where you can expose the table vis ODATA and create the approvers table.

2. Build approvers administration app in Build Apps, which uses the approvers table exposed by ODATA and give approvers administrator access to this app.

3. Let approvers administrator put approvers in the table.

4. Create ACTION in SBPA to get data by ODATA from approvers table.

5. Use process variable to store the approver fetched by ACTION for the process.

6. Use this process variable in the "Approvers" field of your approval form.

This solution much more complicated than the one proposed by Dan, but it does not require IDP / IAS admin privileges to maintain approvers.

hugo86
Explorer
0 Kudos
146

Hi Jakub,

Yes, ODATA is another possibility which probably we will end up going for. I was exploring and hoping that we could achieve it by just using the tools that BPA has within it, but sadly couldn't make it.

Thank you both!