且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IBase component cannot be created and deleted in the same second

更新时间:2022-08-22 12:53:07

相关的corrective measure是1612172 (2012)

对应的ticket是0120031469 0001427502 2012

regarding dump in include LCRM_UPLOAD_IBASEMBDOCF17.


Scenario

when we create a new IBASE component via IBASE API and then delete it via FM CRM_IBASE_COMP_DELETE in the same session and then save the transaction, then we meet the exception. The issue could be easily reproduced by running report ZTEST_IBASE_CREATE_DELETE1 in CRM713 sandbox system HAM/504 with WANGJER/Sap12345. Just specify an object ID which does not exist in the system yet, the report will create a new object automatically.


IBase component cannot be created and deleted in the same second

Screenshot1

Issue analysis

IBase component cannot be created and deleted in the same second

IBase component cannot be created and deleted in the same second

Screenshot 2

IBase component cannot be created and deleted in the same second

Screenshot 3 # My correction proposal As you see, in screenshot2 the valfr and valto are exactly the same timestamp, because the creation and deletion of the same IBASE component occurred within the same second.

So my proposal is to change the “<” in line 55 and 64 in screenshot 3 to support this scenario.


After I finished this change in HAM/504, there is still the same exception occurred. The reason this time is because the check fails in line 54 instead: the lv_timlo is subtracted by 1 second from iv_valto.



IBase component cannot be created and deleted in the same second

However after I read your memo in ticket 2012 1427502, it seems it is necessary to have the logic to deduct 1 second on valid_to.

IBase component cannot be created and deleted in the same second

However this logic did cause trouble in the case that creation and deletion occurred within the same second.

I try to reproduce the issue reported in ticket 2012 1427502. So I revert your correction locally in HAM/504:


I enable the line 44 and 45 which was deleted in ticket correction:



IBase component cannot be created and deleted in the same second

Then I create a new Object component and save it; then change its description and save again. The buffer table:IBase component cannot be created and deleted in the same second

Then delete the component and save:

This time buffer table has only ONE entry:

IBase component cannot be created and deleted in the same second

That means I could not reproduce the error “wrong access to the buffer” you mentioned.

IBase component cannot be created and deleted in the same second

 # Final solution The basic question is, why is it meaningful to create a component and to delete it in the same run.

The coding and also buffers are not designed for this. Therefore errors may come up at several places.


If they do not need the bdoc’s anyway, they could suppress the processing with removing the entry ibcox_something_to_Post/ib_crm_bdoc_fill in table ibbinding.

Yes I have already mentioned the approach to remove entry in view V_IBBINDING to suppress the IBASE BDOC generation.


IBase component cannot be created and deleted in the same second

As long as the creation timestamp and deletion timestamp are not the same, there would be no error. This is also the reason why my proposed workaround ( add WAIT UP TO 1 seconds before the deletion FM call ) works since it forces the deletion timestamp to be 1 second later than the creation timestamp. I also consider that the normal customer would never have such issue since it is impossible for them to create and delete one IBASE component within the same very second in webclient UI ( only possible by developing their custom code )