cancel
Showing results for 
Search instead for 
Did you mean: 

Help with understanding api for mobile

Former Member
0 Kudos

Hi, Does anyone have any good examples or documentation on calling wrappers and getting the data back. The online documentation doesn't really help, basically I can call the wrapper function now but can't for the life of me figure how to get the data back. Does the class trigger calling a process event? Any help with the basics of calling the wrapper functions and getting the data back would be awesome

Cheers,

Devlin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Wael,

Thanks the environment, we are using Mobile 2.5 and I was doing it through NetWeaver Mobile straight Jsp's with source etc. Basically I created a wraper and was able to call the code but curious how I get the data back from R3

Thanks Wael

Cheers,

Devlin

Former Member
0 Kudos

Hi Devlin,

I would like to know is your application a smart sync application? What sp level is your MI Server. Are you using a database (DB2E) or a file system. What kind of SyncBo's are you using if smart sync?

-wael

kishorg
Advisor
Advisor
0 Kudos

helloo,

i have created a smart sync project.(sync bo type 2-way).

im using MI 2.5 sp 9.

using file system..

but the problem is similar to that of Devlin.

i dont have proper help regarding this..

i can create application in NW DStudio. but the problem is, i dont have the exact flow of data.. how can i manipulate that data. is there any help regarding this ?. or any examples?.

which api i should use to manipulate data?.

is there any help regarding the api ..?

from one application i could realise that,, there are the main classes ..

<jsp:useBean id="ct"

class="com.sap.mbs.core.api.Context" scope="request"/>

<jsp:useBean id="helper"

class="com.sap.mbs.core.web.ViewHelper" scope="request"/>

<jsp:useBean id="res"

class="com.sap.ip.me.api.services.MEResourceBundle" scope="session"/>

which are using in the application..

can any one help me ?. please help me. how can i access (dispaly) that mapped fields(at the time of syncbo creation) in the client application ..?

if VBELN, field1 , eg .. these are my mapped fields , how can i access these fields in client side..?

what should i do to access the data from these fields ?..

regards

kishor

Former Member
0 Kudos

Hi Devlin,

You havent answered me with your specifics so Im going to give you the same intro I gave the other person asking the same question.

First things first, upgrade your environment to SP13 you are going to have to do it eventually anyways.

When you create a SmartSync application in sp9 the Developer Studio generates most of the initial code for you. In Sp13 it creates a simple application that displays the defined (Existing SyncBos) and when you click on them you are then forwarded to the instances of the SyncBO (the data). At this point you are using File/IO for persistence and the generated application used Query to return all instances. The files in your project are "Constants/TabelContentProvider/Controller/SmartSyncDBAccess/TableViewBean" They are divided into 3 different packages depending on role.

In simple terms what happens is that the controller handles the eventing from the UI, then it calls the TableContentProvider which simply builds vectors of the data to be displayed accessing the data from "SmartSyncDBAccess" which is where the peresistence is queried. TableViewBean is your bean that the JSP Page retrieves data from.

You are given the appropriate API in your help contents inside your NWDS. The approproate API is given for each SP level. There have been major changes in SP10 and finally in SP13 to the API. So you being at SP9 I recommend you move to SP13 as the performance is much better and alot of the api is deprecated and new APIs are available.

The classes/Interfaces you will need to use/Know are

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.

I recommend you read the API a little closer, or look at the generated code. Once you upgraded let me know and I will show you how to use JQuery with the DB, because its not very well documented.(not at all)

example..

SyncBoDescriptor sbd = sb.getSyncBoDescriptor();

RowDescriptor trd = sbd.getTopRowDescriptor();

FieldDescriptor fd = trd.getFieldDescriptor(headerFieldName);

IF any of this helps rewards me.

Thanks,

Wael

Former Member
0 Kudos

Isn't SyncBo much harder to use than generic?

Former Member
0 Kudos

Hi Devlin!

Since this topic has been marked as answered,could you pl open up a new topic.

Any have,

SmartSync & Generic Sync both has certain advantages.You decide on it based on your application requirement(Online OR Offline) and you perform different steps to call the BAPI Wrappers(Create Methods for Generic Sync & SyncBo for Smart Sync) and then code your MI Application accordingly.With Generic Sync you may have to write your Own Java Code to create the WAR file and with Smart Sync you use the generated XML file to create your WAR file.

I am not sure in what context you are asking "Isn't SyncBo much harder to use than generic?".

Thx

Gisk

Answers (2)

Answers (2)

Former Member
0 Kudos

Wael,

Thanks so much, where can I reward you points as the buttons are not on the side?

Former Member
0 Kudos

Let me know Devlin how things develop with you, like I said once you install the DB DB2E I will give you api help on how to query

In regards to the rewards:

There should be some stars under my name in each posting that I made in your thread.

It should ask something like "Did he answer your question?"

-wael

Former Member
0 Kudos

Hi Develin,

I would be more than happy to walk you through what you need to do on the client side. first could you please describe your environment? What are you trying to accomplish? I will then tell you which API to use.

-Wael