cancel
Showing results for 
Search instead for 
Did you mean: 

Regd 2-Way (S01)

Former Member
0 Kudos

Hi all,

We have a requirement that each user has to get user specific data by calling getlist function with import parameter(this will vary for each device based on user input) passed to the backend. So we are thinking of using 2-way(S01). My Question is whether hether we can pass any import parameter(say dept id to get employees of that dept) other than ME-SYNC_USER in import parameter of getlist.

Thanks in advance..

Regards

Vasu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hello vasudevan,

is the user retrieving the data the sync-user?

why not use the ME-SYNC_USER value to retrieve the deptId

then use this deptId in your getlist bapi to filter your

data.

regards

jo

Former Member
0 Kudos

Hi Jo,

Assume that i have dept id. My Question is whether We can pass dept id in getlist bapi to get the data for that deptid(for that device alone). Hope you understood the question.

Regards

Vasu

kishorg
Advisor
Advisor
0 Kudos

Hi Vasudevan,

While creating the GETLIST BAPI Wrapper , we can put import parameters as

structure or a field of a structure.In that structure there must not be any include or append structures.

So in this case what we can do is that ,

1) In the R/3 side ,create one structure with two fields , that u want to put as the filter parameters in the SyncBo

2) While creating the GETLIST BAPI Wrapper , just put this Structure as the import param

3) then during syncbo creation in the import part , u can create value ids to ur filter fields.

(value id creation not allowed in the case of fields which has data type CHAR.

refer the BAPI prerequisite section in this document.

http://media.sdn.sap.com/public/html/submitted_docs/MI/MDK_2.5/content/appdev/smartsync/bapi_wrapper...

In the filter setting part , we have these limitations ,

we can set a maximum of 3 filters.

and the values of these filters are on the basis of Values , System Fields and ME fileds.

So we have to go for another option .

whats its relevance ?. explain me.. if in the above mentioned method if it is not possible, then we can try that in another way..

refer this forum also ... go through it ..

Regards

Kishor Gopinathan

Former Member
0 Kudos

hello vasu,

as Kishor had described, you can declare an import parameter

into your getlist bapi... take note however that the

getlist bapi is called during the initial data download

and if you have an installation toolkit, the data of your

application will be prepared after the application

deployment which at this time when the getlist bapi is

invoked, there's no value for this import parameter...

so in your case, you need to upload your department id

info into the MW prior to initiating your initial data

download. could you please elaborate on which timing and

form the user will send the department id from the client?

regards

jo

Former Member
0 Kudos

Hi Jo and Kishor,

Thanks for your inputs. The application will look like this. We maintain user settings where each mobile user will select the default dept id from the dept list(master data) and save it. After synchronization the employee list application should display only the employees from the dept id selected in the user settings. In MI client only employees of the default dept stored in offline for the particular user. Pls guide me on how to proceed with this requirement.

Regards

Vasu

kishorg
Advisor
Advisor
0 Kudos

Hi Vasudevan,

Let me know these things..

1) U have multiple installations for the same user ?.

2) If u do not have multiple installations for the same user , then why should u need the dep_id

also as filtering criteria?.

3) For the particular user , u have large amount of data (without the dep_id).?

4) The different users have different data for the same dep_d?

5) will u save number of dep_ids related data or only one dep_id before synchronization?.

Then ,

If u do not have large volume of data to be downloaded to the client device , based on the

user id only , then why u want to filter the data based on dep_id for each synchronization?.

This can be achieved in one way . but i havent tried like this..

Assume there is no initial data excluding the dep_id .(for dep_id , u can use different syncbo)

In this case , in ur S01 SyncBo , u have to include the CREATE and MODIFY Bapi Wrappers also.

Assume Initially u have only the dep_ids corresponding to ur user id.

Then at first time , u r going to save the particular DEP_ID for that user. Then sync..

Here ,

in the back end , ur CREATE wrapper will execute first and then the GETDETAIL Wrapper.

Here ur BAPI wrapper should work like this ,

GETLIST

-


(i assumed at a time , u have one dep_id record to save in the client device before synchronization)this should only return one row of data in the

table param. and this should be ur dep_id only.

then map this dep_id only as the key field for ur GETDETAIL BAPI Wrapper.

GETDETAIL

-


this getdetail should select the ITEM tables (data ) corresponds to the dep_id u saved.

here the key field mapped is the dep_id only.

CREATE

-


u have to follow the prerequisites for BAPI wrappers.

