‎2006 Jul 14 2:39 PM
Hi Everybody,
I have made implementation to the definition MB_DOCUMENT_BADI( material Document creation).
While executing this BADI I am getting short dum with this error Multiple call of update function module.
Here is the short dump--
In the FORM routine Buchen_Ausfuehren (program SAPMM07M), an error
message was issued by a Business Add-In (BAdI) or function module.
This is not permitted, because it could lead to data
inconsistencies. For this reason, the update of the material
document was also terminated with a termination message (dump).
Note that this message (M7 372) is not the responsible error
message.
Please any body suggest the way forward.
Regards,
Sandeep.
‎2006 Jul 14 2:42 PM
‎2006 Jul 14 3:15 PM
Yes, I am using message implementation in method MB_DOCUMENT_BEFORE_UPDATE .
Is it causing any issue
Please suggest.
Regards,
Sandeep.
‎2006 Jul 14 3:31 PM
If you are using MB_DOCUMENT_UPDATE, this method is called in the update task, and MESSAGE sentence generate "Terminated Update".
Regards.
‎2006 Jul 28 5:54 AM
Hi Peluka,
I have solved the problem but here we have a new issue.
I have a question , Can we give a errror message in MB_DOCUMENT_BEFORE_UPDATE,if it is then is it impact any where to the sap standard code.
Please suggest your thought.
thanks
sandeep
‎2006 Jul 28 7:58 AM
Hey,
You can definitely issue error messages in the function MB_DOCUMENT_BEFORE_UPDATE. Doing so will not generate any short dump as this function is not called in the update task.
-Kiran
‎2006 Jul 28 8:41 AM
Hi Kiran,
Thanks for the reply.
I have created one implementation to the BADI MB_DOCUMENT_BADI. This badi will hit while creation of material document.I have write the code in method MB_DOCUMENT_BEFORE_UPDATE such that it will act only for certain movement types specially for t-codeMb1a and MB31.
What problem I am facing i have used a error message "MB_DOCUMENT_BEFORE_UPDATE" in this method.If we got the erroe message then we dont need to post the material dcoument,but here problem is that if the material document could not posted then it corrupt the material and when we performing 261/101 we got error message like " Inconsistency between MM and ML for material and plant"
I have used following things like-
1-while updating the customized table using " Commit Work".
2-Call function vb_change_batch for updating the batch and not in update task.
3. Dequeue the table after updating the table.
Will thos things can create any inconsistency to the MM and ML.
Please suggest me uor thoughts.
Thanks
sandeep.
Thanks ,
sandeep.
‎2006 Jul 28 8:57 AM
Hi Sandeep, one small Suggestion at this point, when your are performing any Database Updates(Commit or Rollback) always use AbEnd(A) Message type instead of error because message type A acts as Rollback command.
Thanks:-
Santosh.D
‎2006 Jul 28 9:05 AM
Hey,
Is there a COMMIT statement in your program before the error message is issued?
You should not be committing any data before the error message if you do not want the material document to be posted.
-Kiran
‎2006 Jul 31 1:30 PM
Hi Kiran,
I have used a Commit statement in method MB_DOCUMENT_BEFORE_UPDATE.
I have also used few things like-
1-Call function vb_change_batch for updating the batch and not in update task.
2- Dequeue the table after updating the table.
Will those things can create any inconsistency to the MM and ML.
Please suggest me uor thoughts.
Thanks & Regards,
sandeep
‎2006 Jul 31 1:40 PM
Boss,
Do not use COMMIT statements in the BADI, SAP will commit the data at the end of the transaction.
Commit statements might cause inconsistency.
-Kiran
‎2006 Jul 31 1:49 PM
One more question sir,
Can i use BAPI_TRANSACTION_COMMIT instead of Commit statement as I have to used after updating the batch using function module VB_CHANGE_BATCH.
and also cant use DEQUEUE function and it s must to update the function module in update task.
Thanks Kiran,
Regards,
Sandeep.
‎2006 Jul 31 1:54 PM
Nope... You shoudlnt be calling BAPI_TRANSACTION_COMMIT...
Whatever updates you are performing in the BADI will be committed by SAP. If you do not want to complete the processing if the BAPI to update batch fails then you should raise an abend message.
If the BAPI update is successful do not call the COMMIT bapi as these changes will be committed by SAP program's COMMIT WORK statement.
Why are you calling the ENQUEUE/DEQUEUE functions? What transaction are you trying to post?
-Kiran
*Please mark useful answers
‎2006 Jul 31 2:50 PM
I Have to update a ztable so that I have locked it before update and release it after update.
I am performinh some calculation to the batch before post the material document.
Once again can i use a Erroe message OR Abort message.
Thanks Kiran,
Regards,
sandeep
‎2006 Jul 31 3:00 PM
You can use ABORT message if the update in the custom table fails.
Ideally all the database updates must happen in the update task so that the either everything is committed or everything is rolled back.
Use the method which is called in update task.
Use the below code in your method for the same:
Update ZTABLE.
if sy-subrc ne 0.
message A000(msgid) with UPDATE FAILED
endif.
Call Batch Update BAPI
Read return table with key type = 'E'.
if sy-subrc eq 0.
message A000(msgid) with UPDATE FAILED
endif.
-Kiran
*Please reward useful answers
‎2006 Jul 14 3:06 PM
Which method in the BADI are you using in the implementation? Is it MB_DOCUMENT_BEFORE_UPDATE OR
MB_DOCUMENT_UPDATE?
If you are using MB_DOCUMENT_UPDATE then note that this method is called in the update task and you should not use PERFORM ON COMMIT or COMMIT WORK statements in the method implementation.
Can you paste the code inside the method?
-Kiran
*Please reward useful answers
‎2015 May 08 3:48 AM
Hi Former Member .
Did you solved problem.
I have the same issue. If anybody here know how to resolve please share your knowledge
Thanks