Hello experts!
I have a problem. I want use smart-table on UI. I use OData protocol, but medata doesn't contain all necessary attributes.
I try fix this problem with XSJS, which will add necessary attributes. And then I want to call XSJS from OData.
I have a questions. How can I call XSJS service logic in OData service?
Header function from XSJS:
function metadata(param) {
var result = processXML(param.metadata, function(name, atts) {
var EDM = "http://schemas.microsoft.com/ado/2008/09/edm";
var SAP = "http://www.sap.com/Protocols/SAPData";
var newAtts = {};
if (name === EDM + ":Property" && atts.Name === "M1") {
newAtts[SAP + ":label"] = "The Measure";
}
return newAtts;
});
return {metadata: result};
}
OData service:
service{
"blabla::CV_TEXT_OD" as "Product" key ("PRODUCT_ID");
metadata using "blabla.xs_test:metadata_exit.xsjs::metadata";
}
annotations {
enable OData4SAP;
}
When I try run OData service its OK. But when I try to get metadata I have an error:
<errorxmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<messagexml:lang="en-US">Invalid script.</message>
</error>