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

BADi / User exit after MIGO COMMIT ?

Ash_ok
Contributor
0 Likes
932

Hi !

We need to populate some characteristic values for a batch of a material while running txn. code MIGO, after the MIGO COMMIT. We have used BADi 'MB_DOCUMENT_UPDATE' to write the bespoke code. However, while updating the characteristic values, using FM 'VB_CHANGE_BATCH', we are getting EXCEPTION 'lock_on_plant'.

This sounds like FM 'VB_CHANGE_BATCH' is COMMITting at the same time / before MIGO is COMMITting. Is there a BADI / user exit that works after MIGO COMMIT ?

Cheers,

Ashok.

Hi !

We need to populate some characteristic values for a batch of a material while running txn. code MIGO, after the MIGO COMMIT. We have used BADi 'MB_DOCUMENT_UPDATE' to write the bespoke code. However, while updating the characteristic values, using FM 'VB_CHANGE_BATCH', we are getting EXCEPTION 'lock_on_plant'.

This sounds like FM 'VB_CHANGE_BATCH' is COMMITting at the same time / before MIGO is COMMITting. Is there a BADI / user exit that works after MIGO COMMIT ?

Cheers,

Ashok.

3 REPLIES 3
Read only

Former Member
0 Likes
739

Hi Ashok,

The FM 'VB_CHANGE_BATCH' is a normal function module, and might be commit-ing as you mentioned.

You can try creating an UPDATE function module as a wrapper to VB_CHANGE_BATCH, and call the so created FM 'IN UPDATE TASK', in the same BAdI.

Hope this helps you!.

Sajan.

Read only

0 Likes
739

Hi !

Setting the value for the field 'BYPASS_LOCK' to 'X', I am able to avoid the exception 'lock_on_plant'.

SAP says that it is not possible to create a batch and change it's characteristic values, other than the batch expiration date, in MIGO using BADi 'MB_DOCUMENT_UPDATE', as the create and change would be part of the same LUW.

Note 92550 lists the inconsistencies that can occur if a separate COMMIT is called in the user exit / BADi. This would happen if a wrapper FM to 'VB_CHANGE_BATCH' is created and called 'IN UPDATE TASK'.

Cheers,

Ashok.

Read only

0 Likes
739

Did you check MB_DOCUMENT_BADI??