Are you an Apple fan like me?
Don’t you feel that the simplicity and design of the iPhone and its iOS make you want to hold and use it whenever you can?
Do you feel the same when you need to access business data through the legacy system on your desktop?
In this post I’ll show you how easy it is to develop your own iOS app to access SAP business data from your iPhone. The business data is exposed by SAP NetWeaver Gateway from standard SAP Business Suite systems (ERP, CRM etc.) via open protocols.
The first thing you must do is download and install the SAP NetWeaver Gateway tool for Xcode (this will only work on a MacOS 10.6.8+ with Xcode 4.2+ installed). The tool allows you to discover available Gateway services and generate the UI and Objective-C code that consumes them.
Before start using the tool, you need to make some configurations. Launch the tool from your Applications folder and, when the first pop-up window appears, click Application. Go to Preferences under the SAP NetWeaver Gateway developer tool for Xcode menu of the tool and configure the following:
- SAP OData Mobile Client SDK Path: Download the SDK and extract it to a location on your file system. Browse for the SDK folder in the Preferences window.
- Gateway Connection Details: Click the + button and enter the relevant Gateway details. For this post, the Gateway demo system will be used.
Click OK to save the changes and go back to the tool to start creating your awesome application. The application you are going to create will consume data from the flight sample service that comes with Gateway out-of-the-box.
First, enter a name for your application in the Application Name field and choose the List/Details (Universal) application type. You will create a simple application that shows a list of carriers, their flights, and details of each flight.
Click Browse to open the service catalog and select the service RMTSAMPLEFLIGHT_2. You can explore the details of the service on the lower pane which displays the service metadata in a user-friendly manner. Click OK and then Next to start constructing your application.
This window allows you to design the application views. For each view, you can set the following:
- The view type.
- The collection from which data is retrieved.
- The list of properties to be displayed.
For this application you will create 3 views as follows:
- ‘Carriers’ view of type A-Z List from the collection named CarrierCollection.
- 'Flights' view of type List from the collection named CarrierFlights.
- 'Flight Details' view of type Details from the collection named FlightCollection.
Click Finish and select the location where you want to generate your application.
You have just created a full-blown business iOS application without writing a single line of code. Just open the project file in Xcode and run the application.
On the application’s login screen, enter the same user name and password you used earlier. After a successful login, you should be able to navigate through the application’s views and see real data.
And that’s not all! The application you have just created is actually a universal iOS application. This means it will also work on an iPad, where you can take advantage of the bigger screen while keeping the same concept. More on this in following blog posts, so stay tuned!
If you're familiar with iOS development, you will feel at home when looking at the generated code. The generated code is well-documented and easy to understand and can be extended based on your needs. Refer to the tool's documentation for more information.
So if you are amazed by how fast and easy this process was, I can only borrow Steve Jobs’ words and say: “It Just Works. Seamlessly!”
Feel free to share your feedback in the Comments section.
For #SAPGateway blogs and updates please follow @shirilevil Twitter account.