Application Development 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: 

What is the difference between CALL FM in BACKGROUND TASK and UPDATE TASK?

Former Member
0 Kudos

I guess, if I called 2 FM in background task, both of them will be executed one by one.

if I called 2 FMs in update task, only the last FM will be executed.

Isn't it?

I got a scenario here, I use a export to DATABASE to flag sth. This flag will be checked in a EXIT, which will be called several times. This part of logic will be also called in background task FM. How can I delete this DATABASE flag after all the execution of the program?

8 REPLIES 8

former_member182485
Active Contributor
0 Kudos

Hi,

Call FM in background creates a session in background mode in seperate LUW , you can view this in SM58.

If the FM is remote enabled you can achive parallel processing using this technique.

A FM callled on Update task will get executed after the first commit work but the attribute of the FM should be Update Module

Regards

Bikas

0 Kudos

> Call FM in background creates a session in background mode in seperate LUW , you can view this in SM58.

> If the FM is remote enabled you can achive parallel processing using this technique.

[IN BACKGROUND TASK|http://help.sap.com/abapdocu_702/en/abapcall_function_background_task.htm] doesn't facilitate parallel processing, it is used to maintain the transactional integrity of the RFC call. Hence the name tRFC or "transactional" RFC!

Parallel processing is possible via the [STARTING NEW TASK|http://help.sap.com/abapdocu_702/en/abapcall_function_starting.htm] addition.

0 Kudos

Is there any way to check whether a FM called in background task has been finished?

0 Kudos

Yes, you can use SE30 and after process you can search the msg use the FM name.

How to use SE30, u can choose the Transaction at SM35, and process then back, and click at Evaluate, then choose Hit list, you will find the msg.

0 Kudos

got the FM ID_OF_BACKGROUNDTASK to get the TID then I think I can check the status of it with FM STATUS_OF_BACKGROUNDTASK .

hi Eric,

Is FM called in BACKGROUND TASK the same as we schedule a program run in BACK GROUND?

0 Kudos

got the FM ID_OF_BACKGROUNDTASK to get the TID then I think I can check the status of it with FM STATUS_OF_BACKGROUNDTASK .

Correct.

Is FM called in BACKGROUND TASK the same as we schedule a program run in BACK GROUND?

No, it is not the same. You can draw analogy of BACKGROUND TASK to CALL FUNCTION ... IN UPDATE TASK. Read the online documentation for further details.

0 Kudos

hi Suhas Saha , thanks for your reply. But it seems that once the FM executed successfully, the data will be deleted from the DB table, and I can not get any thing from the FM STATUS_OF_BACKGROUNDTASK.

should I use a ENDLESS LOOP to check the status of the FM?

0 Kudos

Hi Yichao,

You could check with your BASIS team and find out the type(success/failure) and no of records that they maintain for TRFC logs, i guess the Tcode is RZ21.

I am not sure how you can achieve this using endless loop.

Regards,

Chen