cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

In SAP Screen Personas scripting, how to check if there is a text pops-up

thor64
Explorer
0 Kudos
505

Hi SAP Exports.
I do have a challenge with my SAP Screen Personas java scripting., I know exactly why there is a bug in a certain case but I do not know how to check for it in the java scripting.

I have a check using reading the status bar

var oStatusBar  = session.findById("wnd[0]/sbar");
so I catch errors etc. and in this case there are certain actions I should not do as try to jump to header or anything else like this which my refresh script is doing.
 
But my issue is that in a certain case this info box comes up
thor64_1-1732806001528.png

 


and when it does this then when it tries to refresh it should really just jump out of the refresh script. Now it is like it loops. Every time I click continue then the box which is an SAP box developed in ABAP code, repeatedly appears

But how can I check that now there is a box like this?

The status bar is empty so 

var oStatusBar  = session.findById("wnd[0]/sbar");

does not catch this. If I just could check somehow if a box was there then I know exactly how to fix the issue.

Thank you very much for your support
Thor

Accepted Solutions (0)

Answers (1)

Answers (1)

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert

If you want to find out if there is currently a popup window on the screen, you can do this like:

if (session.idExists("wnd[1]")) {
... do something
}

To interrupt your current script in such a case, the action could simply be return;

thor64
Explorer
0 Kudos

Thanks for the reply Tamas.

Now I know how to check on a box. Unfortunately it didn't work. I think SAP is doing something before and after this box so when I click Enter to the box, then the box disappears but now SAP is performing additional tasks to full fill the quotation in this case so it loops and come with the box again. It calls the SAP Persaonas refresh even though it is not finished. I have found out I need to press enter 3 times and then it passes. If I do not use SAP Personas it is just one click. And I know it is because my refresh script jumps to Header to get some data and it needs to wait until SAP has done what it should. If there as error in the status bar then I catch it but not this one where SAP is calling the refresh script, then come with a box, calling the refresh again before ending up updating the fields on the screen.

We probably need to check the ABAP code to preventing this box to pop-up more than one time.