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.
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.
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.
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.
AMAZING!
Thanks.
Very informative and helpful. 🙂
Very helpful.
It makes it sound so easy! 🙂
Great Post!
wow!
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
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 😉
Thank you Guy.
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
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
Excellent post Guy. Thanks for taking the time to document this.
Regards
John
Great post!
Really makes everything more clear.
Thanks Guy!
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?
Hi,
Here are some major differences:
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
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
Great post, keep it up 🙂
Really cool post!
Very Good Intro to Newbies of Mobile Apps for SAP Data
Great post and great work. Mobility is the future 🙂
Great.... Keep going
This is BIG News
Why is there no love for android when it's open source and the most available platform on the market? I don't understand...
What about this:
http://scn.sap.com/community/netweaver-gateway/blog/2012/07/18/developing-an-android-app-consuming-data-from-sap-is-just-a-few-clicks-away
🙂
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...
It's superb for us looking for working on with SAP Gateway. Thanks so much!!
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
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
Awesome!
This is impressive!
Is it possible to connect to a netweaver gateway over vpn?
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
Thanks for your fast answer and keep up the great work! 😉
Thanks Guy, very informative post.
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
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
That worked !
Thks,
Christian
Hi Guy,
Nice Blog and informative.
Thanks,
Syam
Just GREAT 😉
It just works, as advertised 🙂
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
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:
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
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?
hi,
nice explanation it's useful use.
would you provide more examples it better way to understand
all thing develop ios using sap functionality............
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?
Hi Mikhail,
Can you try the following link to get a demo system?
http://scn.sap.com/community/developer-center/netweaver-gateway
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
Hi,
I hope things will work for you after our chat today.
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
Hi Daniele,
You are right. The tool has been replaced with GWPA for Eclipse.
Thanks,
Guy
i cannot find the download link of SAP NetWeaver Gateway tool for Xcode ,, can any one provide me with this link ?
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.