This tutorial is based on the online help from Sybase infocenter which is quite good and informative. But I wanted to show you how to call a BAPI from your iPhone using SUP (Sybase Unwired Platform).
Prerequisites
Before starting, you need to have first the content of the Generated Code from your MBO (Windows side) and the folders includes and libs from the SUP folders. For the tutorial, I have copied all the content to my desktop : /Users/jberthe/Desktop/Sybase Unwired Platform
Furthermore, you will need those tools as well :
- Sybase Unwired Platform 1.5.3
- MacOS 10.6 (Snow Leopard), XCode 3.2.3 (it seams working on 3.2.4)
- iPhone SDK 4.0.x
Create an iPhone application
The goal of this section is to develop a simple iPhone application using the generated code provided by the Sybase Unwired Workspace. We will use the MBO created to call the SAP Backend to retrieve the flights list.
Configure the XCode Project
- Start XCode and click on Create a new Xcode project
- Save the project as : SUPSapAccess
At this point you have an empty project.
- Close the window and quit XCode application, then relaunch it. In that manner the SDK Base will be affected.
- When you re-open the SUPSapAccess project you should see you are in Simulator - 4.0
We are going to import the generated files
- in the Groups & Files view, right click on the project name
- Select Add and Existing Files...
- Select the folder Generated Code
- Then press Add button. Check the box for Copy items into destination group’s folder (if needed), then click Add button
Add libraries into the project
- in the Groups & Files view, right click on the project name
- Select Add and Existing Files...
- Select files into folder Libs > Debug-iphonesimulator
- Then press Add button. Check the box for Copy items into destination group’s folder (if needed), then click Add button
Add S
ettings.bundle to the Xcode project. This allows the iPhone device client user to use the Settings application to input his or her user preference information such as server name, server port, user name, and activation code.
- in the Groups & Files view, right click on the Resource sub-folder
- Select Add and Existing Files...
- Select Settings.bundle file into the includes folder
- Then press Add button. Check the box for Copy items into destination group’s folder (if needed), then click Add button
Enter the Xcode project Header Search Paths
- In menu Project > edit Active Target “SUPSapAccess”
- Navigate to the Build tab, and in the Search in Build Settings, enter “Header Search Paths”
- Add the folder path where you copied the includes files : /Users/jberthe/Desktop/Sybase Unwired Platform/includes
Add libraries into the general tab
- Click on + sign and add all of those libraries :
- Security.framework
- AddressBook.framework
- QuartzCore.framework
- CoreFoundation.framework
- libicucore.A.dylib
- libz.1.2.3.dylib
- libstdc++.dylib
- Go back to the Build tab and search : Library Search Paths
- Delete the line "$(SDKROOT)/usr/lib/gcc/i686-apple-darwin10/4.0.1" which is an other link for the libstdc++
Close the properties windows and then you sould have a project like this:
At this point, you should have a Build Success.
The next step will be the integration of SUP API Calls into your iPhone application.