Skip to Content

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 07, 2017 at 12:28 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded