cancel
Showing results for 
Search instead for 
Did you mean: 

Primary Key of DB Table doesn't fit to root table (BOPF)

former_member383742
Participant
0 Kudos

Dear SAP Experts,

Could you please help me to solve the following error? I am using for the backend system S/4HANA 1610 SP1 which includes the BOPF Draft 2.0 concept. I tried to create an CDS view which generates and BOPF Object draft enabled (see the attached picture), but when I activate the CDS view I am receiving the following error:

"Primary Key of DB Table doesn't fit to root table (BOPF)"

I want to mention that for the primary key of the DB table I used an UUID data type like recommended.

Which annotations did I forgot to insert to my CDS view? Are there any available best practice document for generation BOPF Draft Objects based on CDS Views?

Thanks in advance,

Kind regards,

Catalin

Accepted Solutions (1)

Accepted Solutions (1)

Attila
Active Participant
0 Kudos

Hi Catalin,

the draft management is not implemented in NW 7.51 sp1. I had this error,as trying to implement draft enabled applications. I put UUIDs as single key fields both in the header and item tables to go one step further (however draft management not fully delivered by SAP at the moment and other different errors will occur for you also. You'll receive the same answer from SAP when opening an Incident about error messages).

The semantic key ticket_id would not be part of the key. I cannot say this will remain so in the future, this is known by the architects internally at SAP only.

You can put a draft flag in your tables as workaround, but this will require from you to do more coding managing draft in ABAP, but at least you saved the persistency/transaction management by BOPF (this is what I did, I explicitly handle the draft). If you want to do OData exposure, the Fiori Elements/Smart templates will not adequate, but you can still use templates, and you can have annotations in CDS, language dependent texts and value helps. All this will be imported into WebIDE as an annotation file (you save UI coding a lot). It needs smaller adjustments, but you have more freedom :), and more OData request management in the UI 😞 . But as I've seen SAP is actively working on that topic, because this draft requirement is the most wanted by REST. This cannot be introduced very fast, due the BOPF Framework is part of the basis already, and lot of thoughts, planning and prototyping are required to deliver a fully error free platform. They went into dead-ends with trials and prototyping to handle drafts. They had to rethink lock management, make CDS, SADL and GW to cooperate, so quite complex stuff. But I am thankful to SAP, due I can write active persistency by CDS and BOPF and OData, and I have the required OData annotation out of the box. If they finish witrh draft management, not only they can benefit from that, due development costs will be highly reduced for new implementations by CDS and BOPF, but we customers only. I hope it is coming soon hopefully in SP2, but as I said I'm already happy, because I can save lot of work. Good is that for queries/read access BOPF is not used, directly db table is accessed, so should be very fast with HDB.

Kind regards

Attila

Answers (0)