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

Problem running background task

former_member189779
Active Contributor
0 Likes
1,005

Dear all,

I need to update batch master record MF date on basic data one tab and one characteristic in classification tab in Batch master when saving the Process Order.

So what I am doing is I am calling

CALL FUNCTION 'BAPI_BATCH_CHANGE' IN BACKGROUND TASK  "To change date

CALL FUNCTION 'BAPI_OBJCL_CHANGE' in background task            "To change characteristic value


                     in enhancement point before WORKORDER_UPDATE.

My Problem : The date on basic data one tab gets updated correctly every time but the characteristic value on classification tab sometimes gets updated

sometimes not.

Probably both the background tasks are run in parallel and one of them block the batch master data. How can I make them call one after another?

I can not use these functions in UPDATE TASK it will dump.

Your views/inputs are appreciated.

Regards

Vinit

5 REPLIES 5
Read only

Former Member
0 Likes
849

There will be a lock created by the first.  Wait until it is released to call the second.

Neal

Read only

arindam_m
Active Contributor
0 Likes
849

Hi,

May be applying a little WAIT..UP TO might help.

Cheers,

Arindam

Read only

Former Member
0 Likes
849

Why are you doing it in background task?

Read only

0 Likes
849

Because I want to update the batch after saving the process order.

Read only

0 Likes
849

When you call it in background task, wouldn't the processing continue irrespective of whether process order was saved successfully or not?

I think your 2 function modules and BAPI_TRANSACTION_COMMIT can be bundled in custom FM, and that can be called to ensure sequence of execution.