cancel
Showing results for 
Search instead for 
Did you mean: 

Getting user id and pass it to the BAPI

Former Member
0 Kudos

Hi,

I have requirement like this,

I have to capture the user Id and password and bind it to BAPI.

Using BAPI, i will retrive the particular expense details of that user ID.

There is no specific screens for getting user ID and password.

Now I am capturing default SAP user ID using code,

IWDClientUser clientuser = WDClientUser.getCurrentUser();

IUser user = clientuser.getSAPUser();

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

wdComponentAPI.getMessageManager().reportSuccess("user id : "+id);

Please help me with the procedure , How to get particular user id and pass it to BAPI and retrieve the details.

Regards,

Anitha

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Thanks for all reply. I got my output

Regard,

Anitha

Former Member
0 Kudos

Hi,

before executing the bapi Pass that "name" as Bapi input parameter.

Regards,

Sunaina Reddy t

Former Member
0 Kudos

Hi,

I use the following code to get SAP user id,

IWDClientUser clientuser = WDClientUser.getCurrentUser();

String name = clientuser.getSAPUser().getUniqueName().toUpperCase();

here i want to pass " name " field to BAPI.

Plz suggest me with some procedure to bind the name and pass it to the standard BAPI.

Regards,

Anitha

Former Member
0 Kudos

Hi Anitha,

That's what I am asking you for:-)

What is the purpose of your BAPI (structure of your BAPI)? Is it a standard BAPI or a custom BAPI? If a custom BAPI what is the structure of your BAPI or if it a SAP Standard BAPI, let me know about the name of the BAPI. I will have a look and will get back to you!

Regards,

Gopal.

Former Member
0 Kudos

Hi Anitha,

Are you using your custom developed BAPI or a SAP Standard BAPI. For your requirement, you need a BAPI that has a "IMPORTING" parameter as "userid" and "EXPORTING" parameters as the table with "EXPENSES DETAILS". If you have a BAPI which does meet these requirements then you can pass on the "userid" from your context of your webdynpro view to the BAPI. Let me know aboubt your BAPI, I might be able to help you in this.

I hope this helps.

Regards,

Gopal.

Former Member
0 Kudos

Hi,

in init() write the code

IWDClientUser clientuser = WDClientUser.getCurrentUser();

String name = clientuser.getSAPUser().getUniqueName();

Pass that name as Bapi input parameter.Need to add com.sap.security.api.jar file to the project.

Regards,

srikanth

Former Member
0 Kudos

user.getUniqueName()