sap - Unable to access xsjs file from browser -
i new sap hana , trying expose .xsjs file data through webbrowser following url:
hostname:80<instance#>/workspace/session/a00/data/services/retrievedata.xsjs
however, getting following error when try access it:
this link seems broken not find resource you're trying access. might misspelled or unavailable
these files have created in project explorer:
myschema.hdbschema
schema_name="myschema"
trendsdata.hdbtable
table.schemaname = "myschema"; table.tabletype = columnstore; table.description = "newdataset order trendsdata"; table.columns = [ {name= "c"; sqltype = nvarchar; nullable = true; length=10; }, {name= "d"; sqltype = varchar; nullable = true; length=5; }, {name= "du"; sqltype = nvarchar; nullable = true; length=20; }, {name= "sa"; sqltype = decimal; nullable = true; length=30; }, {name= "i"; sqltype = decimal; nullable = true; length=30; }, {name= "g"; sqltype = decimal; nullable = true; length=30; }, {name= "g"; sqltype = decimal; nullable = true; length=20; }, {name= "str"; sqltype = decimal; nullable = true; length=30; } ]; table.primarykey.pkcolumns = ["inventory"];
orderid.hdbsequence
schema="myschema"; start_with=2000000; cycles=false; depends_on_table="workspace.session.a00.data::trenddata";
retrievedata.xsjs
$.response.contenttype="text/html"; var output = "helloworld"; var conn = $.db.getconnection(); var pstmt = conn.preparestatement("select * trenddata"); var rs = pstmt.executequery(); if (!rs.next()) { $.response.setbody( "failed retrieve data"); $.response.status = $.net.http.internal_server_error; } else { output=output + "this respose sql: " + rs.getstring(1); } rs.close(); pstmt.close(); conn.close(); $.response.setbody(output);
all above files succesfully committed , activated out error. still, error occurs in webrowser.
are sure url you've typed in browser built?
url's should built in following way:
server:port/repository_path/file_name
a wrong path may causing problem. please see example below:
host: hanacloud
port: 8000 (80 + instance_number)
sap hana repository tree:
mdo ->
sap ->
sflight ->
test ->
test.xsjs
url: hanacloud:8000/mdo/sap/sflight/test/test.xsjs
Comments
Post a Comment