Skip to Content
author's profile photo Former Member
Former Member

How to disable INPUT field in Webdynpro Abap based on some Action.?

I have a Webdynpro screen, where all INPUT fields are displayed in Enabled mode. Based on the user Action condition, some of the INPUT fields needs to be DISABLED (Not Invisible). How to achieve it?

Thanks,

Padma

Edited by: Padmashree RamMaghenthar on Sep 10, 2009 6:29 PM

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2009 at 05:11 AM

    Hi,

    create a context attribute of type wdy_boolean. now bind the visibility property of the input field with this attribute.

    wherever you want to make it disabled just set the attribute value as ' '. it will diable i.e make your input field invisible.

    regards,

    anand

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2009 at 05:36 AM

    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.

    3. initialize this variable to abap_true in the wddoinit of the controller or view with the following code

    DATA lo_el_context TYPE REF TO if_wd_context_element.

    DATA ls_context TYPE wd_this->element_context.

    DATA lv_field_enable TYPE wd_this->element_context-field_enable.

    • get element via lead selection

    lo_el_context = wd_context->get_element( ).

    • fill attribute

    lv_field_enable = abap_true.

    • set single attribute

    lo_el_context->set_attribute(

    name = `FIELD_ENABLE`

    value = lv_field_enable ).

    4. select the action on which you need to disable the fields and write the following code

    • get element via lead selection

    lo_el_context = wd_context->get_element( ).

    • fill attribute

    lv_field_enable = abap_false.

    • set single attribute

    lo_el_context->set_attribute(

    name = `FIELD_ENABLE`

    value = lv_field_enable ).

    5. If you want to make it invisible or visible use the above method with the view element property visible instead of "enabled"

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 10, 2009 at 01:23 PM

    Hi,

    Create a context attribute of type WDY_Boolean and bind it with the read only property of your input field. When You want to disable it, Set this attribute as true.

    I Hope it helps.

    Regards,

    Rohit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2009 at 04:22 AM

    Hi,

    Bind the enable property of the Input field to the Attribute of type Boolean.

    Now when u want the input field enable then set the attribute's value as 'X'.

    otherwise set its value as ' '.

    Regards,

    Pankaj Aggarwal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 14, 2009 at 04:25 AM

    Thanks. Thread Closed.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.