ApplicationScope in child workflow closes the scope in main workflow as well

I have a multiple automations using Sap-Bapi Activity. Some Sap-Bapi calls are common across many automations, so I want them to put it inside a separate workflow which can be called from many places.
To make a bapi call, I have to enclose the activity in SAP Application scope. So I have the SAP Application scope in main workflow and SAP application scope in the child workflow. The problem I am facing is that when my child workflow gets called, it gets the results to the main workflow and closes the scope not only for the child but also for the parent. So any subsequent bapi calls in the main workflow hang and then throw an error.
Am I doing something incorrectly or is this a bug in Studio that should be fixed.

Hello @myadav

Plz check whether you have mapped all the arguments properly. Also plz run in debug mode and check whether its happening for some particular activity.

Thanks

The child workflow works fine. It gives me correct results. Its subsequent bapi calls in main workflow that fail. I can change the order of child workflow call and the failing bapi call shifts accordingly. For example, I have 5 bapi calls in main workflow. If 1st call is to child workflow, the second bapi call fails. If I change the order and make 3rd call go to child workflow, then my fourth call in main workflow fails.

@StefanSchnell, @LevKushnir Can either of you comment on this issue and suggest a workaround

@LevKushnir

Hello Lev,
I want to try the scenario from @myadav but I get the following error. So I tried to set only one parameter in ExistingSAPConnection to reproduce the error and as you can see, only one parameter is set, as described in the documentation, but the error occurs. Is that correct? I assume it is a dissonance between required arguments and overload groups attributes.
Thanks and best regards
Stefan

image

Hello @myadav,

I tried to use nested BAPI calls and all I transfer is the variable SAPConnection between the nested BAPI calls.

Here the main sequence:

image

Here one of the sub sequences also with a nested BAPI call:

I tried it multiple times and all works as expected. As you can see I use RFC_PING for testing, not really a BAPI but for testing okay.

Did you follow the advice in the documentation: β€œIn order to be able to pass the IConnectionService variable to a subsequent scope, this second activity must be nested in the scope that holds the initial connection or inside workflows that are invoked from this scope.”?

Best regards
Stefan

1 Like

Thank you @StefanSchnell. Your screenprint is very helpful. I was not passing the ExistingSapConnection parameter. I was setting up the SAP connection again similar to the parent one.
I am going to try it out.

1 Like

My Issue is resolved. Thanks for your help @StefanSchnell

1 Like

@StefanSchnell, how did you resolve the error related to overloaded groups? In my workflow, I removed the value true seen in Stateful Connection and it worked fine. Then I converted that workflow to a library and the same error pops up again. I am able to publish the library to Orchestrator without any errors. But when I try to use the activity in another project, this error pops up.

1 Like

@myadav

Hello Yadav,
I guess that it worked for you initially was because data was available in the cache.
Let us discuss further outside this thread about my experimental approach.
In the meantime, you could open an error message here in the forum.
Best regards
Stefan

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.