2015 Oct 06 5:40 AM
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
2015 Oct 06 5:43 AM
Hi
Did you use any wait / delay statement in your function?
Regards,
Venkat
2015 Oct 06 6:15 AM
Yes; i have used wait statement inside FM just incase to avoid the locking of Batch data.
2015 Oct 06 6:21 AM
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
2015 Oct 06 6:45 AM
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