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

Simple Sample: Writing an entry to SAP Netweaver Gateway using JSON

Skill Level: Beginner

Time Needed: 20 minutes

I recently assisted someone on the forums when they were having trouble creating records in their SAP ECC instance while using Gateway. I thought I would share some very simple code showing what it takes to write an entry into a service via JSON from iOS (Objective C). The reason the title of the document is “Simple Sample” – there are no frills. Whenever I develop a new app, I start small, get the basic functionality working, and proof out the process before getting too creative.

*** If you do not have your own gateway server, you might be able to connect this to the SAP Gateway System which can be found hereCreate an account and utilize this service *** DISCLAIMER: Untested as the signup form does not work 🙁  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

SAP Netweaver Gateway T-Code Summary

Here is a list of useful SAP Netweaver Gateway TCodes, please add a comment for any I am missing and I will gladly update. The intent of this post is to summarize the relevant TCodes for posterity and to be used as a quick lookup.

Gateway Runtime

TitleT CodeDescriptionSP Required
Gateway Client/IWFND/GW_CLIENTSAP NetWeaver Gateway is a powerful tool that enhances the existing Error Log. Also allows you to simulate service execution. (Similar to tools like RESTClient for Firefox)SP04 +
Error Log/IWFND/ERROR_LOGThe Error Log for SAP NetWeaver Gateway hub systems is a helpful addition to the existing Application Log Viewerand provides detailed context information about errors that have occurred at runtime.
Application Log/IWFND/APPS_LOG (Gateway Hub System)Log and Trace Filesa specific viewer for application log entries created by SAP NetWeaver Gateway processes.
Application Log/IWBEP/VIEW_LOG (Business Suite Backend)Log and Trace Filesa specific viewer for application log entries created by SAP NetWeaver Gateway processes.
Application Log Cleanup/IWFND/CLEANUP_APPSLOGOver time the application log amasses a lot of entries, which periodically need to be cleared. As default the application log should only store one entry per request. In addition, there is no need to store these entries for more than a day or a few days. Application log cleanup is a standard requirement in productive systems and helps to improve the performance of the systems in your system landscape.
Clear Cache/IWFND/CACHE_CLEANUPCleanup Gateway Metadata Cache
Disable Cache/IWFND/MED_ACTIVATEDisable Gateway Metadata Cache
Gateway Node ActivationSICFIncludes various functions for monitoring, analysis, and troubleshooting in the ICF environment. You can also make use of the central Application Server analysis functions to identify issues such as performance problems in ICF applications.
Alert MonitoringRZ20SAP NetWeaver Gateway is monitored automatically within the Computing Center Management System (CCMS) in SAP CCMS Monitors for Optional Componentsfor Information Worker.In the monitoring process, information is collected about SAP NetWeaver Gateway. Here you can see which applications are in use, and how often they are called up. The information is updated hourly and relates to today’s date, since on the first collection after midnight all values are initialized once they have been read out.
Performance Trace/IWFND/TRACESThe Support Utilities offering for SAP NetWeaver Gateway has been extended to include a Performance Trace tool. This tool enables developers, administrators, support consultants, and end users to monitor system performance at service call level. You can trace the performance of both the SAP Business Suite backend system and the SAP NetWeaver Gateway hub system.

Gateway Design

TitleT CodeDescriptionSP Required
Gateway Service BuilderSEGWA completely new design-time transaction, which provides developers with an easy-to-use set of tools for creating services. It has been conceived for the code-based OData Channel and supports developers throughout the entire development life cycle of a service.SP04+
Model Composition for Integration/IWFND/BD_MGW_MDL_COMPOSITIONModel composition is provided for complex scenarios for the integration topics, such as SAP Business Warehouse, GenIL and SPI. It allows mashing up multiple services within IW-BEP.
Service Validation/IWFND/SRV_VALIDATESAP NetWeaver Gateway Service Validation Tool validates the runtime for all the SAP NetWeaver Gateway services to ensure that all the services work fine. Service Validation tool runs without user intervention and performs the runtime validation on a single service document.
Register/Test Backend SystemSM59Your backend system has to be registered as an SAP system alias in the SAP NetWeaver Gateway Implementation Guide (IMG) on your SAP NetWeaver Gateway system. In addition, an RFC destination has to be defined in transaction SM59.
Create a ServiceSE80Design time ABAP Workbench
Register a Service/IWFND/REG_SERVICE Replaced with SEGW
Maintain a Service/IWFND/MAINT_SERVICEReplaced with SEGW
Activate a Service/IWFND/IWF_ACTIVATEActivate or Deactivate a service
MOC/IWFND/MOC_PARALLELParallelize Multi-Origin Composition
WebGUI Workflow/IWFND/WF_WEBGUIWebGUI For Executing Workflow Item
Configure Message based Authentication/IWFND/WSS_SETUPConfigure Web Service Message-Based Authentication
GenIL Generator/IWGIL/GENIL_SRV_GEN Gateway Service Generator for GenIL

Communicating with other iOS apps using URL Schemes

When I started developing iOS apps a couple of years ago, I was concerned that enterprise apps were going to quickly succumb to the world of development scope creep. Since the apps were fairly focused and provided a single function or process solution, what if the business wanted more? For example, you have a CRM app displaying your customer contact information and some high level details regarding order history and credit limits, but what if the user wanted some additional details from your BI solution drilling down into historical orders and profit analysis? Well, in that case, you had a few options: 

1) Extend the scope of the app – by adding functionality and options, sometimes a reasonable option if the scope is not excessive or the functionality is relative to the app. In our  above example, probably not. 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

S2F – Building a custom iPad app using Netweaver Gateway

S2F is a blog series around building custom native iOS apps using SAP Netweaver Gateway, you can read Part 1and Part 2, as well as the introduction from talk at TechEd in Las Vegas.

Last Week Guy Stoffer, put together a great blog outlining how quick and easy it was to create an iOS app using the SAP Netweaver Gateway Tool for XCode. The tool creates proxy classes and even handles the security which makes creating a starter gateway app simple. In my previous post covering my talk at TechEd in LV, I mentioned I would show an alternative to using the Gateway Tool for XCode and this blog outlines this. read more

2012 SAP TechEd and MOB205

Well …. TechEd has passed and it was a great time. InnoJam was probably the best experience and I managed to be a part of a great collaboration which was fun from the start – I will blog a little about our solution in some of my free time in the coming weeks, but back to the topic at hand, since this was my first time as a speaker at TechEd I was slightly intimidated and anxious … my session was on Friday at 8:00AM, the night after the 3 Doors Down concert and I was skeptical if *anyone* would even show up 🙂 . The morning came, and to my surprise, the room was full and even had multiple people standing at the back. I was impressed so many people attended, and showed that my investment of time and resources into the enterprise mobility space over the last few years was worth the effort. The presentation went well and thankfully I had the “Demo Gods” on my side connecting from the Venetian (iPad) to Amazon Web Services (Gateway) to Walldorf (ES Workplace) and back 🙂 . After the presentation wrapped up I had great comments and questions from the audience but ran out of time answering all of them, I figured I would share the premise of the presentation here for everyone and hopefully encourage more companies to take a few easy steps to start their journey into the mobile enterprise. 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