<%@page language="abap" %>
<!DOCTYPE HTML>
<html>
<head>
<title>SAPGUI Launcher</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<script src="/sap/bc/ui5_ui5/ui2/ushell/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-theme="sap_belize"
data-sap-ui-libs="sap.m">
</script>
<!-- 中略 -->
</head>
<body class="sapUiBody" id="content">
</body>
</html>
var userAgent = window.navigator.userAgent.toLowerCase();
var appVersion = window.navigator.appVersion.toLowerCase();
var getBrowser = function() {
var browser = 'unknown';
if (userAgent.indexOf("msie") != -1) {
if (appVersion.indexOf("msie 6.") != -1) {
browser = 'ie6';
} else if (appVersion.indexOf("msie 7.") != -1) {
browser = 'ie7';
} else if (appVersion.indexOf("msie 8.") != -1) {
browser = 'ie8';
} else if (appVersion.indexOf("msie 9.") != -1) {
browser = 'ie9';
} else if (appVersion.indexOf("msie 10.") != -1) {
browser = 'ie10';
} else {
browser = 'ie';
}
}
if (userAgent.indexOf('trident/7') != -1) {
browser = 'ie11';
} else if (userAgent.indexOf('trident/8') != -1) {
browser = 'ie11';
} else if (userAgent.indexOf('edge') != -1) {
browser = 'edge';
} else if (userAgent.indexOf('chrome') != -1) {
browser = 'chrome';
} else if (userAgent.indexOf('safari') != -1) {
browser = 'safari';
} else if (userAgent.indexOf('opera') != -1) {
browser = 'opera';
} else if (userAgent.indexOf('firefox') != -1) {
browser = 'firefox';
}
console.log("User Agent: " + userAgent);
console.log("Appicaiton Version: " + appVersion);
console.log("Browser Name: " + browser);
return browser;
};
var isSupported = function(browsers) {
var browser = getBrowser();
for (var i = 0; i < browsers.length; i++) {
if(browsers[i] == browser) {
return true;
}
}
return false;
};
var launchSapgui = function() {
jQuery.sap.require("sap.m.MessageBox");
if (isSupported(['ie11', 'edge'])) {
sap.m.MessageBox.information("Please open the SAPGUI shortcut within 5 seconds.", {
title: "SAPGUI Launcher",
onClose: function(oAction) { window.close(); },
styleClass: "", // default
initialFocus: null, // default
textDirection: sap.ui.core.TextDirection.Inherit // default
});
window.setTimeout('window.close();', 5000);
location.href = "createSapGuiShortcut.htm?sap-client=100&sap-language=EN&transaction=<%= transaction %>";
} else {
sap.m.MessageBox.error("Your browser is not supported. Please contact your system administrator.", {
title: "SAPGUI Launcher",
onClose: function(oAction) { window.close(); },
styleClass: "", // default
initialFocus: null, // default
textDirection: sap.ui.core.TextDirection.Inherit // default
});
}
}
sap.ui.getCore().attachInit(function () {
var app = new sap.m.App("app", {
initialPage: "page"
});
var page = new sap.m.Page("page", {
title : "SAPGUI Launcher",
showNavButton : false
});
app.addPage(page);
app.placeAt("content");
launchSapgui();
});
data:
mysapsso2 type string,
shortcut_file type string,
host type string,
instancenumber type instanz-systemnr.
call function 'CREATE_RFC_REENTRANCE_TICKET'
importing
ticket = mysapsso2
exceptions
ticket_logon_disabled = 1
ticket_creation_failed = 2
kernel_too_old = 3
others = 4.
if transaction = ''.
transaction = 'SMEN'.
endif.
call function 'GET_SYSTEM_NUMBER'
importing
instancenumber = instancenumber.
runtime->server->get_location(
importing
host = host
).
concatenate '[System]' cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file 'Name=' sy-sysid cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file 'Client=' sy-mandt cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file 'GuiParm=' host into shortcut_file.
concatenate shortcut_file instancenumber into shortcut_file separated by ' '.
concatenate shortcut_file cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file '[User]' cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file 'Name=' sy-uname cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file 'at="MYSAPSSO2=' mysapsso2 '"' cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file '[Function]' cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file 'Command=' transaction cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file '[Options]' cl_abap_char_utilities=>cr_lf into shortcut_file.
concatenate shortcut_file 'Reuse=0' cl_abap_char_utilities=>cr_lf into shortcut_file.
runtime->server->response->set_header_field( name = 'content-type' value = 'application/x-sapshortcut').
runtime->server->response->set_cdata( data = shortcut_file ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |