但此时数据还没写入到数据库中,要等到待会而commit work的时候才会被写入。这是就需要缓存来存储这些信息,以保证不会引发错误。 3、让我们设想因为某种原因更新commit work失败了,数据未能写入数据库。如果你没有没有使用bapi_transaction_commit刷新缓冲区,下一次bapi调用将认为这些缓存仍将存在,这样会导致错误。 同样...
简要地看一下bapi_transaction_commit的代码,我们能很快看出其与commit work的区别。它会在执行commit work之后再调用一个buffer_refresh_all的函数 所以bapi_transaction_commit额外地刷新了BAPI buffer缓冲区。 下面是bapi buffer的用处: 1、假设你的程序连续地调用了若干个bapi,然后在最后使用了co... ...
调用bapi都需要判断return消息类型,如果没有报错则BAPI_TRANSACTION_COMMIT和COMMIT WORK AND WAIT.,否则BAPI_TRANSACTION_ROLLBACK。 同时,部分bapi调用之后还需调用特定的函数进行垃圾回收,否则会造成duplicate问题。 常用的处理方式: LOOP AT lt_return INTO wa_return. IF wa_return-type EQ 'E' OR wa_return-t...
最安全的情况,如果这个 BAPI 每次执行的只是数据库更新操作,且 BAPI 每次执行时,代码块 A 计算出的 lt_update 都完全一致,那么多次调用 BAPI,然后再一次执行 COMMIT WORK,不会出现 side effect 如果重复调用的 BAPI,每次输入都相同,但是每次代码块 A 计算出的 lt_insert 或者 lt_delete 都会产生新的记录,那么...
From SAP Release 4.0A onwards, it is more effective for BAPIs to issue a separate BAPI_TRANSACTION_COMMIT to force the update, instead of doing commit work. By using this method, BAPI calls can be made before the work is committed as a batched unit of work. To find out if a BAPI ...
有朋友问我这个问题:调用 MIRO 的 BAPI, 调用多次,最后一次性 COMMIT WORK,可以执行成功,但是调用一百次以上,最后再 COMMIT ...
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X'. IF SY-SUBRC = 0. E_STATU = 'S'. E_MESS = '客户更新成功'. E_KUNNR = O_KNA1-KUNNR. ELSE. E_STATU = 'E'. CONCATENATE '客户更新失败(' SY_SUBRC ')' INTO E_MESS. ...
For a workaround, I tried explicit commit using COMMIT WORK immediately after delete query in the BAPI itself and I also tried calling bapi using "BAPI_TRANSACTION_COMMIT" from the remote device for explicit commit. Either way delete query was not reflected in the database. Please give some...
Unfortunately it does not work (it exits debugger), as it seems that the material document has not been created yet ( but inside the badi I have already MBLNR...) . I tried to use BAPI_TRANSACTION_COMMIT before creating invoice, but it also exits. Can use those BAPIs inside MB_...
However BAPI_CPROJECTS_COMMIT_WORK takes long time to commit the changes 15-30 Seconds per Project with average roles and staffing is 3 or 4. I have already looked for SAP notes around around these BAPIs but do not seem to get and help. Could you please suggest some help for optimizing...