Posts Categorized: Configuration

compare-icon

Syscompare – a tool for comparing repos across HANA instances

compare-icon.png

A couple of weeks ago I was moving code from 1 hana instance to another trying to keep them in sync. However, I thought there might be a better alternative for comparing the contents of the repos across my systems to ensure that the files matched. After doing some digging and not finding a solution, I decided to write a small tool to do just this, called Syscompare. It is a open source HANA app which uses the new File API and compares the files on each system and displays the differences.

You can read more about the application here, and find the files for the HANA app in Github.

 

Features:

- Compare repos across HANA instances

- Display file differences in the application

- Highlights missing files on each instance

Usage:

- Setup the 2 XSHttpDest files

- Specify the source and target systems (using the xshttpdest file names)

- Specify the repo to compare

Once the processing is complete the app will show a summary of differences:

Screen Shot 2015-06-16 at 10.18.20 PM.png

Screen Shot 2015-06-16 at 10.20.12 PM.png

Screen Shot 2015-06-16 at 10.20.51 PM.png

You can checkout the Github/Source code here: paschmann/Syscompare · GitHub

If you prefer to download the Delivery Unit – please click here and provide your email address (this way I can keep you up to date with changes): metric² | Real-time operational intelligence for SAP HANA

Interested in contributing to the project? Please feel free to fork or submit a pull request.


pastedImage_0

Hacking SAP HANA Web Sockets

Disclaimer: This is not a production or documented feature – its also more of a hijack than a hack 

 

I have been hoping for the inclusion of Websocket support on the HANA DB platform for a while now, and I was a little disappointed it was not packaged in the SPS08 release. My goal when building apps (or products) is to make use of the core platform its running on as much as possible, I firmly believe that when convincing an IT department, or company, to implement a product or app, the first question is: “How much infrastructure does this need?”. This can often be a deal breaker and why I am such a big proponent of the HANA’s DB + XS App Server integration – it consolidates the requirements into a single investment. Having a Websocket technology built directly in XS can be an additional selling point which developers are starting to expect these days.

A little while ago I wrote a blog post on building a dashboard using the awesome Node.js package from Holger Koser, however I have really been wanting to use Websockets in the metric² platform since the get go. Some comments here and here are prime examples of my long lasting hope of seeing the technology being included in the XS Engine platform sooner rather than later. I recently had a little nudge again from John Patterson to dig back into the topic and did manage to hack something together. The most interesting part of this was that once I had it working, I was left wanting just a little more …

Firstly a little bit about Websockets and why I feel they important to the app/web development world …

Real-time: In the age of having blazingly fast DB’s, we need a UI & server side (In our case XSJS files) integration layer which can display the data to user with as little over head as possible. Web Sockets supports this by providing a low-latency, near real-time connection between a client and the server.

Light Weight: Currently we need to do multiple AJAX calls to our backend server (to the XSJS files) to either perform some complex logic or DML against our database. This is slow and also fairly network intensive as each request (and response) requires additional handshakes and the packet size is considerably larger than just the intended content inside the package. In Web sockets, the requests and responses are really just the content themselves.

Duplexity: Web Sockets by nature are Full-duplex, implying that we can send and receive data at the same time for multiple requests.

Persistence: Web sockets provide a “open” connection between the server and client after the initial upgraded HTTP request handshake has been made. This lets us perform multiple server side requests using the same connection. This also lets the server initiate a response without needing a request from the client side.

The importance of these 4 factors to the web development world and to HANA XS specifically is that this is the missing link for us to take Web applications to the next level.

[Cross-domain support is another great feature!] In this example I was able to successfully have the HTML + JS file local to my PC and execute it against my HANA XSWS service (via a public URL).

– 07/25/2014 — Chris Paine made a good point on potential Cross-domain security issues (see below). Keep in mind that these files are secured just like any of the XS content files, e.g. as long as your folder has a authentication requirement it will persist to this XSWS file as well.

So onto the more interesting HANA specific parts …

 

I initially realized that HANA XS was using Web Sockets in SPS06, when for some reason the XS Engine debugger was not loading correctly due to my user missing some permissions. After searching through the XS code I came across the folder where the debugger was saved and it included a interesting file with the suffix of xsws i.e. XSWebService. After doing more digging I found that Websockets were being loaded in the WebDispatcher config file and I was confident I could find a way to start using it for app development.

After spending some time trying to create my own HANA package with these file extension types I realized that the name is somehow being filtered and only this file, and more specifically, in this location can be executed, otherwise the XS Engine passes back a 403 (forbidden) – I was a little disappointed but it didn’t discourage me … and I decided I would simply re-purpose my Debugger.xsws file for my own needs After a quick backup, I was ready to do some coding …

