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: 

How to validate the data sent by POST method to OData service generated by CDS View with BOPF

sucheno
Participant
0 Kudos

Hello,

We have created a CDS view with BOPF objects and using the OData service generated by it in UI5 layer.

We are creating and sending the data set from UI5 layer using POST method.

By default, the OData is storing data set in the table specified in BOPF object, We need to validate the data before storing it.

Can someone help here how can we validate the data received by POST method against master data table data.

Where and how exactly can we implement the logic.

Eg: If master data exists for Cost Center Group is C0101-2, C0101-3. it should check before storing whether the data received by POST method is valid.

2 REPLIES 2

cwolter90
Participant

You can create an action validation for the "CREATE_NODE_NAME" action. You have to add the node's key to parameter ET_FAILED_KEY. Then the service will answer with 500. You can also add messages with parameter EO_MESSAGE. The messages will be visible in response.

0 Kudos

Hi, Thanks for the answer. Unfortunately I had to switch to gateway OData model instead of OData of a CDS view because of many other complexities.