Application Development and Automation 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: 
Read only

BOPF-based CDS View with Generated ID - Batch Processing Error for Child Nodes

samson_moses
Explorer
0 Likes
2,522

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 service Data Source references. My SAP Version is 7.50 - SP level 16.

As part of my requirement I had to include Basic Analytical annotation @DefaultAggregation in my root node consumption view. Due to this, my semantic keys were replaced by SADL generated key, GENERATE_ID. But still all my source key based processing / navigations like READ, EXPAND works fine.

The problem I am facing is when adding(POST call) a child node record to my existing header record via my service ( I believe even update would fail, but didn't check it for now ). The call simply returns 202 code - An Exception is raised in my GW system. Below is the snippet of my POST call.

Now I checked why my READ, EXPAND works fine when I pass the GENERATED_ID. This is because the CL_SADL_GW_GENERIC_DPC class(method _EVALUATE_ANALYTICAL_ID) from the SADL framework does the needful conversion of GENERATED_ID key value to the semantic keys, before passing the control to BOPF framework(The GENERATED_ID is not part of the BOPF structures).

But during Batch processing this conversion does not happen. In the below code section of standard SADL framework, in debug mode, I converted the contents of my GENERATED_ID to my actual service keys, I see the processing works fine.

Kindly suggest if I am missing something here. In the worst case, I may have to drop my analytical annotations.

Regards,

Samson.

4 REPLIES 4
Read only

samson_moses
Explorer
0 Likes
1,914

Hi All,

I had raised an incident in SAP and as per SAP, it seems , we should not be using Aggregation annotations in transactional views ( having transactionalProcessingDelegated or transactionalProcessingEnabled annotations ).

Below is the response from SAP team :

"Transactional enabled entities cannot contain any aggregation, as during the transactional processing (CreateUpdateDelete), the aggregated element has no representation on the database in its aggregated state. Therefore aggregation (a Read operation) and transactional enablement are mutual exclusive.

In your case I would suggest to create a sibling entity for ZC_<MyConsumptionView> containing the aggregation that is neither transactionalProcessingDelegated nor transactionalProcessingEnabled. By defining an association from your Consumption view to the sibling entity, you could retrieve the aggregated information by using this association".

Also, I am not sure why the images are not visible now. Adding the same here for reference purposes.

Regards,

Samson

Read only

maheshpalavalli
Active Contributor
0 Likes
1,914

Thanks for the update Samson, still not able to see images,

i guess i answered the same in your previous question.

https://answers.sap.com/questions/12948535/sapui5-and-odata-modelling-approach.html?childToView=1294...

Read only

samson_moses
Explorer
1,914

Hi Mahesh,

Thanks for the response.

My query was on how the Generated_ID feature, generated by framework for handling aggregation annotations, breaks Change-Set Batch Calls.

I am not able to add the images again in the comments section, not sure why. So revised my question again.

My source key based processing / navigations like READ, EXPAND works fine because the SADL framework converts and transfers the GENERATED_ID key value to its respective semantic keys. But during batch processing this is not happening and the batch call goes into error. If I remove the aggregation and just use the semantic keys, the call is successful.

Regards,

Samson.

Read only

maheshpalavalli
Active Contributor
0 Likes
1,914

Hi samsonmoses1977

Thanks for the update, probably the genererated ID is not so unique for the framework to understand and post the new entries to it's association. I mean framework needs to know for which parent's child it needs to post the new entries right.

Or probably an another unhandled/bug scenario by SAP like your another question and they might come with another oss note.

Again thanks for the update 🙂

Mahesh