As per our requirement for a productive application(SAPUI5 and not Fiori), I have successfully created BOPF-based Consumption CDS View . This I exposed as OData service in SEGW using service Data Source references. My SAP Version is 7.50 - SP level 16.
In my Business Object Modelling I have a scenario where multiple BOPF child nodes refer to the same database table. All other operations like READ, EXPAND, DEEP CREATE, CHANGE SET is working for me. But the deletion of my parent node is failing.
To illustrate my scenario, I am showcasing a mock use-case.
Assume I have , car as business object which has features like the colours available and Gas Type supported. I am using same DB Table for Features and differentiate the features of colours or Gas Type by having separate views with appropriate FeatureID filters.
For Deletion of root node, the DAC class framework , for each child node , tries to get respective child records of the parent key. The class /BOBF/CL_DAC_LEGACY_TABLE method READ, gets the data source from BOPF node configuration and retrieves from underlying data source. (Flow as below)
Since its same data base table the child node records, if fetched from DB Table instead of underlying CDS View, the correct parent-child relationship would be broken. This causes the framework to request incorrect records for deletion, resulting in Exception raise due to SY-SUBRC failure.
Even though logically it should not be different, I tried using DB_KEY, PARENT_KEY GUID based object modelling too. But it does not work.
Is there any alternative approach recommended if the requirement is to model multiple BOPF child nodes referring to same DB Table ?
For my application, my current plan to handle root node deletion in my <..>_DPC_EXT explicitly.
Any inputs / suggestions would be really helpful.