Application Development 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: 

Cannot update batch header no matter how I try in MB_DOCUMENT_BADI

Former Member
0 Kudos

I am trying to update next inspection date via MIGO when Goods Receipting a production order which is held in the batch header and in a classification we have set up. I have used function modules to try and perform the update.

I have used both 'VB_UPDATE_BATCH' and QEVA_BATCH_UPDATE both by themselves and in an update task to update field QNDAT. (1st one updating MCHA and MCH1 the second one to update MCHA).

I had the code before in POST_DOCUMENT of BADI MB_MIGO_BADI and this made no difference either. Sometimes it updates if I cancel the material document and redo the goods receipt with the same production number but this is very inconsistent. I need this to be done when I am posting the goods receipt.

Does anyone have any ideas as I am at the end of my tether with this one?

Many thanks

Regards

Larissa Maryniuk

Edited by: Larissa Maryniuk on Feb 7, 2008 4:34 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Have you tried using 'BAPI_BATCH_CHANGE'? I have used this FM, but not in the MIGO exit.

Update the batchattributes and the corresponding x parameter. There is a field for updating the inspection date. I wonder if it is failing to update for you because the batch is not yet created. Are there any error/warning messages returned from your FM's?

7 REPLIES 7

Former Member
0 Kudos

Have you tried using 'BAPI_BATCH_CHANGE'? I have used this FM, but not in the MIGO exit.

Update the batchattributes and the corresponding x parameter. There is a field for updating the inspection date. I wonder if it is failing to update for you because the batch is not yet created. Are there any error/warning messages returned from your FM's?

0 Kudos

The batch is created as I am goods receipting a production order and the batch header is created at production order creation. I will try the BAPI though.

Many thanks

Larissa

0 Kudos

This has not worked unfortunately. There were no errors from the modules and I cannot doa commit work inside a BADI so even with the BAPI I cannot use this as I cannot call BAPI_TRANSACTION_COMMIT.

0 Kudos

The bapi wraps a call to VB_CHANGE_BATCH, so perhaps you may want to try calling this FM directly.

Former Member
0 Kudos

use MB_MIGO_BADI

in this LINE_MODIFY

this method .it will solve.

and if ur confident of ur method and want to do cmmit work

write that part in submit program.

0 Kudos

I don't think that using LINE_MODIFY will work because the struture of the data involved(GOITEM) is from MSEG and QNDAT does not exist in MSEG. Will try seeing if I can use the MSEG data to do the update anwyay and let you know.

Former Member
0 Kudos

Used BAPI_BATCH_CHANGE in method check_item and set the classidfication in the bacthcontrol structure within BAPI MB_MIGO_BADI. This has worked so many thanks