<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>post Linking a CAP OData Service with ServiceNow using UI5 in Zero Copy Connector for ERP articles</title>
    <link>https://www.servicenow.com/community/zero-copy-connector-for-erp/linking-a-cap-odata-service-with-servicenow-using-ui5/ta-p/3447297</link>
    <description>&lt;P&gt;&lt;SPAN&gt;When you build ERP-style extensions, it’s common to have data and logic running in SAP (or any OData-compatible backend) and workflows running on ServiceNow. In my case, I used SAP Cloud Application Programming (CAP) to expose an OData V2 service. Then I wired it to ServiceNow using a small SAPUI5 app that communicates with both the CAP OData endpoint and the ServiceNow Table API.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;In this blog, I’ll walk through a simple end-to-end example so you can adapt it for your own ERP Canvas or custom apps.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Prerequisites&lt;/SPAN&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Basic familiarity with &lt;STRONG&gt;CAP&lt;/STRONG&gt; (Node.js flavor).&lt;/LI&gt;
&lt;LI&gt;A &lt;STRONG&gt;ServiceNow&lt;/STRONG&gt; instance with a table you can write to (or a POC table).&lt;/LI&gt;
&lt;LI&gt;SAPUI5 or Fiori tooling (Business Application Studio, VS Code with UI5 tooling, etc.).&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2&gt;&lt;SPAN&gt;Scenario Overview&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;The architecture has three main pieces:&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt; CAP service&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Exposes an OData V2 endpoint&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Contains an entity for CRUD example&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL start="2"&gt;
&lt;LI&gt;&lt;SPAN&gt; ServiceNow Table API&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - REST endpoint to insert records to ServiceNow table&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL start="3"&gt;
&lt;LI&gt;&lt;SPAN&gt; UI5 App (Bridge)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Uses CAP OData as default model&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Uses JSON model to call ServiceNow REST API&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Goal&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;: Post records into CAP OData and ServiceNow from a single UI.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Create and expose your CAP OData service&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Initialise project:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="javascript"&gt;cds init cap-odata-servicenow
cd cap-odata-servicenow
&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Define a simple data model&lt;/STRONG&gt;&lt;SPAN&gt; in &lt;/SPAN&gt;db/schema.cds&lt;SPAN&gt;&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="javascript"&gt;namespace demo;
entity Products {
  key ID          : UUID;
  Name            : String(111);
  Description     : String(255);
  ReleaseDate     : Date;
  Price           : Decimal(9,2);
  Rating          : Integer;
}
&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Expose it via service in srv/service.cds:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;LI-CODE lang="javascript"&gt;using demo from '../db/schema';
service CatalogService {
  entity Products as projection on demo.Products;
}
&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Enable OData V2 compatibility (optional but useful when integrating with tools expecting V2):&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;LI-CODE lang="javascript"&gt;npm install /cds-odata-v2-adapter-proxy&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Wire the adapter into your server.js (or equivalent) so that V2/OData/OData.svc&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;serves the V2 endpoint.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Run the CAP app locally&lt;/STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="javascript"&gt;cds watch&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;URL generated (example): &lt;A href="http://localhost:4004/V2/OData/OData.svc/" target="_blank" rel="noopener"&gt;http://localhost:4004/V2/OData/OData.svc/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 2&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Create UI5 app and consume both systems&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Next, create a small SAPUI5/Fiori app. In my project, the &lt;STRONG&gt;manifest&lt;/STRONG&gt; defines two data sources:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp; serviceNowService – the CAP OData V2 endpoint.&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp; mainService – the ServiceNow Table API.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;An excerpt from manifest.json looks like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;"dataSources": {
  "serviceNowService": {
    "uri": "/V2/OData/OData.svc/",
    "type": "OData",
    "settings": {
      "annotations": [],
      "localUri": "localService/serviceNowService/metadata.xml",
      "odataVersion": "2.0"
    }
  },
  "mainService": {
    "uri": "/api/now/table/sn_hr_core_saps4hanapoc_import",
    "type": "REST"
  }
},
"models": {
  "": {
    "dataSource": "serviceNowService",
    "preload": true,
    "settings": {}
  },
  "serviceNowRest": {
    "type": "sap.ui.model.json.JSONModel",
    "uri": "/api/now/table/&amp;lt;table_name&amp;gt;"
  }
}
&lt;/LI-CODE&gt;
&lt;P&gt;A few key points:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The &lt;STRONG&gt;default model&lt;/STRONG&gt; ("") is an OData model bound to serviceNowService (your CAP OData service).&lt;/LI&gt;
&lt;LI&gt;The &lt;STRONG&gt;serviceNowRest&lt;/STRONG&gt;&lt;STRONG&gt; model&lt;/STRONG&gt; is a JSONModel pointing to the ServiceNow Table API endpoint.&lt;/LI&gt;
&lt;LI&gt;This lets the same app talk to both systems: OData via the default model and REST via the JSON model.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 3&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Controller logic to POST data&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In the main view controller (View1.controller.js), I implemented two handlers:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;onPostOData – Posts a new Products entry to the CAP OData service.&lt;/LI&gt;
&lt;LI&gt;onPostServiceNowRest – Posts an HR import row to the ServiceNow table via REST.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here is the core logic (simplified) from View1.controller.js:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;onPostOData: function () {
  var oModel = this.getView().getModel(); // default OData model
  var oEntry = {
    Name: "New Product",
    Description: "Sample Description",
    ReleaseDate: "/Date(1622505600000)/",
    Price: 99.99,
    Rating: 5
  };

  oModel.create("/Products", oEntry, {
    success: function (oData, response) {
      MessageToast.show("Product created successfully! (Status: " + response.statusCode + ")");
    },
    error: function (oError) {
      var statusCode = oError.statusCode || (oError.response &amp;amp;&amp;amp; oError.response.statusCode) || "Unknown";
      MessageToast.show("Error creating Products. (Status: " + statusCode + ")");
    }
  });
},
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is enough for a working E2E proof of concept:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Click &lt;STRONG&gt;“Create Product”&lt;/STRONG&gt; → data goes to CAP OData.&lt;/LI&gt;
&lt;LI&gt;Click &lt;STRONG&gt;“Create HR Import Row”&lt;/STRONG&gt; → data goes to ServiceNow Table API.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 4&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Run UI and verify&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In your XML view, add two buttons and bind them to the controller methods:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Button text="Post to OData" press=".onPostOData" /&amp;gt;
&amp;lt;Button text="Post to ServiceNow" press=".onPostServiceNowRest" /&amp;gt;
​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Run the UI5 app (e.g. npm start or via ui5 serve depending on your tooling).&lt;/LI&gt;
&lt;LI&gt;Open the app in the browser and try both buttons:
&lt;UL&gt;
&lt;LI&gt;Validate that CAP receives and persists the Products record.&lt;/LI&gt;
&lt;LI&gt;Verify in ServiceNow that a new row was inserted into your table.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Once this works locally, you can deploy:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;CAP service → SAP BTP (or another Node runtime).&lt;/LI&gt;
&lt;LI&gt;UI5 app → wherever you host your Fiori/UI5 apps.&lt;/LI&gt;
&lt;LI&gt;Ensure the URLs and destinations are adjusted accordingly.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 5&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Extending into ERP Canvas&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In more advanced scenarios, you can:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If you want to create/read/update data in SAP using an exposed OData v2 endpoint, use Zero Copy Connector for ERP to model operations over the CAP OData service (for example, using a “Model creation using OData Service” pattern similar to other ServiceNow guides).&amp;nbsp;&lt;A href="https://www.servicenow.com/community/app-engine-for-erp-blogs/re-organize-mapped-value-names-of-erp-canvas-models/ba-p/3265344" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;ServiceNow&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Use the CAP OData service as your &lt;STRONG&gt;SAP-side abstraction&lt;/STRONG&gt; and the ServiceNow Table API as your &lt;STRONG&gt;workflow/case-management side&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;Keep your CAP logic focused on data &amp;amp; business rules, and let ServiceNow handle approvals, tasks, and notifications.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The simple UI5 bridge shown here is mainly for:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Prototyping end-to-end flows.&lt;/LI&gt;
&lt;LI&gt;Testing connectivity and payloads.&lt;/LI&gt;
&lt;LI&gt;Providing a reference for how CAP OData and ServiceNow REST can be used together.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Tips:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt; Use OAuth/credentials for ServiceNow securely&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt; Add error logging when scaling production use&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt; Maintain consistent field mapping between SAP ⇆ SNOW&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Conclusion&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;SPAN&gt;We successfully connected the CAP OData service with ServiceNow using a UI5 application.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;This flexible architecture enables bi-directional integration, real-time data operations, and plug-in to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;ERP Canvas or automation frameworks. This serves as an excellent boilerplate for larger projects.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Dec 2025 07:31:00 GMT</pubDate>
    <dc:creator>Sagar Gupta</dc:creator>
    <dc:date>2025-12-11T07:31:00Z</dc:date>
    <item>
      <title>Linking a CAP OData Service with ServiceNow using UI5</title>
      <link>https://www.servicenow.com/community/zero-copy-connector-for-erp/linking-a-cap-odata-service-with-servicenow-using-ui5/ta-p/3447297</link>
      <description>&lt;P&gt;&lt;SPAN&gt;When you build ERP-style extensions, it’s common to have data and logic running in SAP (or any OData-compatible backend) and workflows running on ServiceNow. In my case, I used SAP Cloud Application Programming (CAP) to expose an OData V2 service. Then I wired it to ServiceNow using a small SAPUI5 app that communicates with both the CAP OData endpoint and the ServiceNow Table API.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;In this blog, I’ll walk through a simple end-to-end example so you can adapt it for your own ERP Canvas or custom apps.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Prerequisites&lt;/SPAN&gt;&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Basic familiarity with &lt;STRONG&gt;CAP&lt;/STRONG&gt; (Node.js flavor).&lt;/LI&gt;
