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

Issue with BAPI_BATCH_CREATE

former_member563268
Participant
0 Likes
1,298

Hi ABAPERs,

I have a scenario where in I have to update the BATCH detail (in a Goods receipt Material document)  with a new valuation type based on the value of movement type. This is to be done on posting the goods receipt using MIGO Tcode and I have put this entire code of updating the BATCH in an Function Module which is called as a NEW TASK(in BADI IF_EX_MB_MIGO_BADI~POST_DOCUMENT). I have tried triggering the changes in debug mode, by creating a material document, and it is working fine in debug mode. But on checking back in MIGO for the newly generated material document, valuation type of the batch remains same and its not updated. Could you please throw some expert advise into this.

Regards,

J_X

4 REPLIES 4
Read only

venkateswaran_k
Active Contributor
0 Likes
904

Hi

Did you use any wait / delay statement in your function?

Regards,

Venkat

Read only

0 Likes
904

Yes; i have used wait statement inside FM just incase to avoid the locking of Batch data.

Read only

nishantbansal91
Active Contributor
0 Likes
904

Hi J ABAP,

If the things is working fine in debugging mode then it must be issue for the wait statement .

Please check my below answer. The same problem occurs in implicit enhancement.

Have you checked after using wait statement?

You are getting the value from the same table which system has earlier updated in the same session.

While debugging system has got time to update the table, but in direct execution system doesn't get time for updating the database that why your code is not working.

Thanks

Nishant

Read only

0 Likes
904

Thanks for the note Nishant. But i had wait statement added from the beginning, considering the same table update scenario you have mentioned. But it still doesnt update.

And a littles clarification on the understanding. Eventhough it isworking fine in debug mode, it is still not havign the updated valuation type after checking in MIGO.

Regards,

J_X