cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter using logged in user in SAP?

Former Member
0 Kudos

Hi

I managed to pass ERP credentials via MBOs using personalisation keys from a mobile device. Now I get data that corresponds to the user. When I query with another user I get the previous use's data as well. I know it is because of sync params. How do I save the user id I pass in the output of the RFC I am calling. The RFC right now does not have user id in the return tables. But it returns user related data using Sy UNAME in the ABAP code. How should I maintain this ,mapping in CDB? Thanks.

Regards

LNV

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hallo,

if you wont to seperate the user's data between the users you coult greate seperate database files on the client for every user.

You can set the database name with this:

SUPConnectionProfile *cp = [SUP_SUP_DB getConnectionProfile];

    [cp setDatabaseName:[@"user_name"];

and check if the databse exist withe this statement:

    if(![SM4R_BFSM4R_BFDB databaseExists])

So if the user changed you create a new databse or use the database from the existing user.

So you need only to seperate the syncronised data with a personalisation key.

Best regards,

André

Former Member
0 Kudos

Thanks Andre!

Will this code work in case of dcn also ?

Assume I am sending a notification to x user and y user sometime x gets data of both.

where we have taken username as primary key.

How to fix this issue?

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Look at Query Limiting and turning it on in the MBO, under the synchronization tab of the MBO

Ian

Former Member
0 Kudos

Yeah Ian I had done that for one of the sync paramters (current date) in my MBO. The user id is passed via personalisation parameters to the RFC and the RFC does not return the user id in its output tables. Hence even if I create a sync parameter for user id, I do not have a parameter in the MBO to map to. Without this mapping I am not able to select query limiting check box. Any thoughts on how to circumvent this?

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

Is this a Workflow (HWC) app or a Native app ? If native (which platform). Also do you mean the SUP User id?

Thanks

Ian

Former Member
0 Kudos

Hi

Sorry about the delayed response. It is not a HWC. I am developing a native app (iOS) with generated code from SUP MBOs.

I am talking about the SAP user id, that I used to login to SAP ERP via connection/personalisation parameters in MBOs.

Regards

LNV

Ian_Thain
Developer Advocate
Developer Advocate
0 Kudos

LNV

Apologies if I'm getting the wrong end of the question, but cant you create a property in the .h file synthesize in the .m and set/get ?

Ian

Former Member
0 Kudos

Just to restate the problem is this:

My RFC returns user related data from ERP tables. I model MBOs on this RFC and pass the username/password required by the ERP via personalization parameters and runtime credentials (MBO). The RFC wen called reads the Sy-Uname and returns the corressponding user's data. When it comes to CDB it gets stored as is. Rmbr the RFC return (the MBO) doesnt have the userid field. Now if I call the RFC again with a different userid the CDB is populated with the second user's data as well. Now when a mobile device with user1 synchronises with the CDB it gets all the cached data (incl user2's data). To put a filter I need userid in the MBOs in CDB. Basically I need to create user partitions. How to achieve this?

Former Member
0 Kudos

Hi,

Did you get the solution for this issue?

I am facing the same issue and need help urgently.

when a mobile device with user1 synchronises with the CDB it gets all the cached data (including other user's data).

How to resolve the issue?