cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Message Numbers to enter through status bar messages SAP Personas 3

former_member105930
Active Participant
0 Kudos

hi all,

I have a scenario that once a transactional screen has been reached a variety of status bar messages could be displayed once 'Enter' has been pressed.

One simple example is to script entering an employee number in transaction PA30 and then check the status bar message to see if the "Person is already being processed" type message is displayed.

For this example in SAPGUI the message no is this: Message No. PBAS_SERVICE001

so for my simple script I can put this:

//check for the message that another user is in the record

if (session.findById("wnd[0]/sbar").messageNumber = 001) {

//if the message is displayed overwrite with this value 

session.findById("wnd[0]/usr/ctxtRP50G-PERNR").text = "42006892";

}

so if the message appears, overwrite the employee number with the value of 42006892.

But this does not work. I have also tried using in the script the full message no of PBAS_SERVICE001 but that does not work either. In both examples the employee number does indeed get overwritten with the 42006892 regardless of whether the message is displayed in the status bar or not.

In my more complex example I wish to do a loop to check the status bar for the message " Record Saved", and if there is a different message, capture the message, press enter, and then check for the Record Saved message again.

I'm struggling to understand how to capture these messages if the message Number I'm using does not work.

Any ideas anyone?

thanks,

Ian

Accepted Solutions (1)

Accepted Solutions (1)

former_member105930
Active Participant
0 Kudos

I have now solved the first script by changing the value 001 to be a string "001" and it now works.

I should now be able to do my looping.

Am marking my original question as being answered.

Answers (0)