cancel
Showing results for 
Search instead for 
Did you mean: 

how to make field Editable or not editable

Former Member
0 Kudos

Hi,

I have requierment that on my screen there are three buttons like change display update .when user open the link and enter the value then first he will display the details on based on one imput field and other will come in non editable mode and when user click on change then all fields become editable .

I am facing the problem how to achieve the editable or non editable .

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Shilpi,

You can make a field editable or uneditable by checking or unchecking the ENABLE button in the field(UIELEMENT).

If enable button is checked means ABAP_TRUE, then it is enabled and if the

enable button is unchecked means ABAP_FALSE, then it is non editable.

If you want to make them editable and non editable based on the condition then map the ENABLE property of the field to a attribute( in the Context) of type wdy_boolean.

when you want to make it EDITABLE make the attribute value to '1' or ABAP_TRUE or

if you want to make it NON_EDITABLE make the attribute value to '0' or ABAP_FALSE.

Regards

Madhu

Former Member
0 Kudos

Hi,

To make fields editable and non editable

1.Intially create the node say you want to input fields and so create two attributes of type wdy_boolean

readonly1 and readonly2.

2.Bind the read only attributes of the two input fields to these context elements.

3.as you said you have three buttons like create , change , display . in each button actions you need to set the read only properties on the input field. for eg when clicked on the display button if you want that field to be in display option then in display button eventmethod . set the attribute of the input field say if u want 2nd input field to be in read only then u can

lo_el_field1->set_attribute(

exporting

field = 'The attribute name '

value = abap_false (false if you want it as read only and true if you want it as input enabled).

Have A Nice Day !

Regards,

Sana.

Former Member
0 Kudos

Hello,

You can create an attribute of type WDY_BOOLEAN in the context node (editable for example) and then bind this one with the readOnly attribute of every field that you want to be open/close to edition.

When you click in the button, set this attribute to ABAP_TRUE if you want that the fields must be read only or space to edit them.

For more information take a look at these links:

/people/roger.sainsbury/blog/2008/02/01/practical-tips-for-developing-with-abap-webdynpro

http://help.sap.com/saphelp_nw04s/helpdata/en/45/d44e0cdff073b1e10000000a11466f/content.htm

Regards.