|Sample code, images||Restrictions, SAP Release, SAP GUI version, GuiXT version|
|32 Displaying a progress indicator with GuiXT Viewer
If a GuiXT script or InputScript executes “Call” statements that can take longer than 1 or 2 seconds, it is desirable to give the user some kind of feedback during this waiting time, indicating that the system is still working.
With GuiXT Viewer you can display a small HTML page during the execution of the Call statement(s) that shows a growing progress bar:
This progress bar does not really show the percentage of the work that has already been completed, since we do not receive this information during the execution of the Call statement. It simply makes visible the fact that work is still in progress. You need to make some assumptions on the total time needed in order to choose a reasonable speed for the progress indicator. Our sample implementation assumes a maximum of 60 seconds.
If you execute numerous Calls that each require only a short time, you can design a more intelligent progress indicator with the same technique, sending the completion percentage from the GuiXT script to the HTML page with ConnectHTML statements. Our sample code (right hand side) implements the simpler approach of a progress indicator that reflects the time only.
The GuiXT script looks as follows:
// Display the progress indicator popup
// Do your work
// Delay one second if necessary
// Close the progress indicator
Please click on the link in the next column to get the HTML coding of a sample progress indicator page (left click to display the page, right click and “save as” to download the coding).
HTML page “progressbar.html”
InputAssistant and Viewer