Essentially, a xsws file is just like any xsjs file, with the exception that it has some socket code returning the responses versus your regular xsjs file. You can do things like $.import for additional libraries as well as perform $.sql functions. Here is a small snippet from the code over on Github.

Debugger.xsws

  1. $.ws.onmessage = function (evt){
  2.     handleIncomingRequest(evt);
  3. }
  4. $.ws.onerror = function (evt) {
  5.     $.trace.debug(“error on connection: “ + evt.message);
  6.     throw new Error(evt.message);
  7. }
  8. $.ws.onclose = function (evt) {
  9.     $.trace.debug(“connection closed, disabling debugger”);
  10.     debugObject.enabled = false;
  11.     throw new Error(“Close status “ + evt.code + “:” + evt.reason);
  12. }

 

 

And this is some of our Client side code making calls the xsws service:

App.js

  1. // Create a new WebSocket. This works fine
  2.   var socket = new WebSocket(‘ws://<ENTER YOUR HANA SERVER HERE>/sap/hana/xs/debugger/api/Debugger.xsws’‘xsCrossfire’);
  3.   // Handle any errors that occur.
  4.   socket.onerror = function(error) {
  5.     console.log(‘WebSocket Error: ‘ + error);
  6.   };
  7. // Send the message through the WebSocket.
  8. socket.send(message);

As you can see – the code and requests are very simple and straight forward, in fact to me they are a little easier than jQuery + AJAX.

One caveat I did find was connection persistence in the event you have an error on the server side, the socket connection can break, in this case you would need a error handling state that attempted a reconnect before submitting any new requests.

A quick screenshot of the running test app i developed and how the server is sending persistence frames pings/pongs to validate the open connection along with the client request and server response.

If you are interested in trying this out on your test or dev instance I have posted the code on Github. Follow these simple instructions to get up and running …

1.) Using the Web IDE, open SAP -> HANA -> XS -> Debugger

2.) Make a backup of the Debugger.xsws file or simply comment out the contents.

3.) Paste the code into the file from Github

4.) Create the Websocket.html file and paste the contents of the Github file

4.) Create the app.js file and paste the contents of the Github file

5.) Open the Websocket.html file and enter any SQL statement

(Be sure you have the debugger security role)

As you can see from the files, the required methods for web sockets are really at a minimum and barely get in your way at all.

Conclusion

At the start of the article I mentioned I was left wanting a little more … this was mainly because since I have been wanting Web Sockets for such a long time, I realized that using it , alone its not really enough. In order for us to really take XS Engine to the next level, we also need to consider a “Publish/Subscribe” feature and a server side timer feature.

The Pub-Sub approach would essentially allow us to push data from the server side, on a specific occurrence of an event, much like a DB trigger. If a new row gets inserted, push the new inserted record to the registered subscriber.

The server side timer feature would allow us to create a server side timer (similar to a xsjob) which would persist and execute the server side function every x secs/mins/hours.

Overall I am pretty impressed with the opportunities Web sockets will bring to the XS Engine. I am hoping they will be included in the next release.


Mockup

SAP UI5 – A Photoshop template of GUI elements

Mockup.png

For me (and I am sure many others!), UI5 has become a really useful toolkit for easily developing web apps and POC’s with little effort around the SAP Ecosystem. The OData support, rich controls and business inspired examples lend itself well to the mantra of “Don’t reinvent the wheel”. At a recent SAP Inside Track event in NY, I made reference to the fact, that while developing a mobile app, I, or a graphic designer, can spend close to 40% of the total design & development phase/hours on the UI. Building “consumer grade” enterprise apps is a different way of thinking for app developers. I am sure many of you, like me, started out with a redefined canvas of boring, grey .NET controls or a “Enjoy” SAP CXTAB_CONTROL. But times are changing and we should all look to the creative and vibrant consumer world of both web and mobile apps to reconsider our methods and processes for developing great apps.

When I started working with the UI5 toolkit, I would more often than not, start coding right away, without going through my traditional methods, and ultimately ended up in a frustrating muddled mess. Why wouldn’t you start coding immediately …. everything you need is right there? Wrong, planning is everything when it comes to design. Properly designing a app which is going to judged, by today’s standards, is not an option – but a requirement. I am not saying every application in your organization needs a UI Designer, but planning should start with sketches, process flows, and subsequently lead to the UI design and  development. When you have a toolkit which has some great looking components, its easy to skip this phase and get cracking. Don’t do it. Since I have spent a lot of time developing both web, mobile and traditional apps for the enterprise, my approach and system development life cycle (SDLC) resembles more of a artistic approach and design definition, than a “traditional” enterprise app. Yours can be entirely different, but the point is that I would like to encourage you to consider that a *great* design should be a part of your project goals.

