cancel
Showing results for 
Search instead for 
Did you mean: 

Modify process synchronization

Private_Member_201320
Participant
0 Kudos

Hi, we want modify the process of sync. When we press the sync button, are threre any way to catch the process and execute code ? We idea is execute a call to a BAPI with JCO before the process of sync, it's posible ? Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Julian

You can capture the sync event by invoking the API SyncEvent.SYNC_STARTED, SyncEvent.SYNC_SUCCESSFUL and SyncEvent.SYNC_READY. If you are using the framework sync button, then i am afraid the scenario that you wish to achieve cannot be made possible. But if you using/built you own application which inturn has a sync button, you would be invoking the MI API SyncManager.getInstance().synchronizeWithBackend() to sync your data. What you can do is probably execute the JCO calls before invoking this API.

Best Regards

Sivakumar

Former Member
0 Kudos

just a correction, you cannot invoke SyncEvent.

you can listener to these events by implementing a <a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/me/com/sap/ip/me/api/sync/SyncEventListener.html">SyncEventListener</a>. it defines a method

actionPerformed(SyncEvent) which is called to notify the synchronization events.

if your application is a SmartSync, perhaps <a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/me/com/sap/ip/me/api/smartsync/MessageReplyObserver.html">MessageReplyObserver</a> might be

useful.

one thing that you have to consider however is that you might be able to create

another thread for synchronization once the sync has started. it will be just like

calling the synchonizeWithBackend with the same method itself. and i think there

is a locking mechanism on the current thread that will ignore any calls to this

method. but if you are considering the use of other APIs like JCO to invoke remote

ABAP FM, it might be possible.

regards

jo

Private_Member_201320
Participant
0 Kudos

Hi, thanks for your answer, it's solve my problem, but now i have new one

Is it possible to stop the synchronization ? I try with com.sap.ip.me.api.sync.SyncManager.getInstance().terminateConnection(); but doesn't work.

Thanks again.

Former Member
0 Kudos

Hi Julian,

There is no API to stop the synchronization. One thing possible is the MobileEngine.Sync.WaitForResults=x parameter, where x is a value in milliseconds. The WaitForResults parameter waits for x seconds for the server response and then disconnects.

Hope this solves your problem.

Best Regards,

Karthik

Answers (0)