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

Difference between calling a function module in background task and update

Former Member
0 Likes
12,362

Hi experts,

Can someone explain me the basic difference between calling a FM in background and update tasks?

Also what is the advantage of using backgroud RFCs over the above 2.

Thanks in advance,

reddy

1 ACCEPTED SOLUTION
Read only

Former Member
5,063

This is essentially a difference of synchronization with the main program calling this FM.

For Update task, we specify explicitely that we want to update some rows in a database table. But Update task is essentially for waiting that all tasks to do before are done and updating database at the end. The main point is that MF called in Update task wait for a COMMIT WORK to be executed.

On the other hand FM in background task are executed immediatly and are not specific to updating database table : it can be a function that would return some values or something else like that.

If you want to see more about difference between background jobs / update jobs, you can also have a look at transaction SM51. Here you will see all the servers composing your SAP instance and what kind of task they can execute :

- background jobs corresponds to BATCH

- update tasks corresponds to UPDATE

Those 2 kinds of tasks stands not necessarily on the same server...

Best regards,

Samuel

4 REPLIES 4
Read only

Former Member
0 Likes
5,062

I went through the sap help but really couldnt understand all. Can you please explain me!

Read only

Former Member
5,064

This is essentially a difference of synchronization with the main program calling this FM.

For Update task, we specify explicitely that we want to update some rows in a database table. But Update task is essentially for waiting that all tasks to do before are done and updating database at the end. The main point is that MF called in Update task wait for a COMMIT WORK to be executed.

On the other hand FM in background task are executed immediatly and are not specific to updating database table : it can be a function that would return some values or something else like that.

If you want to see more about difference between background jobs / update jobs, you can also have a look at transaction SM51. Here you will see all the servers composing your SAP instance and what kind of task they can execute :

- background jobs corresponds to BATCH

- update tasks corresponds to UPDATE

Those 2 kinds of tasks stands not necessarily on the same server...

Best regards,

Samuel

Read only

Former Member
0 Likes
5,062

Best article about RFC calls I've ever read click [here|http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417200)ID0519063150DB10009773621581261878End?rid=/library/uuid/f078394a-4469-2910-c4bf-853c75674694&overridelayout=true]

It comprehensively explains all the types of RFC calls.

Revert back if you still have doubts.

BR,

Advait.

Read only

Former Member
0 Likes
5,062

Hi,

To call a function module directly, use CALL FUNCTION IN UPDATE TASK directly in your code.

Refer Link: [Calling a function module in background task |http://help.sap.com/saphelp_nw04/helpdata/EN/8f/53b67ad30be445b0ccc968d69bc6ff/content.htm]

Refer Link: [Call function module in update task|;

Refer Link: [CALL FUNCTION IN UPDATE TASK |http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4e0a79e11d1950f0000e82de14a/content.htm]