on 07-28-2016 10:34 AM
Hello,
I'm a newbie to Screen Personas and try to get an Javascipt check if a certain control exists or not.
Is there a way to catch the error "control not found" and react (in Javascript) accordingly ?
Regards
Currently on Personas 3.0,
I use try .. catch:
try {
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:*/ssubSUB_LEVEL:SAPLCOIH:*/cmbPersonas_146885648247470").enabled=true;
catch (lo_error) {
//Error handling here
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
session.idExists works fine to find out whether a control is present, so no real need for try...catch to do this.
Hi,
I got the answer from SAP.
Instead of IdExists, you have to use idExists (lowercase i). Script validation wont find it, but UpperCase I leads to a dump.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
I tried the idExists
if(session.IdExists("wnd[0]/usr/subMAINSCREEN:SAPLOM_NAVFRAMEWORK_OO_OBJ:1200/subWORKSPACE:SAPLOM_NAVFRAMEWORK_OO_OBJ:0200/btnCLOSE_FOLDOUT_BUTTON"))
{
alert ("Close possible");
}
else
{
alert ("Open possible");
}
Validation of the script showns no error. As soon as i launch the script i get the error
Error during script execution:
anonymous@[AppID:ZAPG2]>[Flavor:ZAPG2]>[Script:wnd[0]/scrptPersonas_1-detailansicht_close]:2:4
sap.personas.scripting.initialize/scriptingEngineModule/self.executeScriptInternal@http://sapa01t16.host.magwien.gv.at:8016/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/...
sap.personas.scripting.initialize/scriptingEngineModule/sap.personas.scripting.executeScriptInternal<@http://sapa01t16.host.magwien.gv.at:8016/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/...
sap.personas.fw.its.scripting.Runtime.prototype.execute/<@http://sapa01t16.host.magwien.gv.at:8016/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/...
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thomas,
I'm new to SP too, and had a similar issue whereby I needed to know it a PM maintenance order tab was active or not.
The quickest way I found was to use the Object Selector tool in scripting to select a field. Then I check if that field is still active:
Here's the code I used which seems to work:
if (session.idExists("wnd[0]/usr/subSUB_ALL:SAPLCOIH:*/ssubSUB_LEVEL:SAPLCOIH:*/tabsTS_1100/tabpIHKZ/ssubSUB_AUFTRAG:SAPLCOIH:1120/subHEADER:SAPLCOIH:0154/ctxtCAUFVD-INGPR"))
{
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:*/ssubSUB_LEVEL:SAPLCOIH:*/cmbPersonas_146885648247470").enabled=true;
}
else
{
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:*/ssubSUB_LEVEL:SAPLCOIH:*/cmbPersonas_146885648247470").key=" ";
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:*/ssubSUB_LEVEL:SAPLCOIH:*/cmbPersonas_146885648247470").enabled=false;
};
.
Any better suggestions would be most welcome.
PeteA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys,
I tried the idExists
if(session.IdExists("wnd[0]/usr/subMAINSCREEN:SAPLOM_NAVFRAMEWORK_OO_OBJ:1200/subWORKSPACE:SAPLOM_NAVFRAMEWORK_OO_OBJ:0200/btnCLOSE_FOLDOUT_BUTTON"))
{
alert ("Close possible");
}
else
{
alert ("Open possible");
}
Validation of the script showns no error. As soon as i launch the script i get the error
Error during script execution:
anonymous@[AppID:ZAPG2]>[Flavor:ZAPG2]>[Script:wnd[0]/scrptPersonas_1-detailansicht_close]:2:4
sap.personas.scripting.initialize/scriptingEngineModule/self.executeScriptInternal@http://sapa01t16.host.magwien.gv.at:8016/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/...
sap.personas.scripting.initialize/scriptingEngineModule/sap.personas.scripting.executeScriptInternal<@http://sapa01t16.host.magwien.gv.at:8016/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/...
sap.personas.fw.its.scripting.Runtime.prototype.execute/<@http://sapa01t16.host.magwien.gv.at:8016/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/...
Regards
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.