Skip to Content

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.

To report this post you need to login first.

53 Comments

You must be Logged on to comment or reply to a post.

    1. Guy Soffer 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 😉

      (0) 
        1. Guy Soffer 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

          (0) 
    1. Guy Soffer 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.
      (0) 
      1. SAP Lover

        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

        (0) 
        1. Guy Soffer 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

          (0) 
  1. 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…

    (0) 
  2. 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

    (0) 
    1. Guy Soffer 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

      (0) 
    1. Guy Soffer 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

      (0) 
  3. Christian Larose

    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

    (0) 
    1. Guy Soffer 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

      (0) 
  4. Manfred Feger

    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

    (0) 
  5. Arpit Oberoi

    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

    (0) 
  6. Arvind Mukhi

    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?

    (0) 
  7. Anand tellabati

    hi,

    nice explanation it’s useful use.

    would you provide more examples it better way to understand

    all thing develop ios  using sap functionality…………  

    (0) 
  8. Mikhail Dinul

    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?

    (0) 
  9. Razvan Dogaru

    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

    (0) 
  10. Daniele Torlai

    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

    (0) 

Leave a Reply