Академический Документы
Профессиональный Документы
Культура Документы
MOBILE SUITE
FOR SAP SYSTEMS
Configuration Level 1 Tutorial
4th Edition
1721 Moon Lake Boulevard | Suite 300
Hoffman Estates, IL 60169
800.567.9256 toll free - North America
info@syclo.com | www.syclo.com
SAP®, SAP® CRM® and SAP® ERP® are registered trademarks of SAP AG in Germany and several other countries.
All other products and logos are the trademarks or registered trademarks of their respective holders.
Contents
Introduction to the SMART Mobile Suite for SAP® Systems 7
4
Contents
Working With The Mobile Integration Settings 67
5
Exercise D: Create Screensets and Screens for Reservations . . . . . . . . . . . . 157
Exercise E: Create Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Importing the Java Source Files for the Application to the Eclipse Platform . . . . . 178
Exercise A: Importing the Java Source Files for the Application to the Eclipse Platform
179
6
1 Introduction to the SMART Mobile Suite for SAP® Systems
8 Introduction to the SMART Mobile Suite for SAP® Systems
SMART Server
The SMART Server is a communication hub within the SMART application. The Server
provides two-way communication between the SMART application and the SAP® database
during synchronization. The information exchanged between these two systems is referred
to as the “production data” of the SMART application. The SMART Server does not store any
information internally, but rather manages all communications, synchronization, error
handling, personalization and transactional controls needed for the mobile application to
function.
The SMART Server also serves “application data,” or the data that provides the business
logic and behavior to the SMART Clients. When changes are made to the application in the
Agentry Editor, they are published to the SMART Server. The Server transmits the changes
to the SMART Clients during their next synchronization. No special actions are required on
the part of the users when new application data is received. For instance, the users do not
need to restart the Client.
In the SMART Production Environment, multiple versions of the application are stored and
supported by the SMART Production Server at one time. This allows for older versions of the
application running on the Clients to still communicate with the server and receive the
updates.
The SMART Server can be configured as a Development or Production Server. The
functionality and behavior of each is similar in either configuration. However, the
Development Server is intended for development work and the Production Server is intended
for real-world production environments.
Introduction to the SMART Mobile Suite for SAP® Systems 11
Eclipse Plug-In
The Agentry Editor is provided as a plug-in tool to the Eclipse platform. This architecture is
beneficial to the developer or implementor in that it provides an industry standard interface,
and allows the Editor to leverage many of the powerful tools available within Eclipse. During
installation, the Eclipse platform can be installed with the Editor, or the Editor plug-in can be
installed to an existing Eclipse implementation.
Eclipse provides built-in testing, debugging, and emulation capabilities. It also includes
search functionality, import/export features, and the ability to visually modify screens.
is the ability to visually compare two projects and to export the differences between two
different versions of the same application.
Another significant functionality set for application and project management is Team
Configuration. This functionality set was added to the system with the 5.2 release of Agentry.
This new feature provides support for a shared repository of development work accessible to
all developers on a team for the same application. The repository supports multiple revisions,
and checkouts, commits, and updates to and from this common source. For full details on this
functionality, see the Agentry Development Guide for Agentry 5.2.
Introduction to the SMART Mobile Suite for SAP® Systems 15
Debugging Tools
The ATE provides debugging and data inspection tools. These tools can be very useful to a
developer, as they expose the data stored on the Client as well as the complex business logic
contained in the definitions at run time.
During transmit, the transmit dialog within the ATE’s Client displays additional information in
relation to any errors or issues that are not normally displayed on a standard Client. This
information includes error messaging returned by SAP® system. This can include error
messages related to processing SQL statements, messages generated by the Java Runtime
Environment, and other similar messaging.
For client-side functionality, the ATE includes a robust set of debugging tools. These tools
allow for the setting of break points within transaction processing, rule debugging and
logging, data inspectors for objects, data tables, complex tables, and transactions. For testing
of scanner platforms, the ATE includes the ability to pass values to the client through the
scanner API, mimicking scanner functionality and allowing for the evaluation and testing of
scanner behaviors and features. Similar behavior exists for GPS unit functionality. Location
values can be passed to the client through the ATE, as if provided by a client device’s GPS
unit.
Other functionality related to testing includes the ability to fail network communications for a
given transmit configuration. This is used to test defined transmit configuration failover
behavior.
The ATE also has uses in the Production Environment. Specifically, it can be used to
diagnose an issue encountered in a deployed application. In addition to the inspection and
debugging tools, the ATE can force the SMART Production Server to produce the logging
information that is otherwise disabled. This information is only generated for a single
transmission from the ATE, meaning the log files are not enabled for all users. This prevents
unneeded log file messages from being generated and significantly reduces any impact on
the Server’s performance.
20 Introduction to the SMART Mobile Suite for SAP® Systems
6$32/73'DWDEDVH
6$36WDQGDUG%$3,V&ODVVHV 6$3(QKDQFHPHQW)UDPHZRUN
&KDQJH'HWHFWLRQ/D\HU
&RQILJXUDWLRQ0RGXOH
%XVLQHVV/RJLF/D\HU
6\VWHP0RQLWRU
$SSOLFDWLRQ'DWD)LOWHU6HUYLFHV
6\FOR'DWD2EMHFW&ODVV 0RELOH,QWHJUDWLRQ
+DQGOHU5HSRVLWRU\ &RQILJXUDWLRQ6HW
$SSOLFDWLRQ$XWKRUL]DWLRQ6HUYLFHV
,QWHJUDWLRQ/D\HU
6\FOR%$3,:UDSSHU
-DYD&RQQHFWRU
0LGGOHZDUH
6\FOR
$JHQWU\6HUYHU
)LUHZDOO
&RPPXQLFDWLRQV:/$1::$1*356*601HWZRUN'RFNLQJ&UDGOH,5'$
0RELOH$SSOLFDWLRQV
22 Introduction to the SMART Mobile Suite for SAP® Systems
Java Architecture
The Java backend uses classes of type SAPObject to represent data objects sent to and from
the Client. Most of these classes are POJOs (Plain Old Java Objects), meaning they store
data in fields, provide accessory/mutator methods, and know how to construct themselves
when told to by the code. The following are the types of Java classes we will work with:
SAPObjects: SAPObjects can be composed of other SAPObjects stored as arrays of
SAPObjects (i.e., Notifications have NotificationItems). All metadata is encapsulated
in the SAPObject class rather than in an external file.
StepHandler: StepHandler classes provide the calling interface to classes
subclassing the Agentry API (steplets, data tables, and complex tables). Methods in
StepHandler classes should be static. StepHandler methods also provide an interface
for JUnit test suites.
BAPI: The BAPI class encapsulates all of the BAPI processing needed by the Java
backend. It is abstract, as there are two specific types of BAPIs; FetchBAPIs and
TransactionBAPIs.
FetchBAPIs: Types of BAPIs that create SAPObjects from the exchange
process. The SAPObjects are then parsed by Agentry for use on the Client.
TransactionBAPIs: Take an Agentry transaction on the Client and turn it into
one or more jCo tables, then run the BAPI passing the tables in order to update
SAP.
The BAPI objects that the code uses are subclasses of FetchBAPI, TransactionBAPI,
DataTableBAPI, or ComplexTableBAPI. Developers write these BAPI classes to call the
BAPIs to do the things that the mobile application needs to do. A developer-written BAPI is a
specific ABAP function call for a particular application. For example, fetching all work orders
for a user, or sending up a locally added notification.
Note that there is not necessarily a one-to-one correspondence between BAPI classes and
ABAP function names.
BAPI classes accomplish the following:
Create themselves out of the JCO.Repository when necessary. This is done just
before they are called, but a developer might make these poolable or cacheable.
Set input values in JCO.Table parameters, such as search ranges in the case of
FetchBAPIs or transaction data in the case of TransactionBAPIs.
Are executed when called (get the results or post the data to SAP).
Report exceptions and errors back to calling code. This includes reading return tables
and parsing for error messages when necessary.
Introduction to the SMART Mobile Suite for SAP® Systems 23
This procedure describes the steps to install the SMART Server software to a Windows
system. This procedure is the same for Windows Server and Windows XP Professional
systems. Note that the 64-bit build of the SMART Server can only be installed to 64-bit
operating systems. The 32-bit build of the SMART Server can be installed to either 32- or
64-bit Windows systems, but will not take advantage of the 64-bit memory addressing. The
SMART Server should never be installed to a Windows XP Professional host system for
production purposes. This operating system is supported by the installer solely for
development purposes. Production Servers should always be installed to server class host
systems.
When this procedure is complete, it will be necessary to perform initial configuration of the
SMART Server. Specifically, configuration options related to communications between the
SMART Clients and the SMART Server, and related to communications between the SMART
Server and the SAP system must be set according to the specifics of the implementation
environment.
For production environments in which multiple SMART Server instances will be installed for
load balancing and fail-over, perform this procedure for each SMART Server instance.
Installation and Initial Configuration 31
Additionally, review information provided on establishing SMART Server clusters using the
Agentry Administration Client.
Step 3 - Click the [Yes] button to agree to the license agreement and to begin installing
the SMART Server.
The Customer Information screen displays.
Step 4 - Enter the name of the administrator for the SMART Server and the company
name. In the Serial Number field, enter the number provided with the SMART Server
Installer. Click [Next] to continue.
The Enter Product Keys screen displays.
Installation and Initial Configuration 33
Step 5 - Enter the user key, device key, and expiration keys provided by Syclo.
Information entered on this screen is written out to the agentry.ini file. Click [Next]
to continue.
The Choose Server Type screen displays.
Step 6 - Select the type of SMART Server you want to install. Select Production for live,
production environments. Select Development for development or test environments.
If both are selected, two separate SMART Servers will be installed in separate
locations. Click [Next] to continue.
The SAP Connectivity Information screen displays.
Step 7 - Enter the name of the SAP Server and its port number in the Server field, using
the format: servername:portnumber. If both a Production and Development Server
are being installed, this previous screen will be displayed twice, once for each Server
instance. Enter the appropriate information for both SMART Server instances.
NOTE: All information entered in Steps 7-10 is written out to the JavaBE.ini file.
34 Installation and Initial Configuration
Step 8 - Enter the Client Number and System Number the SMART Server will use to
communicate with the SAP Application server. Click [Next] to Continue.
The User Information screen displays.
Step 9 - Enter the Service User Name and Service User Password. This is an
administrative user established as a proxy for all users. If both a Production and
Development Server are being installed, this previous screen will be displayed twice,
once for each Server instance. Enter the appropriate information for both SMART
Server instances.
Step 10 - If you are using Push Notifications, you must check the Enable Push
checkbox and then enter the Push User Name and Push User Password. Again, this is
an administrative user established as a proxy for all users. In most cases, this can be
the same user name and password as the Service User. Click [Next] to Continue.
The Java Backend Information screen displays.
Installation and Initial Configuration 35
Step 11 - Change the default values for the Java backend class paths should only if
you want to point the server to a different SAPjco.jar file or a different runtime
environment.
Step 13 - Specify the folder in which to install the SMART Server. To change the default
folder, click [Browse] and navigate to the desired folder.
NOTE: If both Production and Development Server installations were selected in the Choose Server
Type screen, these screens will display once for the Production Server and once for the
Development Server.
Step 15 - In addition to the shortcuts for the Server instance, the option to install the
Server as a Windows Service is also provided. Check this box to install the Server as
a Service if this is the desired configuration. Note that this is commonly set for
Production Servers but rarely for Development Servers. Also, select what shortcuts
and where they should be located from the Shortcuts window.
NOTE: If both Production and Development Server installations were selected in the Choose Server
Type screen, these screens will display once for the Production Server and once for the
Development Server.
Step 17 - When the installation is complete, you may be prompted to reboot the host
system. Select the desired option and click the [Finish] button to complete the wizard.
RESULT
Installation and Initial Configuration 37
The SMART Server software has been installed to the Windows host system. This includes
the server executable, as well as the SMART application, as provided by Syclo.
The SMART Server instance now requires initial configuration based on the implementation
environment. This configuration includes:
Client-server communications settings
Server-SAP system communications settings
Security and authentication settings
For multiple Server instances, clustering settings and behaviors
The specifics of the Server-SAP system communications settings depends in large part on
the configuration of the SAP system. Specifically, whether the SAP system is configured in a
distributed environment, or if it is in a load balanced environment. Follow the procedures
provided for the implementation-specific needs.
38 Installation and Initial Configuration
This procedure describes the steps necessary to install the Agentry Test Environment
software component of the Agentry Mobile Platform. This component is used as a Client test
tool during development, configuration, and other modification work. It is not intended for end
users.
Perform this procedure to:
Test modifications of the mobile application, when those modifications affect
Client-side behavior or Client-Server communications or synchronization.
Test or debug run time issues in a Production environment. The Agentry Test
Environment can be connected to the SMART Production Server just as a normal
Client can.
40 Installation and Initial Configuration
When this procedure is complete, the Agentry Test Environment is available for use to test
the Client-side behaviors of any modifications made to the mobile application.
Step 1 - Start the Agentry Test Environment installer on the host system where you are
installing this component.
The welcome screen of the installer is displayed:
Step 4 - Enter the desired directory path in the Destination Folder field. This can be a
new path, an existing location selected by clicking the [Browse] button, or the default
location. Click the [Next] button to install the Agentry Test Environment to the
specified directory.
The Agentry Test Environment is installed to the specified location. The Shortcut Selection
screen is displayed.
42 Installation and Initial Configuration
Step 5 - Select the desired shortcut locations by checking or unchecking the listed
shortcut options. Once the shortcuts are configured, click the [Install] button to begin
the installation of the Agentry Test Environment software component.
The selected shortcuts are created by the installer. The Installation Status screen is
displayed next indicating the installation progress. When the installation is complete, the
Finished screen is displayed.
Step 6 - To start the Agentry Test Environment now, leave the box checked on this
screen. Otherwise, uncheck this box. Click the [Finish] button to close the wizard.
RESULT
With the completion of this procedure, the Agentry Test Environment is installed to the
selected location and is available for use in testing mobile applications in development,
configuration, implementation, or production issue resolution scenarios.
Just as with a standard Client installation, the Agentry Test Environment needs to connect to
an Agentry Server to perform an initial transmit. Prior to performing this transmit, the proper
Client platform to be mimicked, enabling or disabling scan and GPS simulations, and other
similar selections should be made.
Installation and Initial Configuration 43
Once installation is complete, the Eclipse environment will likely require initial configuration,
including the creation of a workspace, and setting the preferences for that workspace.
Finally, before beginning work on a mobile application within the SMART Mobile Suite it is
necessary to first import the definitions from the SMART Server for that product, creating an
Agentry application project within the Eclipse workspace. The SMART Server contains all the
business logic within the application project developed by Syclo. This project itself, however,
is not distributed with the application as an Agentry application project, rather existing only as
a published application with the SMART Server installation. The Agentry Editor includes
import functionality that allows for the creation of an Agentry application project from multiple
source types, including the SMART Server for a mobile application within the SMART Mobile
Suite.
Following are the general tasks to install and configure the Agentry Editor:
1) Install the Java Development Kit, which includes the Java Runtime Environment, to the
intended host system for the Agentry Editor.
2) Install the Eclipse development platform and Agentry Editor plug-in using the
Syclo-provided software installer.
3) Configure the Eclipse environment, including creating a workspace and setting
preferences suited to the projects the workspace will contain.
4) Using the Agentry Editor plug-in, import the definitions from the previously installed
SMART Server for the application, creating a new Agentry application project for this
application.
5) Within the Eclipse workspace, open the Java perspective and create the Java project
containing the Java source for the application.
In the exercises of this lesson, the Work Manager Server installed previously is used as the
import source for the new Agentry application project created after we install the Agentry
Editor. Likewise, the Java project created is for the Work Manager application.
Installation and Initial Configuration 45
Beginning with the release of the Agentry Mobile Platform version 5.0, the Agentry Editor is
provided as a plug-in component to the Eclipse Platform. The installer provided by Syclo
includes:
Eclipse Platform v3.7
The Agentry Editor plug-in for Eclipse
The Java Runtime Environment (JRE) version 1.6 (Java 6)
The Microsoft Visual Studio C++ runtime libraries
Of these components, the Eclipse Platform and the Agentry Editor plug-in are always listed
in the installer as options to install. The JRE is listed if it is not currently present. If already
installed, the installer does not attempt to reinstall it. The C++ runtime libraries are installed
in the background if not already present.
Note with the release of the Agentry Mobile Platform v.6.0 the Agentry Editor plug-in can no
longer be installed to an existing Eclipse implementation. The installer will not allow the
existing Eclipse folder to be selected as a valid installation location. This is true for Eclipse
implementations whether or not they contain a previous version of the Agentry Editor plug-in.
The plug-in can also not be installed to an Eclipse implementation even if the version is the
same as the one installed by the Editor installer software.
Step 3 - Click the [Yes] button to accept the license agreement and advance the wizard.
The Choose Components screen displays.
Installation and Initial Configuration 47
Step 4 - Select the proper components to install for the Agentry Editor plug-in. If you
are adding the Agentry Editor plug-in to an existing Eclipse environment, uncheck this
option. For a new installation, select all components. Note that the Agentry Editor
plug-in is always selected. Also note that if the Java Runtime Environment version 1.6
is not found, an option is listed on this screen to install it. In this case, the JRE will be
installed to the default location. Click the [Next] button to continue.
The Choose Install Location screen displays.
48 Installation and Initial Configuration
Step 5 - Select where to install the Eclipse environment and the Agentry Editor plug-in,
depending on the components selected for installation in the previous step. If Eclipse
v3.7 was installed or upgraded prior to running the Editor installer, the destination
folder is the installation folder of that Eclipse installation. If the complete Eclipse
environment is also installed, use the default location, or choose any other valid path.
Click the [Next] button to continue.
The Shortcuts for Agentry Editor screen displays.
Step 6 - Check the boxes that apply to the desired shortcuts for the installer to create.
These shortcuts are started when the Agentry Editor plug-in is loaded. Click the
[Install] button to begin the installation.
The installation will proceed and the status will be displayed. Click the [Show Details] button
to view the detailed progress of this process, if desired.
Installation and Initial Configuration 49
Step 7 - Once the installer has completed its processing, the following screen is
displayed.
From here, you can choose to start the Eclipse environment with the Agentry Editor plug-in.
If this is the first time Eclipse is installed and the Java Runtime Environment is not a part of
your system’s Path variable, do not start Eclipse. Uncheck the box and click the [Finish]
button. Continue to the next step.
Step 8 - If JRE was added to the host system as a part of the Eclipse and Agentry Editor
installation, there are two folder locations that you need to add to the system’s Path
environment variable. To add these, right-click on the My Computer icon on the
desktop and select the Properties item in the menu displayed. In the System Properties
screen, select the Advanced tab. Click the button Environment Variables. In the lower
half of the screen is a list of the currently defined System Variables. Select the Path
item in this list.
Click the [Edit] button and on the screen displayed, check for or add the following two paths
to the existing values. If they are already present, do not add them again. If they are not
found, add them as listed below. NOTE: Take caution not to modify any existing values in
this list. When adding path values, separate each path with a semi-colon (;).
C:\Program Files\Java\jre1.6.0_07\bin
C:\Program Files\Java\jre1.6.0_07\lib
50 Installation and Initial Configuration
Step 9 - Click the [OK] button after adding the values and click [OK] to close out of the
system properties screen.
Step 10 - Launch the Eclipse environment with the Agentry Editor plug-in.
RESULT
The Eclipse environment, Agentry Editor plug-in, and any other components selected are
installed on your system.
Additional configuration of Eclipse is needed as it relates to the Agentry Editor plug-in. This
configuration is performed within the Eclipse Platform and includes the following general
items:
Agentry projects work with several file types. You must create file associations within
Eclipse for these types to allow the platform to properly handle, display, and edit them.
Script files, including SQL and shell or batch scripts created in Agentry Editor are
saved with a Unicode encoding. The default file encoding for an Eclipse workspace is
different. You must modify file encoding options within the Eclipse preferences.
When working with a database back end system, you must configure the Data Source
Tools installed with Eclipse in order for the Agentry Editor connector studio to work
with a database back end.
It may also be necessary to complete the configuration of one or more SMART Servers. With
the release of version 5.0 of the Agentry Mobile Platform, a publish from the Editor is a part
of the Server configuration process as it relates to the Agentry application project’s system
connections. If connectivity was already configured between the SMART Server and SAP®
Systems, the publish is not necessary for connection configuration.
Installation and Initial Configuration 51
In this exercise, you will create a notification document for a work order, create a work order,
and assign it to yourself in SAP. Then you will download the work order using the SMART
Client in the ATE, complete the work order, and upload it back into SAP. This will demonstrate
the basic flow of data between SAP and the SMART application.
Step 2 - Create a Work Order from the New Notification Using SAP
Log into SAP using the log on information provided in class. Type in IW22 in the command
field and press Enter.
In the Notification field, type in the notification number you created in the ATE and
transmitted up to SAP in the previous step and press Enter. The Change PM Notification
screen displays.
Click the Create Order button to convert the notification to a work order. Accept the
defaults provided to create the work order. Your assigned user ID will automatically be
filled in as the Person Responsible. Take note of your ID number.
Click the green check mark to create the work order. The Create Maintenance Order
screen displays. Click the green check mark to create the work order.
Click the Release button to release the work order.
Click the Save icon to issue the work order. Note the work order number in the status bar
at the bottom of the screen.
52 Installation and Initial Configuration
Outbound Triggers
An outbound trigger allows a mobile application to interface with external systems such as an
Agentry middleware Server from SAP. Outbound triggers can be integrated into standard
mobile application processes, such as push processing. You can define different types of
outbound triggers, including HTTP triggers, file triggers, and Web service triggers.
Mobile Integration Components 57
Outbound triggers are configured for each mobile application. Therefore, your mobile
applications must be defined first. Outbound trigger handlers must be developed before it can
be assigned to a trigger. Once you define the outbound triggers, you must use the
Configuration portal to assign the triggers to push scenarios.
5) DTBAPI sets the table name in the table IT_DOID, in the field DO_ID in the BAPI
import parameters.
6) DTBAPI adds IT_xxx record(s) to the DTObject import tables for search criteria or
other parameters.
7) The DataTableStepHandler build() method calls the getNumRows() method in
DTBAPI.
8) DTBAPI getNumRows() calls the execute() function and checks for exceptions.
9) DTBAPI getNumRows() reads the ET_RETURN table in the BAPI class for error
messages.
10)CTBAPI getNumRows() method iterates over ET_DATA_TABLE and reads records
from the table.
11)For each record, DTBAPI getRows() method calls the appropriate constructor in the
appropriate SAPObject subtype.
12)The SAPObject subtype constructor maps the JCO record column names to field
names.
13)DTBAPI getNumRows() method collects the SAPObjects in the data table and passes
them back to DataTableStepHandler.
14)The DataTableStepHandler build() method passes the DataTableObject back to the
initialize() method and is then stored in the appropriate field.
15)The Agentry Server parses these iterators and sends the table rows to the Client.
Mobile Integration Components 65
Additional Components
Data Staging and Proxy Settings are two additional tabs on the Mobile Data Object
Configuration page, but will not be discussed as part of the Mobile Integration Settings. These
two topics will be discussed elsewhere in this manual.
Working With The Mobile Integration Settings 69
1) The SMART Client initiates a transmit and makes a request to the SMART Server to
synchronize a given complex table. Included in the request is the name of the complex
table definition to synchronize and the date and time the data for the complex table
was last updated.
2) The SMART Server processes the request, beginning by calling the constructor
method for the complex table Java class that corresponds to the specific complex table
definition. If the exchange data model is being used, the last update value from the
client for the complex table is then updated to the client information table in the SAP
database.
3) The SMART Server next calls the build() method within the complex table Java
class. This method call ultimately results in the call to the GET method specified in the
mobile data object for the complex table.
4) The GET method compares the last update timestamp in the client information table
to the records in the exchange table as well as the SAP database for the complex
table. Any records in the exchange table not marked for deletion and with a timestamp
value newer than the last update table result in the corresponding record in the source
table in the SAP database are retrieved.
5) The GET method next compares the last update timestamp in the client information
table to the records in the exchange table that are marked for deletion. The key value
is retrieved for any records marked for deletion and where the timestamp is newer than
the last update value in the client information table.
6) The GET method returns both the list of new and updated records, and the list of key
fields for records marked for deletion to the SMART Server. These values are cached
in the Java Virtual Machine running for the SMART Server.
Working With The Mobile Integration Settings 71
7) The deleteIterator() method is called by the SMART Server. This method
retrieves the cached items from the list of key values for records to be deleted,
returning these values to the SMART Server.
8) The SMART Server sends the list of key values to the SMART Client, instructing the
client to delete the records with matching key field values from the complex table.
9) The dataIterator() method in the complex table Java class is called next by the
SMART Server. This method returns the records from the cached new and updated
records in the Java Virtual Machine memory. These records are returned to the
SMART Server which uses the data to create records for the complex table being
synchronized. The SMART Server sends the records to the SMART Client in chunks
of 200 records at a time.
10)When the SMART Client receives a chunk of records, it matches them to the existing
records within the complex table based on the key field. Any matching records on the
SMART Client are replaced with the new ones. Any records in the new set that do not
match existing records on the SMART Client are added to the complex table. The
complex table’s indexes are then updated to match the new data.
11)The SMART Client responds to the SMART Server that the records have been
received and processed. The next chunk of records, if any, are sent to the SMART
Client. This portion of the process repeats until all records for the complex table have
been processed.
12)Once all new and updated records for the complex table have been downloaded, the
next complex table is synchronized, repeating this entire process. Note that the order
in which the complex tables for an application are synchronized is not guaranteed.
The GET method, when called, returns all records that should be stored in the complex
table in the SMART Client. As previously described, these records are cached within
the Java Virtual Machine for the SMART Server.
The data in this cache is still returned by the dataIterator() and processed in the
same manner for download to the SMART Client. However, the
deletedIterator()will not return records, as all records in the complex table are
replaced with those returned during the latest synchronization. Since all data in the
complex table is being replaced, it is not necessary to delete any records.
Working With The Mobile Integration Settings 73
This exercise extends the application by adding a new complex table for an entry list, with
help from your instructor. The key point to learn in this exercise are how a complex table class
handler in SAP is created.
Normally, you would now create a new class for your complex table, but for this exercise,
we will copy a pre-created class. To do this, enter ZCL_Group00_PM_EntryList_DO in
the Object type field, and click the Copy icon to the left of the field.
In the Copy To field, type in ZCL_GroupXX_PM_EntryList_DO, where XX is your
training login number. For example, Training02 would use
ZCL_Group02_PM_EntryList_DO. Click the green check mark to continue.
When the Create Local Object Directory window appears, click the [Local Object]
Working With The Mobile Integration Settings 75
button to finish, without filling in any of the fields. You are returned to the Class Builder:
Initial Screen, with the Object type field filled in with your newly-created class.
double-click it in order to view its code. An example of what you should see is shown
below. Note that you may not see the exact code as shown in the example.
This method accepts parameters from both the BAPI and the SMART Mobile Suite
Administration component, or Configuration portal. The parameters control the behavior
of the method. The method runs a SQL query against the SAP database in order to obtain
the entry list data. The data is organized in a return table and returned to the BAPI. In this
Working With The Mobile Integration Settings 77
tutorial, our method does not have to accept any parameters from the BAPI or the
Configuration portal.
Once you are done scrolling through the method code, close the code display window and
return to the Class Builder: Initial Screen.
Click the [Activate] icon button in order to compile the new class:
The Inactive Objects window displays. Click the green check mark, or [Enter], button to
complete the compilation process.
you would create a new BAPI for your new complex table, but for this training class, you
will copy a pre-created class.
Click the green check mark to compile the class and activate the object.
80 Working With The Mobile Integration Settings
Now that a new complex table, new class, and new BAPI are created, you need to set up the
configuration so that you can link them together. This involves creating an MDO configuration
and a BAPI wrapper assignment. Both of these are created through the Configuration portal
of the Administration Component.
To extend the existing framework of a SMART product, Syclo advises you to create a copy
of the MDO you are modifying by using the Z namespace in SAP. These copies are then
referred to as Z-MDOs. This ensures that you can undo any changes made to the application
without having to reinstall it in the future.
Click the [Create] button and fill out the fields as follows:
Working With The Mobile Integration Settings 81
NOTE: Replace ‘XX’ with your log in number in all places shown in the list below.
Mobile Data Object ID: Z_GROUPXX_ENTRY_LIST
Description: GROUPXX_ENTRYLIST
Data Object Type: Complex Table
Mobile Application: Syclo SMART Mobile Suite - Work Manager 5.1
Data Object Handler: ZCL_GROUPXX_ENTRYLIST_DO
Get Method: GET
Data Object Active: True (checked)
Click the [Save] button to save the MDO to the list. You can expand the list to see your
MDO in the CT - Complex Table list, along with the MDOs created by other members in
your class.
82 Working With The Mobile Integration Settings
The BAPI wrapper is the interface through which the SMART Server calls into the SAP
components. By default, whenever you create a new BAPI wrapper, a default MDO is
Working With The Mobile Integration Settings 83
assigned. You can assign multiple MDOs to the BAPI, though we will not do that for this
exercise.
Click the [Create] button. Click the box to the right of the BAPI Wrapper Name field.
84 Working With The Mobile Integration Settings
In the Function Module field, type in Z_GROUPXX*, where XX is your log in number. Note
that the asterisk must also be included in the text string. Click the [Start Search] button.
From the list of returned BAPI wrappers, highlight the row that matches your BAPI and
click the [Copy] button. Notice that all the read-only fields in the General tab in the BAPI
Wrapper Detail pane are automatically filled in.
Once the synchronization components are created for SAP, it is time to create the definition
for the mobile application. Definition creation includes creating a complex table definition,
Java synchronization classes, and logic, in order to work with SAP components. Your first
step is to create the table definition and the SAP connection.
Syclo recommends naming all newly-created complex tables with a ‘Z’ in front of the name.
In this way, it is obvious which tables were created after the application was provided to the
customer. We will be using this Z-naming method throughout this tutorial, starting with this
lesson.
Working With The Mobile Integration Settings 87
Here, you will create your first Java class associated with the complex table.
Click [Finish].
In the new tab for the newly-created class, delete any code. Copy or type the code from
the EntryList.java file found in your Exercise Code folder on your PC into this new
88 Working With The Mobile Integration Settings
Now that the complex table and the Java classes are created, we can return to the complex
table definition in order to create the complex table fields and indexes. These fields define the
data for the records of the table, as well as the structure of that data for search and sorting
behaviors at run time.
Click the [Finish] button to close the wizard and save the field settings. Create the
following fields using the same method.
Name: EntryListID
Display Name: ID
Type: ASCII String (case-insensitive)
No. of Characters: 24
Name: EntryListName
Display Name: Name
Type: ASCII String (case-insensitive)
No. of Characters: 20
Name: EntryListNum
Display Name: Entry Number
Type: ASCII String (case-insensitive)
No. of Characters: 12
Name: PointID
Display Name: Point ID
Type: ASCII String (case-insensitive)
90 Working With The Mobile Integration Settings
No. of Characters: 12
Click the [Finish] button to close the wizard and save the index settings. Create the
following indexes using the same method.
Name: EntryListIDIdx
Display Name: ID
Field: EntryListID
Name: EntryListNameIdx
Display Name: Name
Field: EntryListName
Name: EntryListNumIdx
Display Name: Entry Number
Field: EntryListNum
Name: PointByEntryListNameIdx
Display Name: Point By Name
Field: PointID
Parent Index: EntryListName
Name: PointByEntryListNumIdx
Display Name: Point By Entry No.
Field: PointID
Working With The Mobile Integration Settings 91
Parent Index: EntryListNumIdx
Name: PointIDIdx
Display Name: Point ID
Field: Point ID
92 Working With The Mobile Integration Settings
change detection, when a change to the table for the current exchange object requires
processing specific to it, as well as to other change detection processes. As an
example, if an equipment record is modified, it may be necessary to also modify any
work orders for that piece of equipment. A link can then exist between the exchange
object for equipment and for work orders.
Push Settings: The only attribute here is Push Relevant, which can be checked or
not. When checked, this exchange object is used in push processing, part of the
real-time communications functionality available within the Agentry Mobile Platform.
Push synchronization processing is handled differently than processing items such as
fetches or complex tables.
In general, an exchange object is created for an object collection, complex table, or data table
within the mobile application. However, it is possible to have a single exchange object for
multiple definition instances if an existing exchange object serves the needs of those
definitions.
EFI Assignment
The Enhancement Framework Implementation (EFI) provided by SAP allows you to make
code enhancements to an SAP application. The SMART Mobile Suite Administration
Component uses this framework in the change detection layer to create triggers on tables
within the SAP application.
A trigger monitors a table in the SAP application for changes. When a change is made, the
trigger can then notify one or more exchange objects about the change and provide the data
changes made to that exchange object. For new records, this includes the new record. For
updates to existing records, this includes the record’s field values both before and after the
change, and an indication of which specific fields were modified.
The link for the EFI Assignment displays a screen where all EFI triggers are listed. Select a
given trigger to display its current exchange object assignments. Each exchange object to
which the trigger is assigned is notified by that trigger of the modification. It is then up to the
exchange object to decide if and how to process the modification.
Administration Component: Change Detection Layer 99
As shown in this example, there are three main sets of links. Of these, the Mobile
Application Settings group is where the bulk of our time will be spent. For this exercise we
will focus on the Backend Change Detection Settings section of links, which includes
the Exchange Object Configuration and EFI Assignment links.
Note the drop-down list in the upper-right corner labeled Mobile Application Filter. When
multiple mobile applications from the SMART Mobile Suite are installed, by default all
elements for all applications are displayed in the configuration pages. If working with a
single mobile application, you may want to filter those items displayed that application.
Select any of the installed applications in this drop-down list. You can change your
selection or list all elements for all installed applications at any time on the main
Configuration portal page.
100 Administration Component: Change Detection Layer
When initially displayed, the fields on this page are empty. It is possible to create a new
exchange object at this point by clicking the [Create] button at the top of the screen. To
view the details of an existing exchange object, select it in the list on the left of the screen
by first expanding the application area to which the exchange object applies, and then
selecting the specific exchange object.
When an exchange object is displayed, additional buttons are enabled at the top of the
screen. [Copy] allows for the creation of a new exchange object that is initially an exact
copy of the one currently highlighted.
The [Delete] button removes the current exchange object. Use the [Change] button to
make changes to the exchange object settings. The default display of the page is
read-only, and you must click the [Change] button to edit the settings shown here.
Note the series of tabs below these buttons. Each displays a group of attributes or related
items for the exchange object. The first is Technical Settings, shown in the previous
example. These settings primarily specify the basic information for the exchange object
as well as the other elements within the Administration Component with which it works or
affects.
You can change any value for an existing exchange object with the exception of the
object’s name. Note that when creating a new exchange object, the other referenced
items must already exist, including the exchange table, the lock object, and the exchange
object handler, before they can be referenced in the new exchange object.
Administration Component: Change Detection Layer 101
Step 3 - Exchange Object Configuration: Change Detection Field Selection
Select the tab Change Detection Field Selection. Displayed here are the fields, grouped
by table, that the exchange object looks to for changes:
Within the main list of this page are each of the tables, and under those each of the fields
within those tables that concern the exchange object. You can select or deselect each
field within a table through the Active Flag checkbox. When selected, the exchange
object looks for changes to that field based on information sent to it by the EFI trigger.
If the change made to the table does not include changes to one of the fields selected in
this list, the change is ignored. Fields not selected for change detection are those that are
not a part of the data for the mobile application, or in some cases, are not deemed
important enough to warrant updating the data on the mobile clients.
Selecting the proper fields in this list is a key task in the proper configuration of the
exchange object.
102 Administration Component: Change Detection Layer
The condition filters for an exchange object are created for fields within a table for the
exchange object. As shown in the previous example, the filters defined for the exchange
Administration Component: Change Detection Layer 103
object are listed and can be selected. When a filter is selected, its details are displayed
on this same page:
Filters are made up of one or more rules. In this example, there are no rules defined for
the filter, which is typical of many of the filters for the standard exchange objects as
provided by the installer. These filters are place holders and, with no rules, have no effect
on the behavior of the exchange object.
When a filter does contain rules, those rules can determine the nature of the change to a
field. As an example, if the new value is within a certain range, it is treated as a change of
significance. If outside this range, it is ignored. Or, if is equal to a set value, it may be
important, such as the type of work order created. An emergency work order may be one
of importance to push processing, while other work order types are not. Therefore, a filter
may exist on the exchange object for work order push scenarios that filters out new work
orders unless the work order type is emergency maintenance.
Within this screen, a rule is added to the filter by first selecting the field and the Sign, or
comparison type. The pertinent values are then entered for comparison to the value of the
selected field. Once complete, the rule is added to the filter. You can add other rules to
the same filter, which results in an AND relationship, meaning all rules must be true in
order for the change to process.
In the list of filters on this page, those with active rules are denoted with an asterisk (*)
after their names.
104 Administration Component: Change Detection Layer
Many exchange objects will not have a list of items here, as most do not require any link
to other exchange objects. When a link does exist, it is listed on this screen in the Linked
Exchange Object List.
In the above example, the link is between the exchange object for equipment and the one
for work orders. When a change is made to an equipment record in the SAP database, it
is processed by the equipment exchange object. The work order exchange object is then
notified of the change, so that it can update any work order exchange records for work
orders that were created for that piece of equipment.
Within the section Backend Change Detection Settings, select the link EFI Assignment.
Administration Component: Change Detection Layer 107
Step 2 - EFI Assignment Detail: General Settings
When the EFI Assignment Detail screen is displayed, it is initially empty. Selecting an
Enhancement Implementation Include from the tree control on the left will display it
settings in this screen:
The settings listed in the General tab contain the EFI include name, a description, and the
package to which the EFI assignment belongs. Typically these items are set when the EFI
assignment is created and are not modified again.
108 Administration Component: Change Detection Layer
Displayed on this screen is the EFI Assignment List of the exchange objects to which
the EFI is assigned. As shown in this example, a single EFI can be assigned to one or
more exchange objects. When a change occurs to the table monitored by the EFI, each
of the assigned exchange objects are notified provided that the assignment is active. This
is denoted in this list in the Active Flag column, with a check mark indicating the
exchange object assignment is active.
Below this list are the settings related to the exchange object assignment currently
selected in the EFI Assignment List. These Assignment Details include:
Mobile Application: The mobile application in which the exchange object resides.
Exchange Object and Description: The exchange object and its description to
which the EFI is assigned.
Active Flag: Indicates whether or not the assignment is active. Exchange object
assignments will result in the EFI not notifying the exchange object of any changes.
To add a new assignment, first click the [Change] button. Then, in the assignment list,
click the [Add] button. The Assignment Detail fields are then enabled, and the you can
Administration Component: Change Detection Layer 109
select the settings. Once your changes are saved, the EFI will notify the exchange object
of any changes made to the table it monitors.
An existing EFI Assignment can be edited by clicking the [Change] button and then
selecting the assignment to edit in the Assignment List. The Assignment Detail fields are
then enabled and the values can be changed as desired. Typically this is done to set or
un-set the Active Flag value.
110 Administration Component: Change Detection Layer
6 Working With the Change Detection Layer
112 Working With the Change Detection Layer
Exchange Data Model in the SMART Mobile Suite for SAP® Systems
Within the SMART applications, the use of the exchange data model involves the above
processing, implemented using the components and elements specific to this suite. The key
pieces to this processing include:
The exchange object within the SMART Mobile Suite Administration Component that
evaluates and processes changes to the database.
The EFI trigger that notifies the exchange object of changes to the database.
The mobile data object within the SMART Mobile Suite Administration Component that
retrieves data from the database, using information generated by the exchange object
concerning which data to retrieve.
Working With the Change Detection Layer 113
The definitions within the Agentry application project responsible for retrieving data
from the SAP database through the mobile data object.
The last update information and key identifier values of the data instances contained
on the device prior to the beginning of a transmit.
The EFI trigger and the exchange object for a given data component of the mobile application
work to track changes made to the database. This information is then used by the mobile data
object’s GET method to determine the data to retrieve, comparing it to the information
provided by the mobile application about the data currently stored on the Client.
The EFI trigger and exchange object elements of the SMART Mobile Suite Administration
Component are a part of what is termed the Change Detection Layer. These two components
are constantly monitoring and processing changes to the database, with the exchange object
tracking changes by recording them in an exchange table. The records of this table are then
referenced later by the mobile data object’s GET method to retrieve data.
In the lessons of this chapter, we will focus on working specifically with the exchange object,
modifying it to track changes beyond those processed by the default configuration of the
Work Manager application.
114 Working With the Change Detection Layer
In the Database table field, enter Zsyc_XX_melnr_EX, and click the [Display] button.
Be sure to enter your log in number in place of the XX in the field name. The Dictionary:
Display Table screen appears.
118 Working With the Change Detection Layer
Notice the Field column, the indicator columns, and the CHANGED_TS, or changed
timestamp row. These are all indicators to point to what object changed, how it changed,
and when it changed. Your instructor will go over more of this table, verbally, with you in
class.
What you are viewing is a copy of the standard exchange class handler that is delivered
with the SMART application. It is capable of handling the exchange table system.
The methods in blue text indicate that the method is using predefined methods in the class
that are passed down from the parent class. Methods in black text indicate that they have
been overridden and are different than the parent.
There are two override methods in this class. Double-clicking on either method (or any
row) displays its code. Since the standard class is generic, you need to specify what you
need to monitor for your exchange process. The SMART Mobile Suite architecture allows
you to define field-level change detection. Since only a subset of SAP’s data is sent to the
SMART application, it only needs to monitor that subset for changes, and the exchange
120 Working With the Change Detection Layer
process only needs to monitor fields relevant to the application. This allows the exchange
table to tell not only if data has changed but also if it is relevant to the Client application.
Fields are specific for each data object, so the first override method contains only the list
of fields that are relevant for this data object. The second override method supports
additional criteria for filtering. Using filters, you can filter changes that only apply to certain
filter settings. For instance, you can filter data to bring down only changes that are
relevant to a specific mobile application, such as only certain types of work orders,
inventory in a certain location, etc.
Once the exchange object is created in the Configuration portal, we need to link it with the
EFI trigger we created in SAP. This is also done through the Configuration portal.
Step 1 - Link the Exchange Object to the EFI Trigger in the Configuration Portal
Return to the Configuration portal main page and click on the EFI Assignment link. Click
on the [Create] button.
In a real world environment, you would have the class handler retrieve data for you and then
determine what to do with the data. This has been provided for you for the purposes of this
course. Now that your exchange object and trigger assignments are created, you must assign
your exchange object to one or more MDOs. In this way, it will be part of the synchronization
process.
Working With the Change Detection Layer 125
We will use the Configuration portal to assign the exchange object to the appropriate MDO
for this exercise. In this exercise, you are modifying the MDO for EntryList, so it can use the
new exchange object you created in the previous lesson.
In the left pane, expand the Data Object Navigation Tree under the CT - Complex Table
main heading. Find your Z_GROUPXX_ENTRY_LIST, which uses your log in number
and select it.
Click the [Change] button. Locate the Exchange Object Settings section. Using the
drop-down arrow, select your newly-created exchange object from the list.
Click the [Save] button.
126 Working With the Change Detection Layer
7 Business Logic Layer - Fetches
128 Business Logic Layer - Fetches
In a previous exercise, you configured a complex table’s MDO and BAPI wrapper through the
Configuration portal. In this case, a reservation object does not use a complex table, but
rather a data table. Therefore, while we will still be configuring the MDO and BAPI wrapper
using the Configuration portal, we will be using the DO - Standard Data Object section in the
Data Object Navigation Tree when working with the mobile data object configuration.
NOTE: Replace ‘XX’ with your log in number in all places shown in the list below.
Mobile Application: Syclo SMART Mobile Suite - Inventory Manager 3.0
Mobile Data Object ID: Z_GROUPXX_RESERVATION::DO - SIM 3.0 -
Reservations
Description: SIM 3.0 - Reservations
Method Type: Get method
Active Flag: True (checked)
Click the [Save] button to save the BAPI wrapper.
Business Logic Layer - Fetches 133
In order to create the Reservation fetch in the Agentry application, you will first need to add
Java files to the source/SAPWM-5.0/src package in Eclipse. Switch to the Java
perspective in Eclipse for this portion of the tutorial.
134 Business Logic Layer - Fetches
Because we are adding on to the original functionality of the SMART application, any Java
classes we create are appended with a ‘Z’ in front of the descriptive name as a best practice.
Objects are synchronized with the back end SAP system through the module-level fetch
definitions. A fetch defines how the Server synchronizes data for a target object collection by
referencing the step definitions in order to perform this task. The fetch is processed during
synchronization between the Client and the Server, resulting in new object instances
retrieved for the target collection, replacement of existing objects within the collection, and
possible removal of objects from the collection. All of these determinations are based on the
definition of the fetch and the child step usage definitions.
In this exercise, we will create the Reservation object, fetch, step, screens, steps, and buttons
associated with the object. In a later exercise we will create two other collections to this
Reservation object, in order to make up the entire reservation fetch and have it work correctly
during the final publish and test phase.
Select Collection for the Property Type and click [Next]. Fill out the next wizard screen
as shown below. Notice that in this screen you are using the plural of reservation -
140 Business Logic Layer - Fetches
reservations. It is standard practice to always use the plural format when naming
collections in an Agentry application. Click [Finish] when done.
Normally, a MainObject includes some read steps and transactions. Those will be
included in later exercises.
Now, create an object called Z_ReservationItem under the main Objects section, like
you did in Step 1.
After creating the Z_ReservationItem object, make sure it is highlighted in Agentry, and
click the Properties tab. You are going to add a Properties collection to this object by
clicking the green plus sign icon.
Select Collection for the Property Type and click [Next] in the wizard. Then fill out the
fields as shown:
Business Logic Layer - Fetches 141
Properties pane of the application and scroll through the list until you see the Yes in the
Main? column. The main screen set is also usually called MainScreen as a best practice.
When you find MainScreen in the Screen Sets list, double-click it and start the wizard to
add a new list screen. Make the following selections. If nothing is listed for a field, leave
as-is or leave the default:
Screen Type: List Screen (click [Finish] to bring up the next screen of the wizard)
Caption: Reservations
Name: Z_Get_Reservations
Collection: Z_Reservations
Click [Next] to continue. Chose from the Available Properties and move them to the
Selected Properties in the following order:
“WorkOrders” Property
“Z_Reservations” Property
Click [Next] through the rest of the screens of the wizard, leaving the default settings
as-is. If you have questions about some of the settings, or would like to change some of
them as an experiment, talk to your instructor if time permits. Click [Finish] upon
completion to set the detail screen.
Note that because this screen was added last, it was added at the end. To move the
screen tab placement, highlight the row and use the arrow icons in the Agentry application
to move the placement up and down as desired.
Business Logic Layer - Fetches 145
Step 8 - Create the Reservation Transmit Action
Click in the Actions portion of the Agentry application and start the wizard to create a new
action. Here you are going to create a new action that ties the newly-created fetch to the
fetch screen set you created in Step 5. Type in the following selections:
Name: MaterialReservationsFetch
Display Name: Search Reservations
Group: Fetch
Click [Finish] to create the transmit action. Double-click on the newly-created transmit
action to access the details of it. Click on the Action Steps tab and start the wizard to add
a new action step. If nothing is listed below, chose the default or leave as-is. Choose the
following:
Step Type: Transmit
Step Name: MaterialReservationsFetch
Automatically start transmission: True (checked)
Click [Finish] to create the transmit action step.
Be sure you are in the Java perspective in Eclipse. You have already created Java classes
in Eclipse for the Reservation, so this exercise will not include screenshots or detailed
information. Try to add the new Java classes in Eclipse without referring back to a previous
exercise first.
The Java classes are found in the Exercise Code folder, in the Goods Movement
subfolder. Remember that all Superclasses are named starting with com.syclo.sap in
Eclipse.
In this exercise, we are creating two collections under the previously-created Reservation
object, in order to make up the entire reservation fetch and have it work correctly during the
final publish and test phase. These collections are the Issues and the Items collections.
When designing a new collection or a nested set of collections as an add-on for your standard
application, drawing a flowchart of the objects and collections beforehand may help you to
visualize the best way to design it before getting to work in Agentry.
You’ve already created a screenset and screens for a fetch in a previous exercise. Now, you
are going to create two screensets, each with separate screens. Sometimes when you are
designing a new function on top of an out-of-the-box application, it is easier to draw a flow, to
envision the design, before developing the screensets and screens. Here, you can see the
screenset and screen flow of the Reservations:
158 Business Logic Layer - Transactions
The shaded boxes in the image are not discussed in the steps, but are part of the optional
take-home advanced exercises. The Login box is the main Client log in screen of the
application and is also not discussed or built in the steps.
Step 2 - Create the Add Document Items Screen Set and Screens
Add a new Screen Set with the following properties:
Displays: Object | AddZ_MaterialDocumentsItems
Name: AddDocumentsItems
Description: Add Document Items
Click the Platform tab and add a platform. Make the following selections:
Platform: Windows CE (Pocket PC) Portrait
Caption: Reservation
Button Placement: Bottom
Navigation: True (checked)
Click [Next], then click [Finish] to add the platform to the screen set.
Click the Screens tab and add a screen with the following selections:
Screen Type: Detail Screen
Caption: Issue
Name: AddDocumentsItems_Detail_PPC
Rows: 8
Click [Next]. On the Properties screen, add the following properties from the Available
column to the Selected column, so they are in this order:
“reservationNumber” Property
“reservationItem” Property
“Plant” Property
“storageLocation” Property
“movementType” Property
“Quantity” Property
“Text” Property
“finalIssue” Property
Click [Finish] to add the new detail screen to the screen set.
Some of these properties now must be set to be read-only on the Client, so that the user
cannot modify content contained within the fields. Click on the Fields tab on the
Business Logic Layer - Transactions 161
newly-created screen. Now double-click on the reservationNumber property to display
its properties.
In the Field Definition tab, locate the Read-only checkbox and check the box (i.e., make
it true). Then click the Save icon to save your changes in Eclipse. Do this for the following
properties to make them read-only:
reservationItem
Plant
storageLocation
movementType
Click on the finalIssue property. This field will appear as a check box on the mobile
application, which you will change in the properties of the property. In the Edit Type
drop-down field, select Button and save your changes.
162 Business Logic Layer - Transactions
After the objects and properties within the objects are created, you need to create the
transactions for the objects.
Debugging Techniques
The SMART Server’s agentry.ini file contains the non-standard Java options in the
[Java-n] section. In general, this configuration option is used to pass the non-standard
options to the JVM during the load process.
Garbage Collection
Garbage collection algorithms are very specific to the application and the deployment
hardware. Therefore, the Server and the Server’s installer will never choose a garbage
collector. The correct garbage collector can only be chosen through diligent analysis of the
application and deployment. By default, the J2SE platform will choose a garbage collector if
one has not been specified. The selected garbage collector varies depending on the J2SE
platform version. J2SE platform version 1.4.2 creates the default single-threaded garbage
collector, while version 1.5 attempts to choose a collector based on hardware the application
has deployed. This is an important distinction since moving between J2SE platforms may
require garbage collection analysis.
In either version of the J2SE platform, to specify a non-default garbage collector and to
choose your own garbage collector, add it to the [Java-n] section of the agentry.ini file
as shown below:
nonStandardJavaOptions=-Xdebug
-Xrunjdwp:transport=dt_socket,address=7090,server=y,suspend=n
Visit the following sites for more information on how to choose the correct garbage collector:
http://java.sun.com/docs/hotspot/gc1.4.2/
http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html
Development Environment
A version control hierarchy consists of the following directory structure:
ProjectRootDirectory
Branding
Editor
Server
Win32
WinCE
Build
build.bat
build.properties
build.xml
buildnum.exe
temporary files not under version control
Documents
Syclo
Customer
Exports (generally only 1 AGX file in this directory)
Project
src (Java source)
Project Standards and General Staging Techniques 175
classes (compiled Java that does not need to be maintained in version control)
Releases
A new subdirectory is created each time build.bat is run. Check in only those
releases that are distributed to the customer.
Test (this directory and its children do not need to be under version control)
Server-Dev
Server-Prod
Client
Editor
Branding Folder
Contains the branding files required to produce the self-extracting archive installers. Branding
files are resources customized for the specific application. They can include things like:
*.ini files
Custom tables
External *.jar files (SAP, jCO, etc.)
Build Folder
The build folder contains the control files, build scripts, and utilities used to create releases
based on Agentry branded installer files.
Documents Folder
The documents folder contains FSRS, project plans, design documents, and other materials
used to build the project before the release.
Exports Folder
The exports folder holds the Agentry export files from the Agentry Editor. This folder generally
should only hold a single application file.
Project Folder
The project folder is the main folder for anything maintained in Eclipse. This includes Java
files, SQL scripts, and XML files. Note that compiled classes under this folder do not need to
be versioned, only the source. The classes will be recompiled at build time and saved under
the final release Server installer.
Releases Folder
Final output from the build process is written to the releases folder. This folder contains a
subdirectory for each release which contains Server, Editor, and Client installers as well as
any release documentation, Java source code, or other material relevant to the release.
176 Project Standards and General Staging Techniques
Test Folder
The test folder contains an Editor, test environment Client, Development Server, and
optionally a Production Server.
Build Environment
The build environment is a set of *.ini files, branding files, and scripts that act as metadata to
turn a generic Agentry Client, Server, or Editor installer into a particular installer for a given
Agentry product.
The build environment consists of the following components:
build.bat: Main batch file for initiating the build process
build.properties: Java properties file that controls how and what is built
buildnum.exe: Utility that generates the build number
Build Process
The basic steps of the build process are as follows:
1) Edit the build.properties file to make sure the file names and locations fit your project
and that you are using the desired test or release version of Agentry.
2) Run build.bat with a numeric parameter indicating which ‘build of the day’ you are
running. As an example, build.bat 1 would be the first build of the day.
3) The build process then:
Pulls from version control the source files it needs.
Creates Win32, WinCE, Editor, and Server installer files.
Creates a Zip file of the Java source and copies these files into a directory under
the Releases folder.
Manually checks the generated files into version control after testing.
11 Importing and Exporting Java Source Code
178 Importing and Exporting Java Source Code
Importing the Java Source Files for the Application to the Eclipse Platform
Once Eclipse is installed, you must then set up the development project that allows you to
modify, compile, and debug the Java portion of the application. The following items are a part
of the Java portion of the development project:
Java source files for the application
jCo.jar file
Agentry-level *.class files, provided with the SMART application Server in the
subdirectory Java\Syclo\Agentry. All of the *.class files in this folder are a part of
the project.
junit.jar file, provided with Eclipse
Java SDK
The SMART Production Server uses Java to perform data synchronization with the SAP
application server. The Java 2 Software Development Kit, or SDK, version 1.5 or higher, is
required for the SMART Production Server. Included in the SDK installation is the JRE, or
Java Runtime Environment. These components are already installed on your training
computer, but are mentioned here for reference.
NOTE: When installing the Agentry Editor on the same machine as the Agentry Server,
installation of Java SDK is not necessary, as the JDK is installed as part of the Editor
installation.
Importing and Exporting Java Source Code 179
ExercisePlatform
Eclipse A: Importing the Java Source Files for the Application to the
PREREQUISITE
In this procedure, you will first modify the Windows environment PATH variable, in order to
include the paths for the bin directory of the JDK and the bin directory for the JRE. After the
paths are set, the Java project is then imported into the Eclipse project set up in the previous
lesson.
NOTE: It may seem counterintuitive to not select Archive File at this step. The Archive File
option is used for importing Eclipse resources into an existing Eclipse project. Since you are
importing an entire project, you must select Existing Projects.
The Import Projects window appears.
Click the Select archive file radio button and then click the [Browse] button. Browse to
the folder containing the class projects file; your instructor will give you the path if you do
not already know it.
If you have selected an archive file containing a project(s), the project name(s) will appear
in the box below, already checked. Click [Finish] to complete the import process.
Importing and Exporting Java Source Code 183
Step 4 - Exporting a Project from Eclipse as a JAR File
You do not have to follow these steps now for this class, but you will need to export your
project from Eclipse as a JAR file at the end of class in order to complete the take-home
exercises if desired.
From the main Eclipse menu, go to File | Export. The following dialog appears:
Select JAR file and click [Next]. The following dialog appears:
184 Importing and Exporting Java Source Code
Select the option to Export all output folders for checked projects. Then, click the
[Browse] button and browse to the export destination for the JAR file. Click [Next] to
continue. The JAR Packaging Options dialog appears:
Importing and Exporting Java Source Code 185
Leave the default boxes checked and click [Next] to continue. The JAR Manifest
Specification dialog appears:
186 Importing and Exporting Java Source Code
Leave the defaults set and click [Finish]. Eclipse automatically exports and zips your
project into an archive file and stores it in the location you specified. Congratulations!