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

How to integrate XSJS service into OData service

$
0
0

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">

<code/>

 

<messagexml:lang="en-US">Invalid script.</message>

</error>


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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