cancel
Showing results for 
Search instead for 
Did you mean: 

Enable Disable Inputfield

former_member221367
Participant
0 Kudos

hi ,

I need to getting enable and disable input field on a click of button .

How can  do?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hello Ankita,

1. Create a context attribute of type  wdy_boolean with the name say "Field_enable"

2. Bind this attribute to the input field's property "enabled" in the view.

and on the action where you want to disable the inputfield just set the value of that attribute by 'ABAP_FALSE'.

Answers (5)

Answers (5)

former_member221367
Participant
0 Kudos

thanx to all of U for reply , I asked this question before two weeks . Now my problem has been resolved.

Former Member
0 Kudos

Okay Ankita. Still if there is any of reply is helping and matched to your solution then make it correct or helpful. So that anyone else having same problem can use same solution

Cheers!!

former_member184578
Active Contributor
0 Kudos

Hi,

Create an attribute say enable of type wdy_boolean in the context and bind the readOnly property of input field to the created attribute. Now in onAction of button set the attribute (enable) to abap_true/abap_false to disable/enable the input field.

Regards,

Kiran

Former Member
0 Kudos

I am assuming you have already bind the enable/disable property to a context node element.

All you need to do is set the property in the onaction method of the button.

Hope it helps

Former Member
0 Kudos

Bind the attribute 'READ ONLY' of the input field to a context attribute which is set/reset in the action handler method for your button.

Thanks

Vipin

Former Member
0 Kudos

Hi Ankita,

  You can use the following code to disable and enable the input fields.

   

     loop at screen.

     if ( )  and screen-name = 'screen field name'.

     screen-input = 0. " for disable

     screen-input = 1 ." for enable

    modify screen.

    endif.

     endloop.