cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Application Programming Model for SCP - Draft concept

former_member321811
Participant
0 Kudos

Hi,

The generic handlers in the APM for SCP apparently support the draft concept: https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/00823f91779d4d42aa29a498e05...

However I can't find any ressource on how to use this feature. I just looked at the code of the cds npm modules and found out that I need to add the following annotation to enable drafts for an entity:

@odata.draft.enabled: true

I tried to add this annotation to enable drafts for a very simple Todo entity. With CDS 2.10 I get the following error when I try to access the service:

Service not available: TodoService.

Switching to CDS 3.0, things are a bit better and I can see that the framework created some new tables for draft support:

DRAFT_DRAFTADMINISTRATIVEDATA
TODOSERVICE_TODOS_DRAFTS
TODO_TODOS

However when I try to GET the data, I get the following error:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>CDSRuntimeException.INTERNAL_ERROR</code>
<message xml:lang="en-US">Internal Error Occured</message>
</error>

And I can see some exceptions in the logs and I don't really know what to do next:

"com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257] (at 115): sql syntax error: CDS error: Sub artifact \"ISACTIVEENTITY\" not found in \"ROOT_ENTITY_ALIAS\": line 1 col 116 (at pos 115)"

Does anyone know how to enable draft support for APM for SCP?

Note: I'm using Java with the HANA Service (2.0 SPS 04) in the Web IDE Full-Stack.

Cheers,

Pierre

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Pierre,

We are working on OData v2 draft. It should be available by the middle of March.

Regards

Suresh

Answers (3)

Answers (3)

former_member321811
Participant

Hi Suresh,

Thanks for your answer. I tried to enable draft support for OData v4 with Node.js and it seems to work just fine. However as long as SAPUI5 and Fiori Elements don't fully support v4 it's not really useful so I'm eagerly waiting for v2 support.

Thanks,

Pierre

kranti_khilari
Participant
0 Kudos

Hello Pierre, Christian,

Basic draft support for OData V2 and V4 is available since Service SDK Java version 1.28.

Can you please use the latest available version 1.32.0 and see if it helps.

Thanks,

Kranti

former_member511914
Discoverer
0 Kudos

Hi Suresh,

is OData v2 draft now supported in SCP? I still run into the same error.

Kind regards

Christian