Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Elements / CAP application together with SAP C4C ODATA API - Draft Handling Required?

JanLo
Explorer
3,594

When using Fiori Elements with CAP (which is OData v4 service provider), it is required to use drafts when editing data. But the remote OData services in C4C have no support for drafts at all. 

Moreover we tried to implement the CAP application that will wrap around serval external OData services and combine them into a single one. For that reason, there is no real persistent layer, as custom handlers handle all service calls and delegate them to correct external services. Now we've come across an issue that draft mode needs to be enabled to add creation capabilities to the Fiori Element app.

Is there another way to allow creation in FE without having draft enabled? Will we have to add the persistent DB layer only to handle drafts?

Do you have any suggestions on how to proceed? Or can recommend documentation that addresses that topic?

Thanks in advance!

6 REPLIES 6

thomas_jung
Developer Advocate
Developer Advocate
3,560

What Fiori Floorplan are you trying to use?  I didn't think that Draft was required for Create.  It's recommended, but I've certainly seen Fiori+CAP that doesn't use Draft -- I've created some myself. 

Draft is going to require a persistent DB layer. The draft data itself (who's editing, when last edited, etc) must be stored in the persistence. You can place the draft annotation on a project which in turn is projected onto a remote entity.  Only the keys and the draft metadata will need to be persisted locally. 

0 Kudos
432

Hi! @thomas_jung In my work experience we have got few cases before where CAP would be a perfect solution for apps based on remote service V4 metadata, but that isn't possible because remote service has no isActiveEntity and other draft properties, so it becomes cumbersome task to use SAP Fiori Elements.
Are there any developments and/ or solutions how to use SAP CAP together with remote V4 services?

Thank you,

Shanir

JanLo
Explorer
0 Kudos
3,552

Dear Thomas, thanks for your feedback! We are currently in internal alignment and will com back shortly. In the meantime, do you know some documentation or any example covering Fiori + CAP -> Create w/o draft?

JanLo
Explorer
3,494

Hi Thomas, we were discussing the topic. Indeed, we tried using the list report / object details floorplans. However, we saw a contradiction in using OData V4 without draft handling with the standard SAP documentation that states that "only SAP Fiori elements for OData V2 support the local edit flow without draft handling. Or do we miss something in our investigation? An example or further docu would be very well appreciated that we can follow.

Or do you / does anyone know why there is a distinction between OData v2 and v4 regarding draft handling useage?

Thanks, Jan

0 Kudos
3,246

I have evaluated the same question/behavior couple of months ago, and you pointed it out correctly. 

Fiori elements allows you only: draft with v4
Fiori elements allows you w/wo draft with v2

I assume you create the apps using BTP or vscode, there the manifest differs for v2/v4 created apps. Also a different components is used, as far as i checked.

You could use the v2 support adapter; https://cap.cloud.sap/docs/advanced/odata#v2-support and create a Fiori elements app using the V2 meta data. In my opinion this can be only a temporary workaround and i hope to see v4 without draft required. Would love this.

LuizSouza
Participant
1,317

Hi guys, I'm having the same problem. It seems that V4 still requires Draft. Without this annotation it only allows "Delete".  @JanLo did you receive any feedback from  @thomas_jung  ?

Luiz Souza
SAP Senior Consultant