on 10-08-2019 8:45 AM
I am trying to execute sap gui script embedded in JavaScript from a SAP form in transaction CKECP
in SAP ERP R/3. For maintaining the code I use transaction CKCM.
However, this sap gui script embedded in JavaScript, seems not to connect withObject("SAPGUI") and sapgui.GetScriptingEngine. Does anyone have an example of gui script code executing from CKECP screen? Or any ideas on why it isn't working? Below is the JavaScript that I tried to apply. Thank you in advance
<html>
<head>
<script language="javascript" type="text/javascript">
function test_sapgui() {
if (typeof(application) == "undefined") {
sapgui = GetObject("SAPGUI");
application = sapgui.GetScriptingEngine;
}
if (typeof(connection) == "undefined") {
connection = application.findById("/app/con[0]");
}
if (typeof(session) == "undefined") {
session = application.findById("/app/con[0]/ses[0]");
}
if (typeof(WScript) != "undefined") {
WScript.connectObject(session, "on");
WScript.connectObject(application, "on");
}
application.findById("/app/con[0]/ses[0]/wnd[0]").maximize();
application.findById("/app/con[0]/ses[0]/wnd[0]/tbar[0]/okcd").text = "/osbwp";
}
</script>
</head>
<body>
<form>
<p><button type="button" onclick="test_sapgui()">Test executing SAP GUI commands</button>
</form>
</body>
</html>
@dehmagn Did you find any solution for this? If yes then can you please help me with it?
I am trying to do the same, eliminating VbScript by using JS for SAP dialog so that it can run on edge or chrome browser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
8 | |
7 | |
5 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.