Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Parameter in OData modification xs exit

$
0
0

Hello experts,

 

I have 2 generic tables (tbl1, tbl2) and a couple of Calculation Views (calcview1, calcview2...) over those 2 tables. These calculation views are exposed on OData with XS exit for CREATE/UPDATE/DELETE.

 

service {    "playground::calcview1" as "TestView1" key ("ID")         create using "playground:jsexit.xsjslib::xs_create_test"        delete using "playground:jsexit.xsjslib::xs_delete_test"        update using "playground:jsexit.xsjslib::xs_update_test";    "playground::calcview2" as "TestView2" key ("ID")         create using "playground:jsexit.xsjslib::xs_create_test"        delete using "playground:jsexit.xsjslib::xs_delete_test"        update using "playground:jsexit.xsjslib::xs_update_test";
....
....
}

In XS exit, I am modifying both the underlying tables (tbl1, tbl2).

 

As you can see I wanted to use a single XS exit function for all views. To complete my logic, in the XS function (function xs_create_test(param)), I wanted to get either name of the originally bound view or some custom parameter that I pass with the POST request body (eg:- CUSTOMPARAM_VIEWNAME in the below) ,

 

{

  "ID": 1,

"EMPLOYEENAME" : "test",

"DESIGNATION" : "Manager",

  "CUSTOMPARAM_VIEWNAME" : "calcview2"

}

 

When I pass extra fields in the request body as above, I get

 

400 Bad Request

Request contains properties that do not exist in entity 'TestViewType&#x0027

 

Please let me know if there are any ways to pass some custom variable (which is not part of the OData columns) from OData to XS exit. Also I welcome suggestions if this can be better handled using some alternates.


Thanks,

Ramees


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>