cancel
Showing results for 
Search instead for 
Did you mean: 

Select Data "in background" --> Multi-Tasking

michael_fallenbchel
Active Participant
0 Kudos

Hi experts,

I've got a selection screen I can choose which data the user wants to display.

Problem is, that the selection can take a few seconds...so I have this idea:

while user enters his selection, SAP should fill a internal table "in the background"...I mean while the selcction screen is showing, the internal table is filled in a separate task and then I can work with this => more speed because data is selected from the prefilled internal table...

I absolutely don't know if this is possible - and if so - how to do.

Anyone got an idea?

Regards

Michael

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>I absolutely don't know if this is possible - and if so - how to do.

Yes this is possible, but can be challenging. You can start work in a parallel work process either by submitting a background job or by calling a function module with the additional syntax STARTING NEW TASK. Either approach will free your Web Dynpro ABAP application to continue processing while the work is done in a completely separate user session.

The problem generally comes when you want to know when the parallel work is done. You can't push content from the server to the client in HTTP. Therefore unlike the SAPGUI you can't interrupt the client processing to let it know when the background processing is completed. In NetWeaver 7.0 and 7.01, you have to use the timedTrigger UI element to periodically check on the background task to see if it is complete (or to update the % complete). The timedTrigger can be somewhat disruptive however, as it locks the client side while the event occurs in the main Web Dynpro Phase Model.

In NetWeaver 7.02 (coming soon) we solve this problem with the Notification Service. This allows the client side to use AJAX to check on the status of a background job or parallel thread using a secondary channel that doesn't disrupt the main application. It also checks against a status buffer in the ICM so the processing never has to drop into ABAP or the WDA Phase Model. Only once the processing is complete or reaches a threshold you set, does a WDA event occur.

michael_fallenbchel
Active Participant
0 Kudos

Hi Thomas,

first - thanks a lot for your response!

I try to implenet a function in the WDA in a new task - no problem.

No I have to get the result of this function using the "CALLING xy ON END OF TASK"

Because it's a WDA, I can't use a form in the coding (not allowed), so I have to do it with a class (am I right?).

How to do this? I'm not sure how to realize the Returning parameters...

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Because it's a WDA, I can't use a form in the coding (not allowed), so I have to do it with a class (am I right?).

No you can't do it at all. You can't reestablish a connection with the client from the server. That is a limitation of HTTP in general. Therefore it doesn't make sense to start the Web Dynpro Phase Model from the server side. It can only be initiated by the client. So no callbacks into Web Dynpro objects.

You have to poll, from the client to check the status of your function module. Thta is why I suggested the use of the TimedTrigger UI element (and why the Notification Service in 7.02 is so important for these situations). You function module will need to write its status and returning information into the database temporarily so that it can be read from the WDA. No returning parameters.