Hi:
我的业务场景是:当用migo做101收货时,自动触发501的收货。所以我在BAdi “MB_DOCUMENT_BADI”的方法“MB_DOCUMENT_UPDATE"里,通过调用BAPI "/AFS/BAPI_GOODSMVT_CREATE" 来实现501的收货。现在的问题是:migo可以正常完成并生成101的凭证,但是501的凭证生成不了,后来debug发现,是在调BAPI时报M7 299的错误,以下是关于M7 299错误的详细分析:
Diagnosis
The function module MB_CREATE_GOODS_MOVEMENT is called up for the second time. After it was called up the first time, the function module MB_POST_GOODS_MOVEMENT was called, but a COMMIT WORK was not carried out in the calling program.
As running the two function modules again would result in the database being incorrectly updated, processing is terminated. System Response Procedure Please ensure that a COMMIT WORK is set after you call up the function module MB_POST_GOODS_MOVEMENT.
从documentation来看,migo和bapi都会执行function module MB_CREATE_GOODS_MOVEMENT,但是在BAdi里调用bapi执行的时候,migo并没有做commit work的操作,因此导致了这个错误。
急切地需要您的帮助,谢谢。