on 03-27-2007 9:44 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.