cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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

0 Likes
View Entire Topic
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Likes

Discussion successfully moved from SAP Gateway to SAP HANA Cloud Platform Developer Center

Regards,

JK (Moderator)