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

Calling function modules in background task

Former Member
0 Likes
1,916

Hi All,

I am creating a notification in the background and linking it to an order. This I am doing inside a function module which is called in background task as a separate unit. I should change the user status of this newly created notification. This I am doing in another FM called as a separate unit. Now my requirement is that, I need to perform the status change only after the new notification is committed to the database. I would like to know if i can provide some time lag between the 2 FM execution. Can anyone tell me how much time will be consumed to commit the data to the database tables irrespective of the length of the data. Say for example, if i have hundreds of notifications within the object list tab of an order, I want to know what is the maximum time it will take to commit this to the database table so that I can put a wait conditionat the stat of the second FM call.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,413

Hi Smitha,

You can call your second FM for status change in UPDATE TASK so that after commit work is encountered this FM can be called.

Hope this helps you.

Best Regards,

Akanksha.

3 REPLIES 3
Read only

Former Member
0 Likes
1,414

Hi Smitha,

You can call your second FM for status change in UPDATE TASK so that after commit work is encountered this FM can be called.

Hope this helps you.

Best Regards,

Akanksha.

Read only

0 Likes
1,413

Ok thanks. But let me tell you 1 thing, actually I am calling these 2 FMs within an enhancement section just before another FM CO_ZV_ORDER_POST which is actually doing a commit work. So is it OK if I call the 1st FM in background task and the second FM in update task in the same place as I am calling the FMs now(i.e., before CO_ZV_ORDER_POST)?

Read only

0 Likes
1,413

Hi Smitha,

In that case use COMMIT WORK AND WAIT functionality after creating notification and if your BAPI/FM(used for creating notification) returns you notification number then that can be used for calling second FM. WAIT will help in committing all the changes in database.