cancel
Showing results for 
Search instead for 
Did you mean: 

Bind user Id to the context

Former Member
0 Kudos

Hi,

I have requirement like this,

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 parameters.

Before passing this name to BAPI,

I have some doubts,

How should I bind this name to the view contest and then to the component controller context.

Plz help me with this issue.

Regard,

Anitha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

1.Create an attribute X in view context.

2.Create an attribute Y in controller context.

3.Do a context mapping of X->Y

4.Not set X with the 'name'.

5.Now your Y will also contain the same name.#

Hope this helps,

Ashok D

Answers (3)

Answers (3)

Former Member
0 Kudos

Create a Value attribute in the component controller which is the type of String.

Map to view controller in the data moduler view - bind to text view in the layout of that component view.

what ever the value you will get in the name set to the created attribute.

weContext.CurrentContext Element.set<attribute name>(name);,

Cheers,

Appa

Former Member
0 Kudos

Hi,

You can create a value attribute "loggedInUser" in component controller and bind it to the view context.

If u have written this code in view you can set this value as shown below.

wdContext.CurrentContextElement().setLoggedInUser(name);

This context attribute canl be accessed in controller as well..

Hope this helps you..

Regards,

Saleem

former_member192434
Active Contributor
0 Kudos

Hi

First you need to bind it to component controller context, by creating a context attributes and then setting up the String value to attributes.

once u done with setting up the value to attr. then map component controller context to View context by draging and droping the node.

Thanks