cancel
Showing results for 
Search instead for 
Did you mean: 

Close and open field when antion with Dropdown in Webdynpro

Former Member
0 Kudos

How can i change field ,that above on a picture(MA02)(to open or close) when click on dropdown menu(only one field, not column) ?And if i have more than one dropdown menu in column, I can change first , but another will not change.

on picture below i must leave this field open(maybe changeable) and other three fields(material..,direct labour and direct material - closed).

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If it is a normal table,create one attribute of type WDY_BOOLEAN and bind that attribute to readOnly property of column manufacturing over head.

For that DROPDOWN column, create an action in onSelect event.

Now read the value of dropdown and if value is not initial, set the boolean attribute value as ' '(EDITABLE) , 'X'(for non-editable).

Hope this helps you.

Thanks

KH

Former Member
0 Kudos

When did this it not close my field.

DATA lo_nd_cost_variant TYPE REF TO if_wd_context_node.

     DATA lo_el_cost_variant TYPE REF TO if_wd_context_element.
     DATA ls_cost_variant TYPE wd_this->Element_cost_variant.
     DATA lv_costvar TYPE wd_this->Element_cost_variant-costvar.
     DATA lv_change type wd_this->Element_cost_variant-change.
     DATA lv_manufact TYPE wd_this->Element_cost_variant-manufact.
*   navigate from <CONTEXT> to <COST_VARIANT> via lead selection
     lo_nd_cost_variant = wd_context->get_child_node( name = wd_this->wdctx_cost_variant ).

*   @TODO handle non existant child
*   IF lo_nd_cost_variant IS INITIAL.
*   ENDIF.

*   get element via lead selection
     lo_el_cost_variant = lo_nd_cost_variant->get_element( ).
*   @TODO handle not set lead selection
     IF lo_el_cost_variant IS INITIAL.
     ENDIF.

*   get single attribute
     lo_el_cost_variant->get_attribute(
       EXPORTING
         name `COSTVAR`
       IMPORTING
         value = lv_costvar ).

  lo_el_cost_variant->get_attribute(
       EXPORTING
         name `CHANGE`
       IMPORTING
         value = lv_change ).
     IF lv_costvar is not INITIAL.
  lv_change = ' '.
  else .
    lv_change = 'X'.
    ENDIF.


INn debugger it see X, or ' ', but it didnt work.Create Boolean set into readOnly, bind all that you said, but i thought i forgot something. Sry i teach all this for myself now and sometimes I am confused in simple task like this. I can show you Context or something else from this task.

Former Member
0 Kudos

Hi,

You should use set_attribute( ) after if condition.

I.e

lo_el_cost_variant->set_attribute(   name `CHANGE`  value = lv_change ).

Hope this will help you.

Thanks

KH

Former Member
0 Kudos

thanks for Your help!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Is that a normal table or ALV table?

Former Member
0 Kudos

it's normal table

Former Member
0 Kudos

Revert with your observations / queries if you still unable to resolve as per by below thread.

Thanks

KH

JoseMunoz
Active Participant
0 Kudos

Hi,

You have to bind the property read only of the fields depending on your requirements(action made).

If you have a look to the following document you will find the solution:

Regards