Skip to Content
0
Former Member
Dec 18, 2015 at 11:48 PM

Commit problem with BAPI_ENTRYSHEET_CREATE

325 Views

I am using two BAPIs to generate data in SAP. BAPI_CATIMESHEETMGR_INSERT following by BAPI_ENTRYSHEET_CREATE. The first step to create time entries and the second step to generate the costs.

The logic is to run

BAPI_CATIMESHEETMGR_INSERT

then

BAPI_ENTRYSHEET_CREATE

then

If success for both

BAPI_TRANSACTION_COMMIT

Else

BAPI_TRANSACTION_ROLLBACK

Endif.

The CATS BAPI runs successfully but we get an error in the ENTRYSHEET BAPI so the ROLLBACK is called. The error itself is fine as an invalid g/l account is being passed in some instances and the BAPI handles this correct and reports the error correctly.

Unfortunately the CATS entries remain in SAP ... they have been committed although no commit was performed by the code.

Upon further investigation I am finding that the ENTRYSHEET BAPI is performing a commit although parameter NO_COMMIT = 'X' is being passed and the BAPI is returning an error so shouldn't post.

If I step through the entry sheet BAPI it is calling FUNCTION 'MS_CREATE_SERVICE_ENTRY_MULTI' after stepping over this FM the CATS entry is committed in the system.

Wondering if anyone has come across this issue before ... seems quite recent as the program described above has been in production for 5 years. Want to avoid another long night of stepping through ABAP code.

Thanks a bunch

Stewart