If you have to start a backend process from your FPM application, which takes longer than one second you have two options:
The first option causes a bad user experience, the 2nd a usability issue: When the task is completed, how do you inform the user? You could add a 'refresh' button to your application allowing the user to request the current status of the background task. Or you could simply check the status with every subsequent roundtrip. Or you can trigger recurring roundtrips simply for status checking by using a timed trigger.
Of course the appropriate option depends on the use-case.
Since Netweaver 7.31 SP07 FPM now offers asynchronous events, which offers a better solution for this issue. You can simply trigger an FPM event when the task is done.
To do this you have to do the following steps:
data: lv_id type wdr_notification_id.
lv_id = mo_fpm->register_asynchronous_event( lo_event ).
call function 'MY_ASYNCHRONOUS_TASK' starting new task mytask
exporting
iv_notification_id = lv_id
...
cl_wd_notification_service=>update_event_status(
exporting
event_id = iv_notification_id
event_status = cl_wd_notification_service=>c_status_done ).
That's it.
If the functionality is available in your system you can also have a look at the test application FPM_TEST_ASYNCHRONOUS_EVENT which shows this feature in a very simple application.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
25 | |
17 | |
13 | |
7 | |
7 | |
7 | |
6 | |
6 | |
6 |