cancel
Showing results for 
Search instead for 
Did you mean: 

User Details

Former Member
0 Kudos

Hi,

My requirement is as follows :

we are using BAPI which gives the details of expense reports .one of the input parameters for the BAPI are USERNAME(SY-UNAME) .

Once user log into the mobile ( we are develoing the application in BlackBerry) it has to give the reports for that particular user only. how can we handle username webdynpro side?

Regards,

Pavani

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi pavani,

U need to write code before executing the bapi.

IUser user=clientuser.getSAPUser();

pass "user" as input parameter to that bapi and execute the bapi.

Regards,

Sunaina Reddy t

Former Member
0 Kudos

Hi,

I am getting error while accessing this code.i added all the imports which are needed.

Regards,

Pavani

Former Member
0 Kudos

Hi,

Have you added com.sap.security.api.sda jar as a used DC in your develeopment component.

Add this jar as a used dc, build your dc and check

Hope this helps you

Regards,

Saleem

Former Member
0 Kudos

hi,

i am using following code before calling the BAPI.:

import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;

import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;

import com.sap.tc.webdynpro.services.sal.um.core.IClientUser;

IWDClientUser clientuser = WDClientUser.getCurrentUser();

IClientUser user = clientuser.getSAPUser(); ** here if i give IUser it is not accepting and giving error .

String id = user.getUniqueID().toUpperCase();

pls help me on this.

Regards,

Pavani

Former Member
0 Kudos

Hi,

TO access this api, n need to add com.sap.security.api.jar file to ur project build path.After ading adding go to source-->organize imports.

Regards,

sunaina

Former Member
0 Kudos

Hi,

Hi are you using the webdynpro DC (or) normal webdynpro project..

If you are using a develeopment component you can add com.sap.security.api.sda jar as a used dc in your project.Build the DC and check

If you are using a webdynpro project, RightClick on project>properties> java build path--> add the com.sap.security.api jar to your project and build the project and check.

Regards,

Saleem

Former Member
0 Kudos

Hi,

Check the IUserFactory class which has helpful methods.

IWDClientUser clientuser=WDClientUser.getCurrentUser();

IUser user=clientuser.getSAPUser();

And ofcourse using IUserSearchFilter class you can get all Users with same firstName and LastName.

ISearchResult searchResult = IUserFactory.searchUsers(IUserSearchFilter filter);

Regards,

Sunaina Reddy T

Former Member
0 Kudos

Hi Pavani,

Make the Authentication property of your application true so that when the user access the application should enter the username and password.

In wdInit() write the code to capture the usernamer.

try {

IWDClientUser clientuser=WDClientUser.getCurrentUser();

IUser user=clientuser.getSAPUser();

String id=user.getUniqueID().toUpperCase();

// pass this value as input to the Bapi.

}

catch(UMEException e){}

U need to add com.sap.security.api.jar file to access UME api.

Regards,

srikanth

Former Member
0 Kudos

Hi,

Do i need to write code in component controller wdinit method?

Regards,

Pavani

Former Member
0 Kudos

Yes you need to add the above code in your wdDoinit() or just before you execute the BAPI.

You should store the username in a string and assign it to the BAPI input parameter before executing the BAPI.

Regards

Raghu