&lt;LI&gt;A &lt;STRONG&gt;ServiceNow&lt;/STRONG&gt; instance with a table you can write to (or a POC table).&lt;/LI&gt;
&lt;LI&gt;SAPUI5 or Fiori tooling (Business Application Studio, VS Code with UI5 tooling, etc.).&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2&gt;&lt;SPAN&gt;Scenario Overview&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;The architecture has three main pieces:&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt; CAP service&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Exposes an OData V2 endpoint&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Contains an entity for CRUD example&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL start="2"&gt;
&lt;LI&gt;&lt;SPAN&gt; ServiceNow Table API&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - REST endpoint to insert records to ServiceNow table&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL start="3"&gt;
&lt;LI&gt;&lt;SPAN&gt; UI5 App (Bridge)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Uses CAP OData as default model&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; - Uses JSON model to call ServiceNow REST API&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Goal&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;: Post records into CAP OData and ServiceNow from a single UI.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Create and expose your CAP OData service&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Initialise project:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="javascript"&gt;cds init cap-odata-servicenow
cd cap-odata-servicenow
&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Define a simple data model&lt;/STRONG&gt;&lt;SPAN&gt; in &lt;/SPAN&gt;db/schema.cds&lt;SPAN&gt;&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="javascript"&gt;namespace demo;
entity Products {
  key ID          : UUID;
  Name            : String(111);
  Description     : String(255);
  ReleaseDate     : Date;
  Price           : Decimal(9,2);
  Rating          : Integer;
}
&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Expose it via service in srv/service.cds:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;LI-CODE lang="javascript"&gt;using demo from '../db/schema';
service CatalogService {
  entity Products as projection on demo.Products;
}
&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Enable OData V2 compatibility (optional but useful when integrating with tools expecting V2):&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;LI-CODE lang="javascript"&gt;npm install /cds-odata-v2-adapter-proxy&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Wire the adapter into your server.js (or equivalent) so that V2/OData/OData.svc&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;serves the V2 endpoint.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Run the CAP app locally&lt;/STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="javascript"&gt;cds watch&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;URL generated (example): &lt;A href="http://localhost:4004/V2/OData/OData.svc/" target="_blank" rel="noopener"&gt;http://localhost:4004/V2/OData/OData.svc/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 2&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Create UI5 app and consume both systems&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Next, create a small SAPUI5/Fiori app. In my project, the &lt;STRONG&gt;manifest&lt;/STRONG&gt; defines two data sources:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp; serviceNowService – the CAP OData V2 endpoint.&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp; mainService – the ServiceNow Table API.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;An excerpt from manifest.json looks like this:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;"dataSources": {
  "serviceNowService": {
    "uri": "/V2/OData/OData.svc/",
    "type": "OData",
    "settings": {
      "annotations": [],
      "localUri": "localService/serviceNowService/metadata.xml",
      "odataVersion": "2.0"
    }
  },
  "mainService": {
    "uri": "/api/now/table/sn_hr_core_saps4hanapoc_import",
    "type": "REST"
  }
},
"models": {
  "": {
    "dataSource": "serviceNowService",
    "preload": true,
    "settings": {}
  },
  "serviceNowRest": {
    "type": "sap.ui.model.json.JSONModel",
    "uri": "/api/now/table/&amp;lt;table_name&amp;gt;"
  }
}
&lt;/LI-CODE&gt;
&lt;P&gt;A few key points:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The &lt;STRONG&gt;default model&lt;/STRONG&gt; ("") is an OData model bound to serviceNowService (your CAP OData service).&lt;/LI&gt;
&lt;LI&gt;The &lt;STRONG&gt;serviceNowRest&lt;/STRONG&gt;&lt;STRONG&gt; model&lt;/STRONG&gt; is a JSONModel pointing to the ServiceNow Table API endpoint.&lt;/LI&gt;
&lt;LI&gt;This lets the same app talk to both systems: OData via the default model and REST via the JSON model.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 3&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Controller logic to POST data&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In the main view controller (View1.controller.js), I implemented two handlers:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;onPostOData – Posts a new Products entry to the CAP OData service.&lt;/LI&gt;
&lt;LI&gt;onPostServiceNowRest – Posts an HR import row to the ServiceNow table via REST.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here is the core logic (simplified) from View1.controller.js:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;onPostOData: function () {
  var oModel = this.getView().getModel(); // default OData model
  var oEntry = {
    Name: "New Product",
    Description: "Sample Description",
    ReleaseDate: "/Date(1622505600000)/",
    Price: 99.99,
    Rating: 5
  };

  oModel.create("/Products", oEntry, {
    success: function (oData, response) {
      MessageToast.show("Product created successfully! (Status: " + response.statusCode + ")");
    },
    error: function (oError) {
      var statusCode = oError.statusCode || (oError.response &amp;amp;&amp;amp; oError.response.statusCode) || "Unknown";
      MessageToast.show("Error creating Products. (Status: " + statusCode + ")");
    }
  });
},
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is enough for a working E2E proof of concept:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Click &lt;STRONG&gt;“Create Product”&lt;/STRONG&gt; → data goes to CAP OData.&lt;/LI&gt;
&lt;LI&gt;Click &lt;STRONG&gt;“Create HR Import Row”&lt;/STRONG&gt; → data goes to ServiceNow Table API.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 4&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Run UI and verify&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In your XML view, add two buttons and bind them to the controller methods:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Button text="Post to OData" press=".onPostOData" /&amp;gt;
&amp;lt;Button text="Post to ServiceNow" press=".onPostServiceNowRest" /&amp;gt;
​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Run the UI5 app (e.g. npm start or via ui5 serve depending on your tooling).&lt;/LI&gt;
&lt;LI&gt;Open the app in the browser and try both buttons:
&lt;UL&gt;
&lt;LI&gt;Validate that CAP receives and persists the Products record.&lt;/LI&gt;
&lt;LI&gt;Verify in ServiceNow that a new row was inserted into your table.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Once this works locally, you can deploy:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;CAP service → SAP BTP (or another Node runtime).&lt;/LI&gt;
&lt;LI&gt;UI5 app → wherever you host your Fiori/UI5 apps.&lt;/LI&gt;
&lt;LI&gt;Ensure the URLs and destinations are adjusted accordingly.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;STEP 5&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; – Extending into ERP Canvas&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In more advanced scenarios, you can:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If you want to create/read/update data in SAP using an exposed OData v2 endpoint, use Zero Copy Connector for ERP to model operations over the CAP OData service (for example, using a “Model creation using OData Service” pattern similar to other ServiceNow guides).&amp;nbsp;&lt;A href="https://www.servicenow.com/community/app-engine-for-erp-blogs/re-organize-mapped-value-names-of-erp-canvas-models/ba-p/3265344" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;ServiceNow&lt;/SPAN&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Use the CAP OData service as your &lt;STRONG&gt;SAP-side abstraction&lt;/STRONG&gt; and the ServiceNow Table API as your &lt;STRONG&gt;workflow/case-management side&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;Keep your CAP logic focused on data &amp;amp; business rules, and let ServiceNow handle approvals, tasks, and notifications.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The simple UI5 bridge shown here is mainly for:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Prototyping end-to-end flows.&lt;/LI&gt;
&lt;LI&gt;Testing connectivity and payloads.&lt;/LI&gt;
&lt;LI&gt;Providing a reference for how CAP OData and ServiceNow REST can be used together.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Tips:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt; Use OAuth/credentials for ServiceNow securely&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt; Add error logging when scaling production use&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt; Maintain consistent field mapping between SAP ⇆ SNOW&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Conclusion&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;&lt;SPAN&gt;We successfully connected the CAP OData service with ServiceNow using a UI5 application.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;This flexible architecture enables bi-directional integration, real-time data operations, and plug-in to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;ERP Canvas or automation frameworks. This serves as an excellent boilerplate for larger projects.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2025 07:31:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/zero-copy-connector-for-erp/linking-a-cap-odata-service-with-servicenow-using-ui5/ta-p/3447297</guid>
      <dc:creator>Sagar Gupta</dc:creator>
      <dc:date>2025-12-11T07:31:00Z</dc:date>
    </item>
  </channel>
</rss>

