cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP Deep Insert on draft table

FabienHenique
Participant
0 Kudos
2,366

Hello CAP Community,

I've created a service which is based on deep insert sample from sapmentors.

Draft capabilities has been enabled for a Fiori Element apps and it's working fine.

Since I also need to consume this CAP Endpoint from SAP Integration Suite, I would like to use a post with deep insert, but I got this error:

cannot insert NULL or update to NULL: DRAFTADMINISTRATIVEDATA_DRAFTUUID: 
line 1 col 1 (at pos 0)",
"stacktrace":["Error: cannot insert NULL or update to NULL: 
DRAFTADMINISTRATIVEDATA_DRAFTUUID: line 1 col 1 (at pos 0)",
"at Request.reject 
(/home/vcap/app/node_modules/@sap/cds/lib/req/request.js:65:39)",
"at HanaDatabase.module.exports [as _CREATE] 
(/home/vcap/app/node_modules/@sap/cds/libx/_runtime/db/generic/create.js:38:9)",
"at runMicrotasks (<anonymous>)",
"at processTicksAndRejections 
(node:internal/process/task_queues:96:5)",
"at async next 
(/home/vcap/app/node_modules/@sap/cds/lib/serve/Service-dispatch.js:74:17)",
"at async HanaDatabase.handle (/home/vcap/app/node_modules/@sap/cds/lib/serve/Service-dispatch.js:72:10)",
"at async Promise.all (index 1)",
"at async ApplicationService._handler (/home/vcap/app/node_modules/@sap/cds/libx/_runtime/fiori/generic/new.js:87:3)",
"at async next (/home/vcap/app/node_modules/@sap/cds/lib/serve/Service-dispatch.js:74:17)",
"at async ApplicationService.handle (/home/vcap/app/node_modules/@sap/cds/lib/serve/Service-dispatch.js:72:10)"],"message":"cannot insert NULL or update to NULL: DRAFTADMINISTRATIVEDATA_DRAFTUUID: line 1 col 1 (at pos 0)",
"code":287,"sqlState":"HY000",
"position":0,"query":"INSERT INTO WBService_items_drafts ( Product_Product, ProductDesign, Quantity, unit, ID, parent_ID ) VALUES ( ?, ?, ?, ?, ?, ?, ? )",
"values":["***"],"numericSeverity":4,"id":"1752958",
"#cf":{"string":[{"k":"query",
"v":"INSERT INTO WBService_items_drafts ( Product_Product, ProductDesign, Quantity, unit, ID, parent_ID ) VALUES ( ?, ?, ?, ?, ?, ?, ? )",
"i":0}]}}

Any idea on how I could fix this issue?

Accepted Solutions (0)

Answers (1)

Answers (1)

Nparaman1
Discoverer
0 Kudos

Hi, I'm getting a similar error. How did you resolve it?