The Reason

That’s the reason I developed the PSD file of UI5 elements. To make that design planning process quicker, easier and to encourage all of us collectively to make great designs and awesome apps.   Screen Shot 2013-07-09 at 9.19.16 PM.png

The Process

I used the online test suite and replicated the majority of the objects using shapes in Photoshop. Each object has groups/folders categorizing and defining it, both for extensibility and this makes finding a component/object easier. Some objects are not included: Icons and some of the VIZ Charts are not individual objects. Maybe in the near future if I can get some form of ‘OK’ from SAP for not copying/redistributing their font I will consider it (hint?).

Screen Shot 2013-07-09 at 9.15.29 PM.png  Screen Shot 2013-07-09 at 9.20.44 PM.png

The UI Toolkit

95% of graphic designers will spend time working with a UX/UI in Photoshop prior to coding and this toolkit makes creating those mockups considerably easier. Each object is defined as a shape and can be moved, and styled as needed. Currently the file has 897 individual layers which makes up the +- 8.2 million pixels of UI goodness . Building a new UI mockup should not take long … create a new file, duplicate the objects you need and get creative. (Please also consider the fact someone is going to need to code this and that your imagination, should be limited by *their* capabilities!)

Whats next …

I am hoping someone else interested in the UI/UX aspect will be able to contribute to the project and consider extending this file and its objects to cover all the aspects. I also hope that SAP will consider releasing its “Master” file to the community as ultimately it will encourage better adoption and use of the product.

My challenge to you ….

Does you/your company/partner have a UI/UX designer? Do you think its important to design a UI before coding? Do *you* have any great UI/Designs you would like to share? Post a link in the comments, or better yet, create a post here: https://experience.sap.com/ (SAP Why is experience.sap.com not directly integrated/on SCN??? )

You can download the file here:http://www.li-labs.com/downloads/sap%20ui5%20gui.psd

Don’t have Photoshop? Here are a couple of the elements split up and are available in PNG format: http://www.li-labs.com/sap%20ui5%20png.zip


Image2

A peek inside xSync and the HANA XS Engine

icon_128x128.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.

Image2.png

The diagram above displays the HTTP call made when saving/creating a file, and how the IDE initially does a HEAD request for the XSRF token, followed by the HTTP PUT.

The initial HEAD request is to fetch the CSRF Token, secondly the token along with the parameter of mode, path and activate are passed to the URL. Pending you are successful, a JSON message is returned with the status. For those of you are not familiar with Cross-Site-Request-Forgery, you can read about it here: http://en.wikipedia.org/wiki/Cross-site_request_forgery

Once I had this done, I was wondering what the best integration option would be and weighed up a couple options of a simple check in type procedure, but wanted something faster, easier and “click free”. Being a bit of a highly iterative developer myself, I find it easier to develop “online”, which is why I decided it would be best to do a File System watch of a particular folder and save any changes automatically to my HANA instance. Similar to a dropbox type approach.

I had my POC working nicely, a integration goal defined and set out to start developing the UI/Application in Objective-C (Xcode). I had a template type of app from one of my little SAP Note Viewer applications which could act as a foundation. I threw some code out and pulled some very useful little open source packages in as helpers. Within a couple hours in my evenings each night the app was running nicely and doing what I had expected, modify a file or two in a predefined location and sync up to XS. easy.

Thats generally where development grinds to halt for me, as I envision feature after feature to build a Mac clone of HANA Studio Luckily my senses got the better of me, and I worked on doing a recursive package downloader, the ability to create, rename and delete files and folders and not a HANA Studio rewrite Once this was all done, ironing out the bugs was painful. The cocoa FSEvents stream (File System Events) Class on the mac is not easy to work with and a bear at best. Having to monitor a folder for any modifications, deletes and creates turned into a bit of a logic nightmare. One of the interesting challenges is that if you “delete” a file on the mac file system, it does not get a “delete” FS Event but rather a rename! (Since it goes to the trash/recycle bin!). This leads to having to do multiple … if exists then …. type statements around each file and folder event

UI is another interesting one, I like apps to look somewhat decent … and I spent a good amount of time working on each of the elements in Adobe Photoshop as usual … (Whenever I do a mobile app development talk I mention that I spend close to 40% of entire project time in apps like Photoshop with design work! Most are surprised!)

