Skip to main content

Tips & Tricks: Closing an Application from within the Application

As in MS Word 2010, older versions than arcplan Enterprise 5 required shutting down via the menu, comparable to MS Word 2010 via “File” and “Exit”, in order to fully terminate the connections to the data base. If this is not done, objects may be locked in SAP or be unnecessarily blocked in other resources.

Since, however, this is no longer necessary as from arcplan Enterprise 5 and more recent, it is only a cosmetic process now.

On the Problem

The function EXIT terminates the connection to the arcplan session. It does not, however, as in other programs, close the browser window with the java client. This must be done manually by the user. Thus, the function EXIT by itself does not have any functional sense in a web application as exiting the browser window would also directly terminate the arcplan session.

Exiting an application

In order to use the function in the web to really “exit” an application, it is required to close the browser, as well. To this end, one may resort to the JavaScript order “window.close()” in the running website. The following JavaScript code must be supplemented on the start page of the application (as from arcplan Enterprise 7, this will not be overwritten by the Administrator anymore either):

….
<HEAD>
…<script type="text/javascript">

Function FensterSchliessen() {
           Window.close();
}


</script>

</HEAD>
<BODY>…

Via the formula STARTENJS introduced in arcplan Enterprise 6, this JavaScript function can be opened easier now. The command is: STARTENJS(“CloseWindow“)

In combination, these two functions form a clean possibility in order to close an application from within itself:

STARTENJS(“CloseWindow“)
EXIT()

Background Information

Maybe you have noticed that after closing the browser, the session is terminated. This is not mandatory, but it ensures that the session is terminated directly after closing of the browser. Otherwise, it could happen that follow-up functions are still being executed which prolong the termination of the session.

If, for example, a data base query is initiated after

STARTENJS, the session will only be terminated after the complete execution. This is actively prevented by the direct closing of the application. (arcplan Enterprise only recognizes the closing if all the following actions have been completely undertaken. That means: even if the browser is closed, arcplan could still be executing actions on the server. The application and/or the user seesions are not executed on the client but on the server).