cancel
Showing results for 
Search instead for 
Did you mean: 

Value is displayed with Dropdownbyindex

former_member198064
Participant
0 Kudos

Hi All,

According to the selection of dropdownbyindex i need to display the input field.

For Example:

I have selected value from dropdownbyindex as 'AA'  i need to display the inputfield with disable mode.

I have selected value from dropdownbyindex as 'AB'  i need to display the inputfield with enable mode.

I have selected value from dropdownbyindex as 'Ac'  i need not to display the inputfield.

Can any one guide me how to do this.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Durga,

No need to create new attribute everytime for hiding or disabling...use the same attribute which is binded to the input field. There is one option for "Read Only" and "Disable". After that use SET_ATTRIBUTE_PROPERTY...this wil make easy and shorter...

Refer this link also..it is very good..

http://help.sap.com/saphelp_nw70/helpdata/EN/45/d44e0cdff073b1e10000000a11466f/content.htm

former_member195270
Active Participant
0 Kudos

Properties of dropdown are read only and visible.

Follow steps are below.

1. create context on the view name: dmode with cardinality 0:1

2. create attribute visible and readonly with type WDY_BOOLEANfor the context dmode.

3. bind the attribute readonly to property read only of dropdown.

4. bind the attribute visble to property visble only of dropdown.

Now you need to set the value for the attribute.

you can use one of these methods. WDDOMODIFYVIEW of view and you can create method inside control (in this case you need to call from view) and you can also create method of ONSELECT of dropdown.

better for now write your code inside method of WDDOMODIFYVIEW.

IF dropdownbyindex EQ 'AA'.

    set attribute readonly to X

    set attribute display to X

ELSEIF dropdownbyindex EQ 'AB'.

    clear attribute readonly.

    set attribute display to X.

ELSEIF dropdownbyindex EQ 'AC'.

   clear attribute display

ENDIF.

former_member198064
Participant
0 Kudos

Hi Umar,

Can you pelase provide the above details technically.

m_aravindan
Active Participant
0 Kudos

Hi Durga,

                Just find the below link from sap technical , which shows how to hide and display UI elemnts dynamically. ( In Sap technical it was about using radio button , in ur case it is  drop down).

http://www.saptechnical.com/Tutorials/WebDynproABAP/Hide/Page1.htm

watch this tutorial ..

http://scn.sap.com/blogs/webb-professor/2012/10/10/show-and-hide-ui-elements-dynamically-in-your-aba...

Reward points , if its helpful.

Regards

Aravindan.

Former Member
0 Kudos

create two  attribute  attr1 and attr2 of type WDY_BOOLEAN.

bind inputfield ENABLE property with attr1.

bind inputfield VISIBLE propery with attr2.

ONSELECT method of dropdown you get you can change these attribute (attr1 and attr2 ).

if helpful reward points