What is a SyncBO?
| Defining SyncBO
Testing SyncBO
In this section, we will discuss how SyncBO can be tested.
BAPI Wrapper Check
When BAPI wrappers used by a SyncBO are defined, the interface definitions
of the BAPI wrappers are copied to the SyncBO. Therefore, when it is required
to change the SyncBO’s target backend system where BAPI wrappers reside
to another, it is necessary to validate the existence of the BAPI wrappers and
check if the interface definition of a BAPI wrapper is the same as the one defined
in the SyncBO.
If any of the BAPI wrappers for a SyncBO does not exist or the interface definition
of a BAPI wrapper is different from the one defined in the SyncBO, the SyncBO
will be disabled automatically, so that it cannot be used, until an adjustment
is made for a BAPI wrapper.
Procedure
- Start the transaction merep_sbuilder
- Choose the RFC BAPI wrapper check button from the application bar or Ctrl
+ F8
- Choose one of the radio buttons depending on which SyncBOs should be checked
- Select the Continue icon
If error(s) are detected, they are displayed on the screen.
Unit Test
Upon the completion of defining a SyncBO, the unit test should be performed
just like any software development. The unit test of a SyncBO can be conducted
using the runtime emulation tool. The emulation tool allows an application developer
to test the synchronization cycle starting from Smart Synchronization to the
BAPI wrappers in the backend system by emulating the synchronization messages
sent from a client device.
Preparation
Prior to conducting a unit test, some preparatory work is needed, which includes
the following tasks:
- Creating Mobile Group and ID
- Configuring SyncBO settings
- Running the Replicator for a download or timed 2-way SyncBO
Initial Data Download Test
This test simulates the handling of a download data request message sent from
a client device, which calls the GetList BAPI wrapper for the SyncBO. The test
can be conducted as follows:
- Start the transaction se38
- Enter the program MEREP_EMULATOR, and choose the Execute icon or F8
- Enter the SyncBO ID and Mobile ID
- Choose the Execute icon or F8
- Choose the Execute icon or F8 again
- Create a new session and start the transaction merep_mon
- Check the message status and its processing result such as viewing the Outbox
data in the Worklist Monitor
For details of how to use Worklist Monitor, click here.
Create Test
After performing the initial download test, the create test can be conducted
if a SyncBO has a Create BAPI wrapper function. The easier way is to create
a new object with modifying an existing object. The steps are as follows:
- Start the transaction se38
- Enter the program MEREP_EMULATOR, and choose the Execute icon or F8
- Enter the SyncBO ID and Mobile ID
- Choose the Action ADD button
- Select a row and choose the Copy button or Enter
- Choose Get current timestamp so that the TIMESTAMP becomes ‘000000000000000000000’
- Modify some of the TOP/ITEM field values other than the fields: SYNC_KEY,
ACTION, TIMESTAMP
- Choose the Execute icon or F8
- Create a new session and start the transaction merep_mon
- Check the message status and its processing result such as viewing the Outbox
data in the Worklist Monitor
- Check the object created in the backend system
If no object can be selected because the object does not exist in the backend
at all, the test data needs to be manually created. For more information, refer
to Step 4: Unit Test (Creating Contact) in Tutorial: Defining SyncBO Using SyncBO
Builder.
Change Test
After performing the initial download test, the change test can be conducted
if a SyncBO has a Change BAPI wrapper function. The steps are as follows:
- Start the transaction se38
- Enter the program MEREP_EMULATOR, and choose the Execute icon or F8
- Enter the SyncBO ID and Mobile ID
- Choose the Action MODIFY button
- Select a row and choose the Copy button or Enter
- Modify some of the TOP field values other than the fields: SYNC_KEY, ACTION,
TIMESTAMP
- (Optional) Modify some of the ITEM field values other than the field: SYNC_KEY
To add an ITEM instance, fill the field values in the empty ITEM column where
the ACTION field is set to ‘A’. The value of the SYNC_KEY field
can be set with setting a focus on the cell and choosing the Generate new
synckey button . If a field has a related SyncBO, choose F4 on the cell to
select an entry from the related SyncBO.To delete an existing ITEM instance,
change the value of the corresponding ACTION field to ‘D’.
- Choose the Execute icon or F8
- Create a new session and start the transaction merep_mon
- Check the message status and its processing result such as viewing the Outbox
data in the Worklist Monitor
- Check the object modified in the backend system
For details of how to use Worklist Monitor, click here.
Delete Test
After performing the initial download test, the delete test can be conducted
if a SyncBO has a Delete BAPI wrapper function.
The deletion of an ITEM instance can be tested in the change test.
The steps are as follows:
- Start the transaction se38
- Enter the program MEREP_EMULATOR, and choose the Execute icon or F8
- Enter the SyncBO ID and Mobile ID
- Choose the Action DELETE button
- Select a row and choose the Copy button or Enter
- Choose the Execute icon or F8
- Create a new session and start the transaction merep_mon
- Check the message status and its processing result such as viewing the Outbox
data in the Worklist Monitor
- Confirm that the object is deleted in the backend system
Initial Data Download Test to Client Device
Performing an initial data download from a device even without a client application
is useful. This is because it populates the local object store on the device
for the SyncBO(s), which can be used later on for testing the client application
with the data actually obtained from a backend system.