on 06-02-2016 9:02 PM
Dear All,
I know there was couple discussion threads on how to get hour glass / spinning wheel / three dots for long running scripts in a transaction. Our requirement is to create Physical Inv documents (MI31) automatically based on the selection variants. This almost takes 3 - 4 minutes to create the documents. Meanwhile there is no indication in the personas screen that the script is running. Users are getting confused if the browser is frozen or is there any issue in the screen as it does nothing.
Is there any possible work around to notify the user on long running scripts in the buttons event?
Regards,
Raj
Hi,
with Personas 3.0 SP03 and a compliant kernel you will get the loading animation even during long running scripts.
However, for such long running scripts my suggestion would be to split your script up in logical chunks (for instance for every created task) and update the screen asynchronously. I will give a sample script that will work in SP02. The tricky part is to figure out the right timeout values (1000ms) works for me. Disclaimer: This only works in the SAP Gui for Html and uses an internal API that can change any time.
var taskStrings = ["first step", "second step", "third step"];
var index =0;
var text ="";
function doTask(){
// 3s pause
var time = (new Date()).getTime() +3000;
while ((new Date()).getTime() < time );
//update the UI
text += taskStrings[index]+ " completed.\n";
session.findById("wnd[0]/usr/wlblPersonas_1453929017141").text =text;
sap.personas.scripting.executeScriptInternal( {src:""});
// schedule the next task
if (++index < taskStrings.length){
setTimeout(doTask,1000); // the 500ms delay is needed to allow the screen update thread to get scheduled
}
}
session.findById("wnd[0]/usr/wlblPersonas_1453929017141").text = "";
setTimeout(doTask,1000);
Best Regards,
Clemens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Clemens,
Thanks for your reply. The problem for me is that the documents get created in the next page. There is a navigation from the Search screen to the result screen. When I click on Generate button in the search screen it navigates to the next screen to show the list of Materials and their corresponding PI document #. Also, in some cases the item list could be short and also based on serialized materials the time could differ.
With the above scenario...I doubt this would work...your thoughts?
That's right Clemens. When I run the application directly in SAP GUI for Windows it takes 3 minutes for this transaction. In GUI at least the spinning wheel is there but here I get the 3 blue frozen dots.
We are already on 742 Patch 400. We are going live in a month so I don't think upgrading to SP03 is an option at this point of time.
Does SP03 offer this spinning wheel for running scripts by default?
Regards,
Raj
Thanks Clemens Gantert. We have upgraded our Personas to SP3 and are on Kernel 401. I still continue to see the same behavior.
I upgraded the flavors from 302 to 303. Cleared the cache and tried running the application and it's still the same behavior. I also ran some standard transactions without any custom flavors and some tables like MSEG / MARD which are really huge and would take atleast 10 seconds to load the data....I don't see the spinning for either of them.
Am I missing some settings?
Regards,
Raj
Hello Raj,
I vaguely remember that in 401 the loading animation still would not show for long running standard processes or transactions.
Would you please confirm that the loading animation is showing for long running personas scripts e.g.:
var time = (new Date()).getTime() +10000; // wait 10s
while ((new Date()).getTime() < time );
Thanks,
Clemens
Hi,
this is really odd. The recording attached to this post was taken on a 7.42 PL401. I am debating with myself on what to recommend to you. You could upgrade to the latest 7.42 patch level, but I can't guarantee that it will work either.
I guess the best course of action for you is to open a CSS incident for this (component "BC-PER"). I will route the incident to the kernel team then we'll know, but they will probably also refer to a later kernel as well.
Best Regards,
Clemens
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.