Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
hofmann
Active Contributor

Week 3 is over for me. Homework is submitted, content for week 4 already downloaded and ready to be watched.  This week was more intense for me and I am that I was capable of submitting the homework. This week was more focused on real practice after week 2 was teaching the theory. A nice touch of the course is that not everything is scripted and re-done several times until a perfect take is composed. Sometimes a demo fails and is solved right on (2x https) and Craig at least sounds surprised to some degree when something more complex works right away.

Week 3 covered registering to SMP, get and alter data. This meant: hands on. And while the SMP and backend system are real systems, real users and real connections have to be configured and established.

The schema is the same: first an example that can be run from the browser, than a hybrid app with Cordova. The Javascript file provided contains the logon information as shown in the course. To make it work, you have to modify the code. Easy! I’d suspect that everyone first checks the files before running the example, but for those who don’t do that, maybe a warning message in the index.html would be nice (“don’t simply click, alter the file first).

Don’t ask me why it shows: successful connection and at the same time nothing shows up in SMP:

I used the provided SAP Gateway Demo account as the application is using the ES1 system as authentication provider [1] [2]. The complete unit application worked, I got back, but the connection counter keeps insisting that there are 0 connections. I go with: it’s a cache issue.

The 2nd application of U3 shows in the Javascript source code that you have to add your own credentials:

var oModel = new sap.ui.model.json.JSONModel();
var myData = {};
myData.UserName = ""; // TODO: put your user name and password here
myData.Password = "";
oModel.setData(myData);

Not that this is needed, as this HTML5 app is more intelligent and asks for user/password.

That does not mean that you don’t have to adjust the controller.js file!

data.baseURL = "https://[your server].hanatrial.ondemand.com";
data.appName = "[your app]";

The result is a working app:

Sometimes later SMP also decided to agree upon connection facts:

Unit 5 gave me a small problem when trying to update the business partner. First I got a csrf token undefined.

I checked the header (Firebug) and the token was set. Looking into funciton getBP().

Original line:

header_xcsrf_token = response.headers['x-csrf-token'];

Modified line (all upper case)

header_xcsrf_token = response.headers['X-CSRF-TOKEN'];

After making the cookie upper case it worked:

This didn’t mean that I can change the business partner entry. I got a 403 forbidden. I guess that is a simple permission problem, as I am using ES1 system, and that should be read only.

Ongoing issues

Ongoing problem is the slow download speed of content. Here is a screenshot showing the speed for downloading a simple PDF for week 4. I tested my connection speed and 4.1 KB/sec is not related to me.

Another problem is that HANA Cloud / SMP gives me constantly a Javascript warning in Firefox: slow Javascript.

Other blogs in this series from me about the open SAP course: Introduction to Mobile Solution Development



[1] http://scn.sap.com/docs/DOC-31221

[2] http://scn.sap.com/docs/DOC-40986

3 Comments
Labels in this area