If you are interested in incorporating some these types of features into your own app, I will be posting a copy of the integration classes on GitHub shortly.

PLEASE KEEP IN MIND: This is exploratory type work with undocumented API’s, I would not recommend using this in production, or any important production work (or your important opensap homework!). The reason I shared this was to encourage people to look under the hood and understand the how’s and why’s of how some of these great new tools work.

I would be interested to hear if anyone has any interesting use-cases for being able to manipulate both HANA repository and DB artifacts from outside of the Studio? Does anyone have any challenges with the HANA Studio today they would like to see changed?


Screen Shot 2014-04-23 at 4.57.06 PM

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.

2) Build another app with replicated functionality – duplicate code to display the customers and overview details in both apps.

3) Build 2 separate apps – But this would require the user to re-enter information (such as searching for and entering the Customer ID) in the 2nd app.

The fourth option is to use option 3 but with a twist, by enabling communication between the 2 apps by using URL Schemes. As the majority of iOS developers know, you can open other standard iOS apps like Safari, Mail or the Phone using the UIApplication SharedApplication class, what many developers and mobility architects overlook is that, not only standard apps can be called from your code, but any app which has a URL scheme defined. This gives you the ability to separate processes by application, and in the event a user would like drill deeper into additional information or functions, you can pass information to another app where that can be handled. What if the app is not installed? Good question … You device will smartly open the Apple App Store giving you the ability to install the missing app. Configuring and consuming the communication between 2 apps is very simple and straight forward.

http://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Art/app_open_url_2x.png

 

 

You can read about the URL Schemes within the apple documentation here:

http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html

and here: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW18

Within the SAP Suite of iOS Apps you can also find URL Schemes already configured and in use, some examples of these are:

CRM @ SAP

Find account by number: crmatsap://openAccount?accountid=<number>

Open opportunity by number: crmatsap://openOpportunity?opportunityid=<number>

Open account by number: crmatsap://openAccount?accountid=<number>

SAP Pricing

Open Product by ID: pricingapp://openProduct?productid=<productid>

If you are still not sure if iOS URL Schemes are right for you here are a couple of Pro’s and Con’s

Pros:

- Use other custom apps to augment yours

- Use other companies apps to augment yours

- No need to redevelop similar functionality

- Communicate between apps

- Launch your app from a hyperlink (online/in a web page?)

- No need to be online for base functionality

Cons:

- Shouldn’t pass sensitive data

- Clearly define the scope of each app and avoid over simplifying (e.g. an app for searching for customers by name, another for searching by ID.)

- Should not be a critical function, since there is no guarantee that the data is being received by the other application

I am curious to know how many app developers out there are using URL Schemes within their custom development?

 


Slide30

S2F: Developing an iPad app using SAP Netweaver Gateway – Part 2

 

In the Introduction and Part 1 of this 2 part blog series, we looked at the platform and prerequisites needed to develop an iPad using Netweaver Gateway as your data provider. In this part, we will step through the app itself and look at the System Development Life Cycle (SDLC), and some of the common points when dealing with each stage.

Slides
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. This guide has been particularly useful for me: http://scn.sap.com/docs/DOC-5010
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.

Why did you use a native app versus HTML5? This is another blog post all together, but essentially my argument is it depends on the job at hand and what is trying to be accomplished. A bit like a decision of when do you add a web page to your portal versus developing windows form app, there is no simple or straight – once size fits all answer. Both have their place.

So that’s an overview of the presentation and content, I know this may have been slightly drawn out, but for those who would have liked to attend, this is a close second 


Screen+Shot+2012-07-20+at+5.12.03+PM

Connecting SAP Netweaver Gateway Trial to ES Workplace ERP

After following John Moy’s blog series on setting up the Netweaver Gateway trial on Amazon EC2, I thought it would be helpful to share how to connect your shiny new gateway trial to the ES Workplace ERP. Since using the ES Workplace systems a couple years ago for a CRM Mobile app, I have always praised the ES team for putting together a great set of resources for encouraging and enabling a service oriented architecture (SOA). The systems (ECC, CRM and PI) are great for doing testing against and developing POC’s or demo apps. In this case we will be using the ERP instance to connect our Gateway system for data consumption.

In this example we will be initially connecting our systems together and then going through setting up a very basic example of consuming data from the ES Workplace ERP system via the Netweaver Gateway system sitting in the AWS cloud.

Please note that the Prepackaged Netweaver Gateway Trials already have this configured and ready for your username/password.

