/Mobile
Learn how to develop mobile applications using Sybase Unwired Platform and understand the concepts of SAP mobility as well as prerequisites for a successful deployment. Get an overview of the platform’s architecture, learn how to install and configure the platform, and see how to develop your first application. Learn some tips and tricks for the successful development of an application for Apple devices.
Key Concept
The Sybase Unwired Platform is the middleware between a mobile device and an SAP system. Mobile Business Objects are developed in Sybase Unwired WorkSpace and deployed before code for the mobile device is generated. This code is used to develop the mobile application and user interface for the device.
In today’s world there are more and more requirements for mobile applications. The standard mobile applications provided by SAP and their partners cover only a small fraction of the functionality required by various areas within companies of all industries. Thus you often need to develop and deploy your own applications.
A leading global engineering firm recently sought a mobile application for incident handling based on SAP CRM Service Request Management. The firm’s field engineers required an application with timely data capturing and location-independent access to their knowledge database. This was needed for fast restoration of operations and to ensure customer satisfaction. The company had decided to use Apple’s iPad, and asked for an intuitive user interface (UI) using Apple’s standard look and feel and design concepts.
The final product included features such as the creation and update of incidents, customer details, and a history of incidents for each machine. It also used an SAP NetWeaver TREX-based knowledge search to find solutions for known problems. The use of native application development, based on a Sybase Unwired Platform-generated data model and communication layer, allowed users to take advantage of device-specific features. Engineers could use the iPad’s camera to take photos to better document an incident or read barcodes to reduce manual data entry.
Based on the experience from this solution and previous mobility implementations on various platforms, the following sections explain the basics of mobile application development and the use of the Sybase Unwired Platform.
System Basics
Developing SAP mobile applications such as the one described above requires the developer to understand the architecture of the Sybase Unwired Platform, as well as its basic installation procedure.
Sybase Unwired Platform Architecture
Figure 1 shows the flow of data from an SAP system to individual mobile devices. Transactional and master data required for the application are selected from the SAP system (or other source systems), transferred to a consolidated database (CDB) on the Sybase Unwired Platform, and then transmitted to a CDB on the device. The data is then read from the CDB on the device and displayed to the user. Data entered by the user on the mobile device is transferred to the Sybase Unwired Platform and then back to the SAP system for processing. Sybase Unwired Platform applications use this approach to function both online and offline. When the user runs the app with an Internet connection available, data is downloaded to the device CDB, and can then be used offline. Similarly, data created or changed on the device is saved to the device CDB and then replicated to the SAP system when an Internet connection becomes available.

Figure 1
Data flow in the Sybase Unwired Platform
Installation
Aside from your source system (e.g., SAP CRM) and basic networking infrastructure, the basic requirements to install the Sybase Unwired Platform can be kept to a minimum. If no load balancing, advanced security solution, or failover setup is needed, a simple Microsoft Windows-based system can be used as a host. Although SAP recently acquired Sybase, you can still purchase Sybase Unwired Platform either from SAP or Sybase sales representatives. You can download necessary software from the Sybase Product Download Centre (SPDC), which also provides license generation and management. The licensing options for Sybase Unwired Platform are the Developer Edition, Enterprise Edition, and Production Edition. The main difference among these is that the Developer Edition cannot be installed in a cluster environment. The three licenses also allow different numbers of devices to be connected.
When downloading the software from SPDC, always check for the latest patches and follow the manuals provided. System prerequisites and required system settings are described there in great detail. During the installation procedure, we recommend that you select manual start of services instead of automatic, to avoid conflicts.
To follow the next steps described below and create your first mobile application, you can install the platform’s free trial version, which you can obtain by contacting Sybase’s sales department. It comes with a license valid for 30 days.
Developing a Mobile Application
Based on the system architecture described above, the development of mobile applications for SAP CRM using Sybase Unwired Platform requires three major steps:
- Implement data access through Remote Function Call (RFC)-enabled function modules
- Define Mobile Business Objects (MBOs) using the Sybase Unwired WorkSpace
- Generate code for the mobile device and customize the front-end application through the relevant SDK
Create RFCs
When implementing the RFC to access data from SAP CRM, it is important to implement a Business Application Programming Interface-like structure in the function module interface. Later, when creating an MBO with the Sybase Unwired WorkSpace Editor, it requires a Return parameter in the function module, defined as “like Bapiret2.” When modeling the data access layer, the developer should select as much data that might be required as possible for the mobile application to reduce calls to MBOs. This increases the efficiency of the application, conserving battery life, improving performance, and allowing the user to run the application offline.
The code in Figure 2 provides a simple example of how data can be retrieved by ABAP function modules and passed to the Sybase Unwired Platform. In the given function module basic information, such as first and last name for the user ID provided, are returned to the platform.

Figure 2
Simple RFC code example
Define Mobile Business Objects
Start Sybase Unwired Platform services and the Sybase Unwired WorkSpace from their desktop shortcuts. From Enterprise Explorer, make sure that the connection to the data source (your SAP system, for example) is established. Further check that the Sybase Unwired Server is running by pinging the server from within Enterprise Explorer. If the ping fails, this might be due to the services not having started or due to an expired license. After successfully connecting to the SAP server, a list of all available BAPIs is displayed (Figure 3).

