Solved SAP Session Handling

VALMAN

New Member
Hi, I'm building a robot with BP 6.5 that needs to open, manage and close three SAP sessions not at the same time. Different transactions are invoked for each session. Opening with CTRL + works fine. However, when the robot switches from one session to another to insert the transaction, it returns errors: that is already connected to the element, it does not find the target application, it does not write the new transaction code in the box without the apparent reason ... I tried unsuccessfully to use attach and wait with sleep, the wait for process window, recover to intercept the exception with no result... could you help me solve this problem? Thank you so much.
 

Jitendra

New Member
Hi,

Just to clarify - are you killing SAP session each time after completion of action and opening up new session for the new TCode?
 

VALMAN

New Member
Thank you Jitendra. I Need to keep the first session open, since this calls the others. Other sessions can be killed, though i have to call them very often. Thanks.
 

ShubhamJangam

New Member
Hi Valman

1.If you have spied the element using SAP Mode.
2.Check for the ID attribute --> change the value of 'sec[0]' from value.
3.Here 0 represent the session.
Example:
for 1st session 0
for 2nd session 1
use dynamic match type to control it from process.

Regards
Shubham
 

Jitendra

New Member
Does killing the other sessions and only keeping the main session works? Try activating the main session window and check if that works or gives out any error. If the main session window is not attached try attaching it first and then carry out write TCode action.

If you have tried Attach-Activate-Write - what error do you get?
 

VALMAN

New Member
The problem is that it can't attach to the second/third/etc session from the beginning. By the time a session is opened with ctrl +, the attempt to attach to them results in "already attached" or "can't find the target application". My flow contains attach, activate, and i even tried sleep before them, unsuccessfully.
 

Sachin_Kharmale

Active Member
The problem is that it can't attach to the second/third/etc session from the beginning. By the time a session is opened with ctrl +, the attempt to attach to them results in "already attached" or "can't find the target application". My flow contains attach, activate, and i even tried sleep before them, unsuccessfully.
We are also facing same problem so we have solved problem with bellow approach
if the Session is changing then you need to manage the spied element ID attribute value In Application Modeler as dynamic
if you are in First Session then your element ID look like these
/app/con[0]/
ses[0]/user/.....
if you are in Second Session then your element ID look like these
/app/con[0]/
ses[1]/user/....
if you are in Third Session then your element ID look like these
/app/con[0]/
ses[2]/user/....

So you need to manage ses[*] value as dynamic remaining part will be same for the attribute.
I hope will it will help you.
 

VALMAN

New Member
We are also facing same problem so we have solved problem with bellow approach
if the Session is changing then you need to manage the spied element ID attribute value In Application Modeler as dynamic
if you are in First Session then your element ID look like these
/app/con[0]/
ses[0]/user/.....
if you are in Second Session then your element ID look like these
/app/con[0]/
ses[1]/user/....
if you are in Third Session then your element ID look like these
/app/con[0]/
ses[2]/user/....

So you need to manage ses[*] value as dynamic remaining part will be same for the attribute.
I hope will it will help you.

Thank you Sachin!! I'll give it a try!
I'll let you know!
Have a nice day!
 

VALMAN

New Member
We are also facing same problem so we have solved problem with bellow approach
if the Session is changing then you need to manage the spied element ID attribute value In Application Modeler as dynamic
if you are in First Session then your element ID look like these
/app/con[0]/
ses[0]/user/.....
if you are in Second Session then your element ID look like these
/app/con[0]/
ses[1]/user/....
if you are in Third Session then your element ID look like these
/app/con[0]/
ses[2]/user/....

So you need to manage ses[*] value as dynamic remaining part will be same for the attribute.
I hope will it will help you.

It Worked! Thanks again!
 
Top