Use the Generate Code wizard to generate object API code for the
SMP101 mobile application project. Code generation creates the business logic, attributes,
and operations for the mobile business objects (MBOs) in the project.
Prerequisites
In Enterprise Explorer, you must be connected to both My Sample
Database and My Mobile Server. Code generation fails if the server-side (runtime)
enterprise information system (EIS) datasources referenced by the MBOs in the project
are not running and available to connect to when you generate object API code.
Task
In SAP Mobile WorkSpace, open the
SMP101 mobile application
project.
In WorkSpace Navigator, right-click the SMP101 folder and select Open in Diagram Editor.
In WorkSpace Navigator, expand SMP101. Under Generated
Code add a folder named BlackBerry.
The Generated Code
directory was created automatically during the MBO tutorial.
Right-click anywhere in the SMP101 - Mobile Application Diagram
and select Generate Code.
In the Generate Code wizard, click Next
to select the default configuration and continue without any changes.
In the Select Mobile Business Objects
window,
select the Customer
MBO, then click Next.
Ignore any warning about unresolved mobile business object
dependencies.
In the Configure Options
window,
specify these values and click Finish.
Option
Description
Language
Select
Java.
Platform
Select
Java ME
for
BlackBerry.
Mobile server
Select My Mobile Server.
Server domain
Accept default
value.
Page size
Accept default value of
1024.
Package
Enter com.mycorp.smp101.bb.mbo.
Project
path
Enter \SMP101\Generated
Code\BlackBerry.
Third-party jar
file
You do not need to choose one for this
tutorial.
You see a warning at the top of the
page: The
dependent
third-party class
'net.rim.device.api.system.ApplicationDescriptor'
cannot be found. You can ignore this
warning; it does not affect code generation.
Generate Metadata Classes
Select for this tutorial.
Generate JavaDoc
Unselect
for this tutorial.
You can ignore the error icons that appear in WorkSpace
Navigator under SMP101\Generated
Code\BlackBerry\src\, and the error in the Problems view: net cannot be resolved.
The
error occurs because the package Java file called by SMP101DB.jar is not yet in the project build
path. The errors resolve later, when you build the application in the
BlackBerry Java Plug-in for Eclipse.
In the Success dialog, click OK.
In the Generated Code directory,
you see a \BlackBerry\src\
folder.