Figure 3
Available BAPIs in Enterprise Explorer
The first thing to do is to create a project, which we will name CRMexpert. This is done from the Workspace Navigator by selecting New > Mobile Application Project in the menu (Figure 4). In the subsequent wizard, choose the SAP system to which you want to connect.

Figure 4
Name the new project
To create an MBO in the new project, you can use the Palette or right-click the Mobile Application Diagram view and select Add Mobile Object. This brings up a wizard in which you state the system, search for a BAPI or your custom RFC, and add it as an MBO (Figure 5). Operations on MBOs are also RFCs and the operation wizard allows you to search for and choose the BAPI or RFC. If they exist, relationships between the MBOs should also be set up by clicking the Relationship node in the Palette and dragging and dropping between the MBOs (Figure 6).

Figure 5
MBO creation wizard

Figure 6
MBOs and Palette visible
The Workspace Navigator includes Data Source References (the SAP system), Cache Groups, Personalization Keys, Roles, Synchronization Groups, Filters, and a function to generate code for the device (Figure 7). Cache Groups include the update policies between the Sybase Unwired Platform and the client. The default is 0 minutes and 0 seconds. If push functionality is required, you can define it using Data Change Notification (DCN). An event in the SAP system initiates DCN and the DCN is then issued to the Unwired Server.

Figure 7
Workspace Navigator window
Roles are used for security, similar to roles in an SAP system. Synchronization Groups affect data synchronization between SAP and the Unwired Server, and the default is set to 10 minutes. Filters are used to check data before it is sent to the mobile device (Figure 8).
For the CRMexpert app, we only use the Mobile Business Objects and Generated Code folders (Figure 7). Details about security, synchronization, and filters would far exceed the scope of this article.

Figure 8
Filter menu in the WorkSpace Navigator
Generate Code
Once you have created all the MBOs in the Workspace Navigator, the MBOs are deployed to the Unwired Server and code is generated for export to the SDK for native application development. The user exports the generated code to a file and then sends this to the developer.
When deploying the MBOs you can choose between replication-based and message-based synchronization. iOS (the operating system found in iPhones and iPads) uses only message-based synchronization (Figure 9). Replication-based synchronization replicates the relational database onto the device and works with Windows Mobile and BlackBerry. It is session-based and so does not require a constant connection between the device and Sybase Unwired Platform. Message-based synchronization is typically asynchronous. Data changes are automatically sent from the server to the client and applied to the CDB, and updated operations are sent from the client to the server.

Figure 9
MBO deployment and synchronization options
When generating code, you can choose between code for iOS, Objective C, C# for Windows Mobile, and Java for BlackBerry. In our example, the generated code appears in the folder and from there can be exported to the Apple SDK for iOS development (Figure 10).

Figure 10
Generating code for iOS
Enhance the Application and Its UI
Native application development allows developers to take advantage of individual device features, and develop state-of-the-art UIs. For example, in the Issue Management app mentioned at the beginning of this article, the user can use the iPad’s camera to take a photo of the failing part of a machine, make personal notes, and search the Web and Knowledge Management repository for information on similar issues. Usability is key in mobile applications, given the restricted screen size and other limitations. To this effect, a designer typically creates the fine design which is then used by the iOS developer, including corporate design standards and following the common application design standards of the relevant device.
Deploy the Application
Once the app has been developed and is ready for testing, the developer can distribute it to testers using appropriate tools for the device used. In the given example, the iOS app is being deployed over the air (OTA), using developer tools such as https://www.testflightapp.com. When the app is ready for deployment in a production environment, it can be transferred to devices by uploading the app to a file server and users download from there, or OTA using device management tools such as Sybase Afaria.
As part of your deployment strategy, another topic that needs to be taken into account is security. The first line of security is basic password protection. However, data may need to be encrypted for transmission, and if a device is lost or stolen, it should be possible to permanently wipe data remotely from the device. You can achieve this using Sybase Afaria device management. However, device management is based on many factors such as the number of devices, security standards, and deployment strategies, which are beyond the scope of this article.

Figure 11
Finished Issue Management application
Outlook
Even though the current mobility space still requires a large amount of custom development, SAP recently announced its intention to provide 100 standard Sybase Unwired Platform-based mobile applications together with their partners by the end of 2011. Already, applications such as BusinessObjects Explorer for mobile reporting and CRM Mobile Sales have successfully been implemented in many environments. With future versions of the platform supporting Android, all major mobile platforms will be supported for SAP mobile application development.
Sybase Unwired Platform allows the user to separate the modeling from the coding, allowing projects developed for one device to be developed for another by modifying only the client-side code. In addition, SAP supplies an overall solution including device security and management with SAP. The return on investment to companies mobilizing their business with Sybase Unwired Platform is clear.
Ilan Blecher
Ilan Blecher is a solution principal for SAP mobile solutions at ecenta AG in Walldorf, Germany, with a total of 14 years of experience in SAP products. Since 2008 he has focused on SAP mobility solutions and implementing mobile solutions on various platforms and devices, including security and deployment solutions such as Afaria.
You may contact the author at ilan.blecher@ecenta.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.

Sebastian Angerer
Sebastian Angerer is a consulting manager for the EMEA region at ecenta AG in Walldorf, Germany, with a total of nine years of experience in SAP products. In the role of solution architect, he has contributed to many successful SAP CRM projects worldwide, providing functional and technical consulting as well as managing the delivery of projects.
You may contact the author at Sebastian.angerer@ecenta.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.