A peek inside xSync and the HANA XS Engine

/wp-content/uploads/2013/06/icon_128x128_231789.png

On saturday I published a blog about a small app I wrote called xSync – basically a XS Engine app for Mac developers where you can sync a local development folder with your HANA repository. This is for rapid development and to encourage the “bring your own IDE” approach to application development on HANA. Here is a look behind the scenes on how the app works and some of the challenges of the project.

Image.png

As mentioned in my previous blog – I started using the IDE Lightweight editor after doing the upgrade of my AWS HANA box last weekend. I enjoyed the experience but after working with it for nearly a full day was wanting a little more. Syntax highlighting, easy commenting, easy indentation, CSS autocomplete and hints, etc. etc. so I started doing some peaking around the editor itself and came to find the editor is something called ACE, a pretty nice little open source IDE (written in JS). This got me thinking … maybe I could insert text directly into the Lightweight IDE browser text box, and submit the form as a save …. hmmm …. not a terrible idea …. just need to scrape the page, find the elements and submit the form via some injected JS. Pretty simple …  I did some digging and found the HTML objects I needed by using Firebug when a lightbulb went off … instead of populating the form via a HTML page, why not rather check the HTTP methods it is calling when doing the actual save, since there must be some integration with HANA directly … which is when I came across the mother load … a small file called reposervice.xsjs 🙂 It seemed that every time I was saving or modifying my objects through the IDE, it was calling this file. After checking out the parameters it was `, it was very clear that the methods and text were easy to simulate. I fired up REST Client and within a couple minutes the concept was POC’ed. Pass your file contents as your body with a path param and a POST and you were off to the races 🙂 

Screen Shot 2013-06-09 at 4.39.png

Using Firefox Rest Client to monitor system calls showed each save, create, delete operation was using a small file called reposervice.xsjs, which references the libraries needed for the repository modifications. read more

xSync – Making HANA XS development easier

Update: March 7th 2014

– Added support for SAP HANA SPS07 
– Ability to ignore local deletes, which would leave the files on the server 
– Shortcut link opens the Web Editor, and another to open IDE in your browser 

– Stability and speed improvements 
– Corrected multiple minor bugs  

————————————————————————————————————————————————

A couple of weeks ago, I started playing with HANA development after going through a couple of the opensapcourses. One of my biggest surprises was that HANA Studio was windows only. As a Web/Mobile/App developer spending majority of my time on the Mac platform, having to get my Dell out was a walk down memory lane, and caused me to not spend as much time working on the projects as I would have liked. Since Rev 52 of HANA included a XS Engine Lite IDE, a useful web based IDE for your XSJS/SAPUI5 development. I was been looking forward to getting it installed on my AWS machine and giving it a test drive. Last weekend Juergen Schmerderposted a updated really easy to follow and simple guide of going through the process and within a hour, I was up and running on the newest available rev. read more

Quick View for SAP Notes

In my ever growing quest to provide quick and easy access to SAP Notes (which Dagfinn Parnas started a couple of years ago with the Android Note Viewer), I recently finished creating a windows version of a small app to make opening notes just a little easier.

When deciding if I should get this done, it was purely out of personal need. Having spent the last few months building up a couple of Gateway test, stage and Prod systems, the ability to open a SAP note quickly, always seemed to elude me. Open service.sap.com/support -> click on Help & Support -> Type the note and go. Albeit the app developed still has some user interaction (until Google Glass arrives?) … it does make it a little simpler. I also found a small cmd script online which looked helpful. read more

zSCN – A iPad SCN Community Reader

After spending a couple of months traveling in 2012, I wrote a personal app for reading and following content created on the SAP Community Network. Although it was slightly buggy and ghetto, I found it way faster than firing up my MBA to check if a comment or something helpful had been posted in my local Netweaver Gateway hangout. I spent the last +- 6 months using the app and after reading a few comments on the new Idea place and in the forums, I decided a couple of others may find it helpful and set out to build a user friendly version. 

Now on to the app …. firstly, starting up the app you are presented with a list of spaces (thanks to Jason Lax for creating a helpful list here!), secondly, the app uses the RSS feeds from each SCN “Space” to curate the content, each time you select a space the content is cached on the device (in a little SQLite DB) and refreshes each time the space is opened. You can also select the number of items which are downloaded in each category (blogs, documents and forums). After logging into SCN using your SCN username/password, it will download your spaces, people and saved content. Keep in mind that you cannot “save” or create content from the app, since the SCN API’s are not currently publicly available (I am hoping for some change on this!). However, each item can be selected and the original content will be displayed on the website where you can login and respond/comment. You can also easily email the item to a friend in need, or tweet it if you are a social butterfly 😉  read more

iOS App: Blaze for SAP Netweaver Gateway

72-App-Store-Icon.png

A couple of months ago I was working on creating services for a SAP App store app called Production Insight for SAP. While working on the app I constantly found myself using RESTClient for Firefox to test, debug and view the attributes of my service while I was developing in XCode. Eventually I pulled up the metadata and service implementation on my iPad and used it as a second screen for reference. This made my life much easier. After having done this a couple of times over the past few months, I figured it wouldn’t be a bad idea to create an app which not only lets you view the service and its details, but also save requests, test them against multiple servers and also view the details easily. Which is why I built “Blaze”, it does all this and a little more. It is a free app and available in the app store as of yesterday, if I could put a “demo” or “beta” sticker on it: I would. (but apple won’ approve anything like that!) for all you “gatewayers” out there, please test it out and let me know what you like and don’t. My intention is to create a iOS client for gateway which is useful to developers like myself. The app can also handle other OData servers and services like Netflix and XS Engine from HANA. read more

Start 2 Finish: Developing an iPad app using SAP Netweaver Gateway

Essentially, these are some of my slides from a TechEd presentation last week (MOB205). My position with this presentation is to depict the overall process I use when developing an app, a few of the *many* considerations to make, as well as the simplicity of using a product like Gateway to actually connect and “consume” ERP/CRM/Back office data in a few lines of code.

Slides
Capture.PNG
Why Mobile?Needs no introduction, mobile was one of the hottest topics at TechEd this year, if it had a “girly” name or acronym like “HANA” … I am convinced it would have been “the” hottest topic 🙂 Why Gateway?The mobile landscape is fairly complex right now, lot sof vendors, lots of choices and not particularly easy to navigate. One this is for sure, services are here to stay – particularly REST based web services and that is exactly what Gateway is built for.Another great product: XS Data Services for HANA …. 
Capture2.PNG
So this is the app being designed during the presentation. Essentially my goal was to develop a “template” type app which the attendees could download and use as a starting point for their mobile app development and encourage them to get their feet wet.
The app makes 2 service calls. 1 to pull a list of customers from SAP ERP, once selecting a customer, the app would download the additional details of the customer including the address. And lastly – the “idea” … anyone wanting to customize the app could pull additional data in, a good example would be: An Accounts Receivable Clerk who attends a weekly open payables meeting, may want to take their iPad, get a list of customers, select one in question and see all open payables which are relevant … easy to do with this type of structure and simple to implement.Another example was a Business Development road warrior who could select a customer, and see a list of Open Quotes.Your app … here is some starter type code and you decide …
I skipped a couple of the slides related to the Gateway platform … this included this slide/blog post I added a couple of weeks ago:http://scn.sap.com/community/netweaver-gateway/blog/2012/10/02/what-sap-netweaver-gateway-is-not
Slide3.PNG
During the presentation I also reminded folks that mobile apps can be powered by a variety of data providers, including a method we (Lithium labs) did a couple years ago which was actually using SAP.Net Connector (v2.0) to create a ASP.NET Web Service (XML) which was called from the mobile device which worked and is still in production today.
Capture5.PNG
In this app, all the components are distributed. The Netweaver Gateway instance in the cloud at AWS (Thanks John!) and connected to a ERP backend which is in Walldorf (ES Workplace). The app talks to the AWS GW machine which pulls the data from the ERP and gives it back to the iPad via a REST web call.
Slide10.PNG
Now that we have covered the platform, we will go through the prerequisites for developing the iPad app. We will cover the development machine types, software need and useful tools.
Slide12.PNG
A mac development machine is recommended, when I started out 3 years ago, I tied to put together a hackintosh … didnt work, first update and it bombed… waste of time. A used mac mini off craigslist goes for +- $300 … worth the investment.
Slide13.PNG
This is an overview of the developer accounts – most important point was that with the free account you cannot run your app on a physical device … (boo). Pay the $99 if you are getting started and if you develop something your company wants to deploy on a larger scale … i.e. > 10 devices, pony up to the Enterprise Program.Click here for additional details:https://developer.apple.com/programs/start/ios
Slide14.PNG
Development options.I am a native kind of guy …
Slide15.PNG
Useful tools include a solid graphics editor … I estimate that I spent +- 50% of my time when developing an app from start to finish with graphics and the UI. If you have access to a graphic or UI designer … USE THEM 🙂 RESTClient for Firefox has saved me multiple hours … a quick and easy way to test your services before development.
Slide17.PNG
In this case the 5 steps simply outline the general direction needed to take a app from conception to production.
Slide18.PNG
From a requirements point of view and as mentioned in the introduction, the app was built to provide a framework for the participants and encourage them to “Extend” it.
Slide19.PNG
When starting the app it makes an initial service call from BAPI_CUSTOMER_GETLIST, selecting one of the records will make a second call usig BAPI_CUSTOMER_GETDETAIL and populate the detail page.
Slide20.PNG
Another suggestion I made was to proof out the data access portion first, not necessarily build from the bottom up, but rather ensure that all data fields which are required are accessible. I have spent countless hours developing front end apps, with a “wishlist” of datasets which were not feasible when I started modelling the data services and had to reconsider many points.
Checkpoint
Slide21.PNG
So next up from a design perspective and as mentioned above, we walked through the data exposure piece, essentially using SE80 to take your BAPI and create a web service. From SP04 – this should be done in SEGW, not SE80. 
Slide24.PNG
Once the service has been created and exposed, RESTClient for firefox is a great tool for testing the service before even touching any code. This to me is part of the “data access” test I do before design.
Slide25.PNG
Executing our service in this case produced the results showing a list of the customer details.
Checkpoint
Slide26.PNG
Data has been exposed and seems to be working. Next up design the app UI.
Slide27.PNG
Slide28.PNG
Slide29.PNG
As mentioned, a point people found interesting in the presentation was that I spent on average 50% of my time in a graphics editing program like photoshop, designing icons, UI elements, etc. IMO – UI is the difference between a good app, and a great app. The iPad/iPhone graph paper is very handy and you can print or even buy your own from this site: http://sneakpeekit.com/pad-sketchsheets/
Slide30.PNG
I also suggested that open source software should be considered when developing mobile apps, in our case the app will be using 2 packages to make life simpler, JSONKit and AFNetworking. Cocoacontrols.com is a great website for discovering open source code.
Checkpoint
Slide31.PNG
At this stage the data source created, the UI designed and its time to do some coding in XCode. I will be going into more detail behind these steps in an upcoming blog series called “S2F”.
Slide33.PNG
Start with a master – detail template (from XCode). Add your UI elements comprising of labels and buttons.
Slide35.PNG
Create a 20 line method for fetching data from your gateway service and displaying it on the screen. Very quick and simple. Obviously *good* programming takes considerably more time, but as a POC and starting point, this is perfect.
Checkpoint
Slide36.PNG
Data, design and code done, next up some testing and deployment options.
Slide38.PNG
We did a quick test and spoke about the deployment options. If you are a partner and would like to certify your app, work needs to be done to package your content using the AAK toolkit and developing in your own namespace.Also keep in mind that with a apple enterprise license:“An app will not run if the distribution certificate has expired. Currently, distribution certificates are valid for one year. A few weeks before your certificate expires, request a new distribution certificate from the iOS Dev Center, use it create create new distribution provisioning profiles, and then recompile and distribute the updated apps to your users.”
Slide39.PNG
Wrapping things up, we can see that with only a few lines of code you can easily (and without any additional tools) can connect and consume data from Netweaver Gateway. Also keep in mind that if you would like to cache that data in a local sqlite db, it really only takes a few more lines to make data available offline. (differential control when writing data is a WHOLE nother story!)

At the end a couple of the questions included:

I see you are passing the username and password in the URL? Yes, in this example that was the case to display the simplicity. Pratically you would want to definitively use SSL, pass your params in the header of the HTTP request and also possible hash/encrypt these variables. read more

Supplier Analytics – a new free iPad app

After writing about utilizing javascript charts in iOS apps a little while ago, I decided it would be a good marketing tool for my company (Lithium Labs) to develop a free/public app which demonstrated the features of using such technologies on handheld devices. The free app is called Supplier Analytics and when using the sample dataset gives you some insight into how a enterprise app could be used in an automotive manufacturing/supplier environment. The app gives operations or managers insight into the performance and operational well-being of a company globally, and nationally by subsequently drilling down into a production facility or branch. read more

Integrating Apple Siri with SAP Gateway

After hearing about folks hacking Apple’s Siri to do things like starting their Viper and controlling their thermostat, I thought about utilizing voice based integration with SAP to retrieve data. By default, Apples technology is pretty well locked down, but it didn’t take long for a developer to introduce a small workaround using a ruby app and a DNS filter. The filter intercepts the call to apple and allows you to inject your own questions, responses and data. If you are interested in learning more, this summary can guide you through the process of setting up and actually communicating with SAP from Siri.

Click here for a short demo video on youtube. read more