Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Preloader: executing code asynchronous

Olivier_S
Participant
0 Likes
446

Dear experts,

I'd like to make a preloader for a heavy bsp which displays the steps being executed.

Basic scenario:

Client side, I want to make one ajax call to start the server side processing, after which a periodic (every x seconds) ajax call is made to retrieve the step currently being processed. Once the ajax call receives a signal the execution has ended, it redirects to the next page.

The steps are currently being tracked by making use of the shared buffer.

Problems/questions:

How to execute code asynchronously? The only clue I've found is to call a function module in a background task.

Is it possible to use the shared buffer's variables in a different task? When I use an FM in a background task to export to the shared buffer, I can't seem to import the values in the main code. Are there alternatives aside from a database table?

-


An example of the shared buffer code and FM in background task can be found here:

http://pastebin.com/m37b505a0

Edited by: Olivier Schietecat on Sep 9, 2009 11:22 AM

1 REPLY 1
Read only

Olivier_S
Participant
0 Likes
418

Decided to look back on this question, and close it.

The easiest way to make a preloader was to not do it asynchronous, but to use ajax to make each load of an object a separate http call.

This method of course, is only useable when doing custom code, so you can adjust its flow to it.

Having done other server-side scripting languages, I wish the http plugin was able to do this asynchronously. I guess this belongs to my wishlist, such as: "correct usage of back and forth browser buttons", "use html 5 for making sap mobile" and "separate html and css", "limit the usage of frames".