cancel
Showing results for 
Search instead for 
Did you mean: 

OData - BOPF based CDS View - Delete Root node Error - Multiple nodes on same DB Table

samson_moses
Explorer
0 Kudos

Hello Experts,

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.

Regards,

Samson

samson_moses
Explorer
0 Kudos

Hi All,

I had raised an incident in SAP and as per SAP, it's not recommended to have Business nodes pointing to the same DB Table.

Unfortunately I am yet to get any response from them for my below queries :

1. What if there is a requirement to have same DB Table for different nodes ?

2. Is there any documentation on the above recommendations / guidelines.

Regards,

Samson.

maheshpalavalli
Active Contributor
0 Kudos

It would be easier to expose a single node and ask the ui team to apply filter on that and show it as multiple views right?

i really dont see any scenario with the same db for 2 nodes in a data model..

samson_moses
Explorer
0 Kudos

Hi Mahesh,

Thanks for your response.

Again, the example I gave is for understanding purpose and not my actual requirement. But, taking the example in the blog also, the colour node and gas type nodes are separate entities with different data attributes.

Just for our discussion purpose, say, the below entities for colour & Gas-Type are having fields like

  • colour = {ColourCode, ColourDesc, NumberOfCoating, WaxCoatingApplied,....}
  • GasType = {GasTypeCode, GasTypeDesc, AvgMileageSupported, ...}

So, though both these features are saved in the same DB Table of ZTCAR_FEATURES, they are representing different attributes and their fields would vary.

Basically, its like standard SAP characteristics where they maybe stored in same AUSP table they represent different entities by themselves.

Regards,

Samson.

Accepted Solutions (1)

Accepted Solutions (1)

samson_moses
Explorer

Hi All,

This issue is now corrected by SAP . Please refer the OSS note 2886996 for the correction. After the installation of the note, BOPF will read data from the underlying CDS view(Highlighted Point#2 in my above question) rather than from the DB Table.

Closing this thread 🙂

Thanks & Regards,

Samson

Answers (0)