cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas 3.0 PL3 - GUI Script Issue

erin_mogg
Participant
0 Kudos
365

I've created the following script in SAP Screen Personas:

//Define Variable

var SoldTo=session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/subPART-SUB:SAPMV45A:4701/ctxtKUAGV-KUNNR").text;

//If Sold-to Field is blank, display message. Otherwise, go to Header->Conditions Tab

if (!SoldTo) {

alert("Please enter Sold-to Party to view Header Conditions");

}else{

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG/ctxtRV45A-MABNR[1,0]").setFocus();

session.findById("wnd[0]/mbar/menu[2]/menu[1]/menu[7]").select();

}

This script executes properly in Webgui:

However, I'm getting the following error when I run the script in GUI:

Does anyone have any ideas on how to resolve this issue? I'm on SAPGUI Patch 13 and Screen Personas PL3.

Thanks,
Erin

View Entire Topic
Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert

Apparently the SAP GUI doesn't like the 'alert' command? Try replacing it based on this KB article.

erin_mogg
Participant
0 Kudos

Thanks, Tamas!

I was following the example in "Error Handling" in the wiki - but you're right, it seems as though the GUi doesn't like it. I rewrote the script with the dialog message example you shared and it is working fine.