cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Input-Fields read-only programmatically

Former Member
0 Kudos

Hey guys,

i have a form regarding a context node and two buttons (bn_edit, bn_save). The init is:

- fields are read-only

- bn_edit is enabled

- bn_save disabled

now if the user klicks the button bn_init i want to switch to:

- fields are writeable

- bn_edit is disabled

- bn_save enabled

and vice versa when the user clicks bn_save.

I searched a lot but couldn't find the solution jet.

Can you guys please help me?

Best regards

Philipp

P.S.: I tried to create a context node and link the particular properties of the elements to this context node, but it had no effect.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Take a context attribute of type wdy_boolean. And bind this with the Input field Read only property and set the value of this attribute as ABAP_TRUE, ABAP_FALSE on the user action.

Do the same on the button property enable.

Hope it helps.

Answers (3)

Answers (3)

Former Member
0 Kudos

Ahhh ... i tried it this way, but not by using ABAP_TRUE and FALSE.

Thank you guys! That was really good and quick!

Best regards

Philipp

Former Member
0 Kudos

Hi Philipp.

go through this fourm.

Hope this will help you,

Thanks & Regards,

Arvind

Former Member
0 Kudos

Hi,

Create the attribute with a type Boolean and bind it to the enable and readonly properties of the UI. Set the value to ABAP_TRUE and ABAP_FALSE according to the condition.

- Saravanan K