Hi,
I am facing error 500(Internal Server error) upon executing the following piece of XSJS code. Any help is highly appreciated.
I am extremely new to XSJS, the CDS view works fine standalone.
function getRecord(){
var xsds = $.import("sap.hana.xs.libs.dbutils","xsds");
var ProductOverview = xsds.$importEntity("dev.gls","ar2.ProductOverview");
var Query = ProductOverview.$query();
var Product = Query.$project({
PRODUCT_ID: true,
PRODUCT_NAME: true
});
var result = Product.$execute();
$.response.contentType = "application/json";
$.response.setBody(JSON.stringify(result));
$.response.headers.set('access-control-allow-origin','*');
$.response.status = $.net.http.OK;
result.close();
}
getRecord();
Thanks
Arka
Request clarification before answering.
Discussion successfully moved from SAP Gateway to SAP HANA Cloud Platform Developer Center
Regards,
JK (Moderator)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.