In order to connect and consume data from the ES Workplace ERP system, you will need an account. You can create one here and it only takes a couple of minutes: http://www.sdn.sap.com/irj/sdn/soareg
Once you have created your account, I suggest logging in and changing the initial password you received through registration. Its also just a good idea to check you are able to gain access to avoid any issues down the road.
Next up head over to your Netweaver Gateway Trial system and open up SPRO

-> SAP Netweaver

-> Gateway

-> OData Channel

-> Configuration

-> Connection Settings

->SAP Netweaver Gateway to SAP System

-> Manage RFC Destinations

Screen Shot 2012-07-20 at 4.47.32 PM.png
Click on ABAP Connections and select the “New” icon. Screen Shot 2012-07-20 at 8.08.35 PM.png
Name your RFC Destination and make sure that Connection Type is configured to be 3 – ABAP Connection.

Under Technical Settings enter the following values:

Target Host: iwdfvm3989

System Number: 00

Save As: IP Address

Gateway Host: /H/155.56.56.170/S/3299/W/e$workp1ace/H/iwdfvm3989.dmzwdf.sap.corp

Gateway Service: 3300

Screen Shot 2012-07-20 at 5.11.42 PM.png
next click the “Logon & Security” Tab and enter your ES Gateway Credentials and save the connection. Screen Shot 2012-07-20 at 5.11.52 PM.png
After saving, select “Manage SAP System Aliases” and enter the details which will create a system alias for the ES Workplace ERP system. Screen Shot 2012-07-20 at 8.29.31 PM.png
SAP System Alias: Any name e.g. ESW

RFC Connection: Should be the name of your RFC connection you specified above

Software Version: Default

Screen Shot 2012-07-20 at 8.31.19 PM.png
Click the connection test button and you should receive a screen looking like this. Screen Shot 2012-07-20 at 5.12.03 PM.png
Once this is done, we are ready to create our webservice.

For our consumption example we will be pulling out a simple list of all users. If you would like to see a complete and detailed guide of CRUD (Create, Read, Update and Delete) operations – I would suggest checking out this document: https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30aee2cc-c474-2e10-ac93-d163ee3b9576

Open up SE80 and create your Gateway Data Model. Screen Shot 2012-07-20 at 8.25.27 PM.png
Be sure to specify your System Alias when creating the Model. Screen Shot 2012-07-20 at 8.40.47 PM.png
Per the documentation, search for a BAPI you would like to use. Because we defined the System Alias in the previous step, the BAPIs being displayed are coming from the target system, in this case the ES Workplace machine. Screen Shot 2012-07-20 at 8.51.23 PM.png
Continue through the process by mapping the query operation.Also be sure to set a primary key by highlighting your unique property and clicking the “Key” button. Once done, click “generate”. Screen Shot 2012-07-20 at 9.01.33 PM.png
Next up we will create a consumption model for our data model. Open up SE80 again and attach the gateway data model to consumption model. Screen Shot 2012-07-20 at 9.39.01 PM.png
Now we should be done, you can open up the browser and point to your URL listed in SE80 under the consumption model to see the definition and available collections. Screen Shot 2012-07-20 at 9.40.35 PM.png

This is directly on the AWS machine, but I can also call this from my local machine:

Troubleshooting:

In the event you try to view a collection and receive the error: No System Alias found for Service, open up SPRO and assign a System Alias to the Service.

Screen Shot 2012-07-20 at 9.32.23 PM.png
Here you can see where the ESWORKPLACE alias has been defined. Screen Shot 2012-07-20 at 9.35.36 PM.png
Having additional problems?

Check that the service has been defined in SICF

Screen Shot 2012-07-20 at 9.37.49 PM.png
If you queries are taking a long time to load or your dataset is large, don’t forget to limit it/add parameters to restrict the returned records. This can be done when defining the data model. Screen Shot 2012-07-20 at 9.46.04 PM.png
If your service will display locally on AWS but not from another machine, check that the AWS Security Rules include the port gateway is running on (in my case 8000).
If you try to view the detail of the  you will get an error, this is because I did not map the operation of GetDetail or Read – we only did the Query. Follow the guide to easily add this.

If you have a elastic IP associated with you EC2 instance you should be able to call the REST service from any machine connected to internet. (You could also use your public DNS name, its just not all the short!).

Here are a couple of useful TCodes for working with Gateway:

/IWFND/ERROR_LOG Gateway Error Log
/IWFND/APPS_LOG Gateway Application Log Viewer
/IWFND/MAINT_SERVICE Maintain Service