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: 

Can we update Ztables also when we run goods movement bapi

Former Member
0 Kudos
160

Hi,

When i am calling 'BAPI_GOODSMVT_CREATE' and 'BAPI_TRANSACTION_COMMIT'

all the goods movement details are being saved in MSEG,MKPF tables .so my requiremnet is when i run this bapi i need a ztable also to be updated with same details when 'BAPI_TRANSACTION_COMMIT' is called.

can this be implemented??

Regards,

Venkat.

6 REPLIES 6

Former Member
0 Kudos
56

Hi

U can implement the code for updating the z-table after calling the BAPI for the commit

Max

0 Kudos
56

Hi Max,

I have already implemented that code in my program..after bapi commit is called below that i have implemented that code..but clients requirement is ztable should be updated when standard tables are updating.Reason is after standard tables are updated in very rare cases ztable is not getting updated so quantity variance is coming while taking monthly report ..

Regards,

Venkat.

0 Kudos
56

Hi

Just a a small clarification:

You can't update your Z-table while the standard table being updated, but you can append your updating process to the queue of standard updating process.

That means your Z-table will be updated after updating the standard one: that because you make sure all standard updating process end successfully before running yours.

Now if you were in MM transaction (for example MIGO) you need to use an user-exit to update your own z-table, like EXIT_SAPLMBMB_001, but the code for updating should work in UPDATE TASK, in this way your process will be called at the end.

But if you're out of MM transaction, just as your case, you can insert the code just after the BAPI, and in this situation I think it can insert after the COMMIT or you can insert your code between the BAPI and the COMMIT, but your code should work in update task.

So you can insert your code like above, but you NEED to decide if z-table has or has not to be updated in order to the data, I don't believe it's very important where the updating is called

Now

0 Kudos
56

Hi Max,

It is not important for me at which point of time update process takes place but client requirement is like that as i said you in my previous post that in very rare cases ztable is not getting updated in some or the other cases..anyways thanks for your inputs.

Regards,

venkat.

0 Kudos
56

Hey Max,

could you message me what is that user exit to do that process,the exit name which you mentioned in your earlier message is not the correct one.

0 Kudos
56

Hi

The exit is EXIT_SAPLMBMB_001, enhancment MB_CF001

It's called in posting process of a material document,

U can see this user-exit by trx SE37: here the header and item data are available, you need to insert your code in the include ZXMBCU01.

But you should create a your Z-function module for updating your table and call it in update task:

CALL FUNCTION <Z FUNTION> IN UPDATE TASK

In this way your code worls as soon as the commit is called.

Anyway if you'll use it, you need to considere that exit will always be called, so probably you need to insert a filter in order to understand if the good movement is posted by your program (so via BAPI) or by a transaction

Max