cancel
Showing results for 
Search instead for 
Did you mean: 

Role based display of UI elements.

former_member184111
Active Contributor
0 Kudos

Hi All,

We are displaying soem WDA screens in EP based on the role of employee.

Requirment is to control ui elements properties based on role ie. there is a common inputfiled on the screen which is dsipalyed for say user1 and user2 .

User1 and user2 have diferent roles .Now for user1 this inputfield should be editable and for user2 it should be readonly.

Thanks,

Anubhav

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi,

Create an attribute of wdy_boolean type and bind it with the read only property of the UI element.

According to your requirement, set its property to abap_true (to set it read only) and abap_false(to make it editable) with the help of code wizard (ctrl + F7).

Regards

Arjun

Answers (1)

Answers (1)

vivekananthan_sellavel
Active Participant
0 Kudos

hi jain,

Refer this standerd component:

WDR_TEST_PORTAL_OBN_WS

It might be usefull.

Regards

Vivekananthan.S

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> hi jain,

> Refer this standerd component:

> WDR_TEST_PORTAL_OBN_WS

> It might be usefull.

> Regards

> Vivekananthan.S

Don't bother. It won't as it has nothing to do with the question at hand. Before suggesting that a sampel application might be helpful, it might be useful to see if has more in common than just part of the name.

The suggestion that you received to control the properties of the UI elements via context binding is the correct approach. You can't easily read the Portal Roles from ABAP however. You should probably rely on local authorization objects instead. You can call authorization checks from ABAP and check the return code. Use the pass/fail of the authorization check to set the context attributes that control the properites of your UI elements.

former_member184111
Active Contributor
0 Kudos

Hi Thomas / Arjun,

I will try the solution and update the thread.

Thanks a lot,

Anubhav