Showing results for 
Search instead for 
Did you mean: 

Work on SAP with different processes without closing it.

Level 2


i have the following dynamic:

different "sub-processes" work on the same business object related to SAP. Right now Every "sub-process" opens and closes SAP, increasing the time needed by the main process that calls those "sub-processes" to complete its operations.

I tried to avoid closing SAP once opened and just attach to it since the business object used is the same for all "sub-processes", the problem i face is that attach operation fails no matter what i try, even using SAP process name "saplogon.exe".

Is there something wrong in my tests? How can i manage different processes to operate on SAP while avoiding opening and closing it for each process?





Hi Ma, as you've probably realised, each subprocess runs in its own scope and its object instances are separate from any others. In other words, even though two subprocesses run within the same parent process, and use the same objects, they do not use the same object instances, each subprocess has its own instances.

The other key point is that once a subprocess ends, all scope is released, so even if you call the same subprocess again, there will be no memory of the previous call, everything in the subprocess will be new.

By contrast, an object remains in scope for the lifetime of the parent process. This is why an object can 'remember' values from a previous call.

So, you might consider moving the contents of your subprocesses into a new object, to create a new layer of 'wrapper', 'component' or 'super' objects. This type of object does not have anything set up in App Modeller and does not launch or attach, it merely acts as a container for a sequence of steps.

Level 2

Hi John,

thank you for your reply and suggestions. Following your propose of moving subprocesses execution inside a wrapper business object, i could definely do it and i sounds a very fast one too. Meanwhile i tried another way, attach SAP using window title and child index and it worked but it requires to carefully handle the windows titles while keeping track of child indexes that can change during runtime based on closing and opening operations.