cancel
Showing results for 
Search instead for 
Did you mean: 

How to access the Synchronized data through DB2e

Former Member
0 Kudos

Hi

I have developed a SmartSync application by following the MDK.How to access the Synchronized data using the DB2e.

Thanks and Regards

Gopi

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gopi,

What do you want to do exactly? Do you want to modify the downloaded data or do you want to query it and display the results?

To access the data fields These are the classes/Interfaces you will need to use/Know

com.sap.ip.me.api.smartsync.SyncBo

com.sap.ip.me.api.smartsync.SyncBoDescriptor

com.sap.ip.me.api.smartsync.RowDescriptor

com.sap.ip.me.api.smartsync.FieldDescriptor

com.sap.ip.me.api.smartsync.Row

OK.

You will use the SyncBoDataFacade to get the SyncBo object using a SyncKey and SyncBoName (Which is the name used in merep_sbuilder to create the SyncBo and defined in the meRepMeta.xml file. With the SyncBo you can get the descriptor which is the metadata of the SyncBo and you can access all the properties of the SyncBo from it. Tehn you can get the RowDescriptor and get the Row from it and get the field values.

To query the data you have you will need to work with Jquery here is some sample code:

SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);

MeIterator iteratorSyncBos = null;

SmartSyncJQueryFactory jquery = SmartSyncRuntime.getInstance().getJQueryFactory();

RowDescriptor rd = sbd.getTopRowDescriptor();

JQueryAttribute[] jarray = new JQueryAttribute[2];

jquery[0]=jquery.createAttribute(rd.getFieldDescriptor("syncKey");

jquery[1]=jquery.createAttribute(rd.getFieldDescriptor("VBELN");

JQueryCondition jcond =jquery.createCondition( jarray[0],RelationalOperatorType.GREATER_THAN,jarray[1]

);

JQuerySortOrder jsort = jquery.createSortOrder(jarray[0]);

JQuery query = jquery.createQuery(jarray, jcond, jsort);

queryResult = dataFacade.executeQuery(query);

iteratorSyncBos = queryResult.iterator();

This code is just to give you an idea of whats involved please read through the documentation instead of copying and pasting.

Hope this helps,

Dont forget the points

-wael

Former Member
0 Kudos

Gopi, Did this information help you? If it answered your question you should try closing the thread, so others can benefit in the future.

Thanks,

Wael

Former Member
0 Kudos

Hi Wael

Thanks for the help

I was not following the sdn for couple of days thats why the late reply.

Your answer explains me how to use the MI classes and interfaces to query the data but what i want to know is that how to get the data into DB2e.As the application in the device is to be built on .NET framework.

It would be of great help if you can direct me to the documentation.I tried MDK 2.5 download from SDN but it is only having the plugin not the documentation.

Thanks and Regards

Gopi

Former Member
0 Kudos

Hi Gopi,

You need to download Netweaver Developers Studio from service.sap.com. MDK2.5 documentation is part of Studio help.

If you don't have access to service.sap.com, you can try this link

http://media.sdn.sap.com/public/html/submitted_docs/MI/MDK_2.5/

Regards,

Rahul

If this helps, don't forget to assign me points.

Former Member
0 Kudos

Hi Gopi,

In one application that im using I use JDBC to connect to the Database and create tables and store them, you could try the same with .Net connectors, the DB URL is in the MobileEngine.config file (if you have the DB installed). Also if you access the DB2Everyplace site on IBM's site you will find a developer package, once installed you can directly access the DB and access all the SyncBO data.

I hope this helps, I had no idea about the .Net as you forgot to mention it in your original question.

-wael

Former Member
0 Kudos

Hi Wael

I am not able to download the DB2 Everyplace for MI 2.5 from the Service Marketplace .when i click the link for full image download it is displaying a message "no data available.Where else can i find the file "db2e82.zip".I alread have DB2 UDB and DB2 Everyplace database.

Thanks and Regards

Gopi

Former Member
0 Kudos

Hi Gopi,

You need to purchase a license before you can download it from Service. Please contact your SAP sales person to purchase a license, and then you would be able to download it.

I believe the license is $30 or 30 Euro per Device.

-wael

Former Member
0 Kudos

Hi Wael

I might get the license in 2 days before that i would like to clarify some doubts

After installing DB2 Everyplace for MI client do we have to push the syncbo data into the client DB2 database by the procedure you described above or any other way exists.

Thanks and Regards

Gopi

Former Member
0 Kudos

Hi Gopi,

The data is "streamed" automatically into your Database if its installed, you will not have to configure or do anything extra for DB persistence.

-wael