cancel
Showing results for 
Search instead for 
Did you mean: 

enable / disable a button when changing users ?

Former Member
0 Kudos

hello people

I have a webdynpro component, I have a view that I have 3 buttons - delete, save, add

I have 2 users using this view,

How can I make the first user buttons to be active and on the other to be disabled ?

regards,

Daniel

Accepted Solutions (0)

Answers (3)

Answers (3)

mangesh_sonawane
Participant
0 Kudos

Hi Daniel,

first read the sy-unmae value.

Assign a attribute type wdy_boolean.

When sy-uname = "1st user"

Set the attribute abap true

else set the attribute abap_false.

Regards,

Mangesh Sonawane.

Former Member
0 Kudos

Hello Daniel,

                 Create an attribute of type wdy_boolean, Bind this attribute to the visiblity property of all the buttons which you want to make enable for user 1. Now in wddoinit, check which user has logged in accordingly write the code.

like if sy-uname = '    '.

wd_context->set_attribute( name = 'name of your wdy_boolean attribute' value = 'abap_true' for enabling.

.........

.......

wd_context->set_attribute( name = 'name of your wdy_boolean attribute' value = 'abap_false' for disabling.

Former Member
0 Kudos

your can bind visibility of button with some attribute in node.

but as per my understanding you need to activate these button for first user you can create

1.STATIC attribute in your assistance class and make it set after first user  and use this  static attribute to set attribute which you bind with button visibilty.

2. you can set MEMORY ID and use this Memory id to set attribute value .

reward if helpful.