Here we have only one header data . this header is the table param of our GETLIST WRAPPER.

we dont have item data to create .but we have to satisfy the BAPI Wrapper prerequisites.( refer

the link i have already given in my last reply.)

the export param must be the dep_id here.. (this is also prereq..).

(After the new record creation , the frame work calls the GETDETAIL wrapper using the export parameter

of ur getlist .)

MODIFY Wrapper

-


for this sync bo , u have only one HEADER DATA( as u mentioned , u need only the the dep_id ,u have saved , related data

want to persist as the offline data on the client device . thats why..).

Then u r modifying the dep_id for the same header for each sync. so now onwards

ur modify wrapper will do ur requirement.

hope u got a general idea , what to do!!!

One more thing ,,

hope u have both the user id and dep_id as primary keys in the back end.

If all the users have same data corresponding to the dep_id . then u only have

to filter the data based on the user id.

so that , we can manage the entire data on the client device itself and u dont have to

go for the above mentioned idea. (u have to use only the GETLIST and GETDETAIL wrappers)

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi Kishor,

The main reason to go for S01 sync type is that we have large amt of data (without deptid as filter criteria).Thatz why i am checking whether each user can view the employees(after sync) based on the deptid selected in their user settings to reduce the volume of data in MI Client.Since i am going for device specific replica DB(S01), i wont be having large volume of the data in the local database.

Regards

Vasu

kishorg
Advisor
Advisor
0 Kudos

Hi Vasudevan,

So u will have large volume of data ,if ur filtering criteria is only the user id.

u have multiple installatios for the same user ?.

if u dont have multiple installations for the same user ,then

u only have to follow the steps i mentioned in my last reply.

if u have multiple installations for the same user , then ..

in addition to the above mentioned method , u will have to go for filtering based on the

mobile id also ..

just go through my last reply . i think u will get how to proceed.

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi Kishor,

Thanks for the inputs. I dont have multiple installations for the same user. I want to store the deptid in local database alone and not in the Backend. I use the deptid stored in the local database only for passing the deptid to bapi wrapper and get emp list for that user at the time of synchronization?. Is this req feasible?.

Regards

Vasu

kishorg
Advisor
Advisor
0 Kudos

Hi Vasudevan,

go through this clearly..

<<<<<

I want to store the deptid in local database alone and not in the Backend. I use the deptid stored in the local database only for passing the deptid to bapi wrapper and get emp list for that user at the time of synchronization?. Is this req feasible?.

>>>>>

Yes , this is possible.

For storing the dep_ids in your client device , u can create a SyncBo which can act like master data.

In this sync bo , u have to include only the getlist and getdetail bapi wrappers.

If the dep_ids have its additional data to display (i meant department description or data related with one dep_id), then

in ur ,

GETLIST Wrapper

-


The table parameter must be filled with the dep_ids corresponding to the particular user.

This user must exists in the MI server also . Then in ur GETLIST wrapper , u only have to

include USER_ID as the import parameter. Then for ur this syncbo , while SyncBo creation, u

have the option to create VALUE IDs . Here u have to create value ID corresponding to ur

import parameter. The value for this VALUE ID can be set later . Here default value u can set

with ME-SYNC_USER. Within the GETLIST wrapper , u have to select the dep_ids valid to this Sync User.

During sync , the ME-SYNC_USER will be filled with the Synced user. So u will get the

exact user during sync.

GETDETAIL Wrapper

-


If u have department details corrsponding to particular dep_id , then u have to put the dep_id as

key field for the GETDETAIL Wrapper.Then in the TABLE parameter, u have to populate the details

of the particular dep_id.

This information is for the SyncBO which is holding the dep_ids only..

if u dont have the department details and only the department ids then u dond have to follow above mentioned way.

then refere this forum.

i have discussed a scenario like this in this forum.

Now u have the dep_ids as master data in the client device.

Then for getting the details for particular user for paritucular dep_id ,

u have to create another SyncBo for handling this.

From the master data , u will get the dep_ids.(from the first SyncBo).

Then for getting the details related with the particular dep_ids for

particular synchronization ,

u exactly have to follow what i mentioned in my reply.

(for the second syncbo , working is like this. First u r creating one entry with one dep_id.

then sync . then for the second sync bo , if the architecture is like i mentioned , u will get thw

dep_id related data in the client device ).

for next syncs, u will be using the modification functionality for the same entry..

Regards

Kishor Gopinathan