Skip to Content

Walkthrough in WebIDE: sap is not defined

Hi All,

I was going through the walkthrough tutorial and creating this in eclipse. I reached till step 8 and it was working fine in eclipse. Now I copied all my folders and files to WebIDE and when I tried to run the index.html file as web application, it shows error that "sap is not defined". PFB the screenshots and code of index file.

<!DOCTYPE HTML>
<html>
  <head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta charset="UTF-8">
        <title>Walkthrough</title>
  <script
  id="sap-ui-bootstrap"
  src="resources/sap-ui-core.js"
  data-sap-ui-theme="sap_bluecrystal"
  data-sap-ui-libs="sap.m"
  data-sap-ui-bindingSyntax="complex"
  data-sap-ui-compatVersion="edge"
  data-sa-ui-preload="async"
  data-sap-ui-resourceroots='{
  "sap.ui.demo.wt": "./"
  }'>
  </script>
  <script>
  sap.ui.getCore().attachInit(function () {
       sap.ui.xmlview({
       viewName : "sap.ui.demo.wt.view.App"
       }).placeAt("content");
     });
  </script>
  </head>
  <body class="sapUiBody" id="content">
  </body>
</html>

Please help me in resolving this.

Regards,

Ekansh

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Jul 01, 2015 at 12:45 PM
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Subhashini,

      The code for neo-app.json is:

      {

      "routes": [

      {

      "path": "/resources",

      "target": {

      "type": "service",

      "name": "sapui5",

      "entryPath": "/resources"

      },

      "description": "SAPUI5 Resources"

      }

      ]

      }

      You need to make sure that the folder structure is as I mentioned in below response. All the files should be in the root folder.

      Regards,

      Ekansh

  • Jul 01, 2015 at 12:51 PM

    That looks like your path to SAPUI5 (src="resources/sap-ui-core.js") is not correct. Check where you deployed it and modify that.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Dhananjay,

      I have deployed it on webide. It worked with Santhosh's reply but I am curious for the reason because in all other apps that are already deployed on my webide account use the same src.

      Regards,

      Ekansh

  • Sep 10, 2015 at 01:46 PM

    Thread is locked due to necromancy. Please read the Rules of Engagement in the Getting Started link at the top right of each page. Create your own Discussion if the solution to an already marked Answered thread does not work for you.

    Regards, Mike (Moderator)

    SAP Technology RIG

    Add comment
    10|10000 characters needed characters exceeded