Skip to Content
Author's profile photo Guy Soffer

Developing SAP iOS Apps – It’s Simpler Than You Think!

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?

Probably not!

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.

Screen Shot 2012-10-15 at 15.34.06.png

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.

Screen Shot 2012-10-15 at 15.25.01.png

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.

Screen Shot 2012-10-15 at 15.39.31.png

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:

  1. ‘Carriers’ view of type A-Z List from the collection named CarrierCollection.
  2. ‘Flights’ view of type List from the collection named CarrierFlights.
  3. ‘Flight Details’ view of type Details from the collection named FlightCollection.

Screen Shot 2012-10-15 at 16.07.52.png

Click Finish and select the location where you want to generate your application.

Hurray!

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.

3Screen Shot 2012-10-15 at 16.27.22.png 2Screen Shot 2012-10-15 at 16.27.46.png 1Screen Shot 2012-10-15 at 16.27.54.png

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.

Assigned Tags

      53 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Michal Keidar
      Michal Keidar

      AMAZING!

      Author's profile photo Uri Nizan
      Uri Nizan

      Thanks.

      Very informative and helpful. 🙂

      Author's profile photo Paola Laufer
      Paola Laufer

      Very helpful.

      It makes it sound so easy! 🙂

      Author's profile photo Shimon Tal
      Shimon Tal

      Great Post!

      Author's profile photo Former Member
      Former Member

      wow!

      Author's profile photo Former Member
      Former Member

      Thanks for sharing,this looks very good for the beginners to get an idea.

      so what is the SUP part if we can develop apps with Netweaver-Gateway

      Thanks

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi Kiran,

      The generated code is ready to work with SUP Server as a middleware. You need to add the iOS libraries that comes with SUP Server to your project and uncomment some lines of code that handle SUP Server connectivity.

      More information is available in the documentation under 'Configuring a Starter Kit Application to Work with SUP' section.

      More on that in future blog posts 😉

      Author's profile photo Former Member
      Former Member

      Thank you Guy.

      Author's profile photo Former Member
      Former Member

      But it does work without SUP right?

      Also, how secure is the communication with the OData end point in this approach?

      Does it use SSL?

      Can it use SSL ?

      Thanks

      pj

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Yes. It works with or without SUP. It's your decision.

      If you want to communicate with Gateway through SSL and the service is already available in HTTPS, just change the URL in your app and make sure the device has the certificate needed (it won't work on the simulator). You would need to open Safari with the service HTTPS URL and accept the certificate. There are other options of SSL certificate provisioning for administrators.

      You can also use X.509 authentication but this will require you to implement that. With SUP, you can get that for free.

      Thanks,

      Guy

      Author's profile photo John Moy
      John Moy

      Excellent post Guy.  Thanks for taking the time to document this.

      Regards

      John

      Author's profile photo Former Member
      Former Member

      Great post!

      Author's profile photo Former Member
      Former Member

      Really makes everything more clear.

      Thanks Guy!

      Author's profile photo Manjunath Babu Rayampalli
      Manjunath Babu Rayampalli

      Great Post....i m trying similar kind of try in 2.2 sup. i am able to consume

      SAP NetWeaver Gateway Services internally(getting servicedoc,metadata,CRUD operations).But., what exactly  SAP NetWeaver Gateway tool for Xcode installer differs from which we use internally?

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi,

      Here are some major differences:

      • Same generated code (for proxy and starter-kit) is ready to work with direct Gateway call or via SUP.
      • The tool generates semantic proxy that represents the service. You get typed classes for all business entities exposed by the service including generated methods for all available service operations. This allows you to get data from service with 3 lines of code.
      • Most of the security and connectivity tasks are already handled for you.
      • No need to parse service document, metadata or service data response from service.
      • You get a nice design time experience for discovering available services.
      • You can generate full blown list-details universal application that is highly extensible.
      • You can generate full blown application for any Workflow service with rich UI.
      Author's profile photo Former Member
      Former Member

      Hello Guy,

      Thanks for the post!!!. I'm a SAP/Netweaver and IOS Developer, but i was doing my apps with Xcode x Websrvice on SAP side. I want to learn to use the gateway tool to create my apps. Can you guide me on how to develop a full process? From creating something on Gateway with SAP and exposing, and cosuming with the gateway developer tool?

      Documents and wikis are welcome.

      Thanks a lot!

      Joe

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi Joe,

      Regarding creation of services on Gateway the following documentation can help you:

      For iOS consumption of these services, the tool's documentation should be a good starting point along with the inline comments in our generated code.

      It would be also useful to read about OData here.

      Let me know if you have further questions and I'll be glad to help you.

      Thanks,

      Guy

      Author's profile photo David Clavey
      David Clavey

      Great post, keep it up 🙂

      Author's profile photo Former Member
      Former Member

      Really cool post!

      Author's profile photo Former Member
      Former Member

      Very Good Intro to Newbies of Mobile Apps for SAP Data

      Author's profile photo Carlos Dias
      Carlos Dias

      Great post and great work. Mobility is the future 🙂

      Author's profile photo Nilesh Chauchan
      Nilesh Chauchan

      Great.... Keep going

      Author's profile photo Former Member
      Former Member

      This is BIG News

      Author's profile photo Bruno Esperança
      Bruno Esperança

      Why is there no love for android when it's open source and the most available platform on the market? I don't understand...

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author
      Author's profile photo Trond Stroemme
      Trond Stroemme

      I kind of like my Windows phone, and am wondering when SAP will stop focusing on one (or two) specific ecosystems (or brands) and look towards hybrid solutions...

      Author's profile photo Davidson Matos Izefler
      Davidson Matos Izefler

      It's superb for us looking for working on with SAP Gateway. Thanks so much!!

      Author's profile photo Vikas Singh
      Vikas Singh

      Thanks for writing this . It's ridiculously simple to use 🙂 .

      Just one thing I noticed - I was able to build it for both phone and it's simulator. It also works on ipad but get this message for ipad simulator.

      2012-11-14 11:55:05.021 myflightapp[7331:1ad03] ERROR: Exception during parsing Service Document or Metadata: Not a service document File: BaseServiceObject.m Function: -[BaseServiceObject initWithServiceDocument:andMedatadata:] Line: 60

      2012-11-14 11:55:05.022 myflightapp[7331:1ad03] Service metadata is invalid. Please contact your administrator.

      I'll try to debug but wondering it you have noticed this.

      Thanks again.

      -Vikas

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi Vikas,

      So it works on iPhone but not on iPad simulator? Did you use the same service I mentioned in my post? Please check the logs for any additional warnings/errors and let me know.

       

      Thanks,

      Guy

      Author's profile photo Martin Knechtel
      Martin Knechtel

      Awesome!

      Author's profile photo Former Member
      Former Member

      This is impressive!

      Is it possible to connect to a netweaver gateway over vpn?

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Thanks Florian!

      Once you're connected via VPN, you get secure connection to the corporate network so it's certainly possible to connect to Gateway with it. If you want to be able to access Gateway anytime/anywhere (3G/4G cellular data connection), you would need SUP as part of the system landscape.

      Thanks,

      Guy

      Author's profile photo Former Member
      Former Member

      Thanks for your fast answer and keep up the great work! 😉

      Author's profile photo Former Member
      Former Member

      Thanks Guy, very informative post.

      Author's profile photo Former Member
      Former Member

      Hi Guy,

        Thanks for this article, it really is simple to integrate with GW using this library.  The problem I am having however is to build for an IPhone 5 device (works fine on the simulator).  The lib does not seem to have been built for that device version.  Is there anyway to get a version which works on IPhone 5 ?

      Thanks,

      Christian

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi Christian,

      You are right. This is an issue with the SDM libraries. Can you try the following and let me know if it works?

      Open the 'Build Settings' tab of your project and under 'Valid Architectures' remove the 'arm7s' value. Rebuild the project and test again on the device.

      Thanks,

      Guy

      Author's profile photo Former Member
      Former Member

      That worked !

      Thks,

      Christian

      Author's profile photo Syambabu Allu
      Syambabu Allu

      Hi Guy,

      Nice Blog and informative.

      Thanks,

      Syam

      Author's profile photo Carlos Roggan
      Carlos Roggan

      Just GREAT 😉

      Author's profile photo Former Member
      Former Member

      It just works, as advertised 🙂

      Author's profile photo Former Member
      Former Member

      Thank you for this great post.

      Please don´t ask why but our CIO decided to purchse Windows 8 devices instead of Ipads. Is there a tool available for Windows 8 app development which is compareable to:

      SAP NetWeaver Gateway developer tool for Xcode

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi,

      Unfortunately there is no similar tool currently available for Windows 8. However, since OData is based on Microsoft technologies, generating a proxy and consuming data from a Gateway service should be straightforward.

      If you're interested in consuming services from JavaScript, take a look at:

      Author's profile photo Former Member
      Former Member

      Hello Guy,

      First of all thanks for wonderful blog. I have recently been trying out various SAP mobility applications. I have downloaded and installed/configured ( I guess ) SAP Netweaver gateway "SAP NetWeaver ABAP Trial 7.02 SP11 Win 64 bit Version with Gateway 2.0 SP04 " as mentioned in the below mentioned in this blog.

      http://scn.sap.com/community/netweaver-gateway/blog/2012/05/16/now-available-sap-netweaver-abap-trial-702-sp11-win-64-bit-version-with-sap-netweaver-gateway-20-sp3

      I have installed this system on windows 7 which is a virtual machine running in VM Fusion on a mac system.

      After reading your this blog, I tried to create and test the same application but obviously instead of using SAP Netweaver Gateway demo system, I used SAP Netweaver Gateway Trial version which I have mentioned above. So following the steps which you have mentioned, I was able to explore the services of SAP Netweaver Gateway system and was able to create the application but when I tried to run the application, I got the following error in IOS simulator:

      "ERROR: Exception during parsing response data. Error: The document is not a valid data document".

      So to investigate the matter, I tried the hyperlink "http://host(hidden ip for obvious reason):8000/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/?$format=xml"

      and I was able to see the xml document in the browser. However when I tried the hyperlink http://192.168.1.116:8000/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/BookingCollection

      It displayed me error '

      /IWFND/CM_MGW/001 which says 'The RFC call was not successful because of communication failure, Error sending RFC logon data'.

      Also, I tried to test the service using transaction /IWFND/GW_CLIENT for the same service with HTTP 'get' method and it came back with status code '500' and text 'internal server error' and same error 'The RFC call was not successful because of communication failure, Error sending RFC logon data'.

      I have read a lot of configuration/set up guides for SAP Netweaver gateway and they all suggest to create an RFC connection to SAP back end system/SAP business system' but in my case there is no 'SAP back end system' as gateway is installed in SAP system itself. Could you please let me know what I am missing?

      Thanks,

      Arpit

      Author's profile photo Former Member
      Former Member

      I am not able to connect to the demo gateway using the developer tool for xcode.  I am using the above mentioned

      host: gw.esworkplace.sap.com

      port: 80

      I am able to logon to the webgui https://sapes1.sapdevcenter.com/webgui using the uid/pwd provided by sap when I registered for demo gateway.

      Is my above configurations correct?

      Do I need to use a different uid/pwd to see the services available in the gateway through the developer tool for xcode?

      Author's profile photo Former Member
      Former Member

      hi,

      nice explanation it's useful use.

      would you provide more examples it better way to understand

      all thing develop ios  using sap functionality............  

      Author's profile photo Former Member
      Former Member

      The explanation it very good and useful but it seems that Demo System you where using here is not working anymore...

      Can you tell us if there is another demo system that we can use?

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi Mikhail,

      Can you try the following link to get a demo system?

      http://scn.sap.com/community/developer-center/netweaver-gateway

      Author's profile photo Former Member
      Former Member

      Hi Guy,

      I tried to connect with the below details and I received a message : Could not connect to the server. I understood that the connection details are free for test. What can I do ?

      host: gw.esworkplace.sap.com

      user: GW@ESW

      pass: ESW4GW

      Thank you,

      Razvan

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi,

      I hope things will work for you after our chat today.

      Author's profile photo Former Member
      Former Member

      Hello everyone,

      sorry for resuming this ancient topic but i'm trying to find the Netweaver gateway tool plugin for Xcode without success.
      Is there any chance that it has been replaced with Netweaver Gateway Productivity Accelerator or they are two separate things?

      Thanks in advance

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi Daniele,

      You are right. The tool has been replaced with GWPA for Eclipse.

      Thanks,

      Guy

      Author's profile photo Former Member
      Former Member

      i cannot find the download link of SAP NetWeaver Gateway tool for Xcode  ,, can any one provide me with this link ?

      Author's profile photo Guy Soffer
      Guy Soffer
      Blog Post Author

      Hi Nourhan,

      The tool is no longer available. You can use SAP Web IDE to develop SAPUI5 mobile app (HTML5) and package it as a native app.