on 05-27-2011 1:08 PM
Hi Gurus,
I have created a drop down box dynamically with fixed values using add_parameter_field. Now i want is when user selects particular value from the drop down box few fields should be disabled on the screen. Can you please help how to do this. i have added the code below
l_defdate_range-key = '1'."'01DAY'.
l_defdate_range-value = 'Yesterday'.
APPEND l_defdate_range TO lt_defdate_range.
l_defdate_range-key = '2'."'15DAY'.
l_defdate_range-value = 'Since 15 Days'.
APPEND l_defdate_range TO lt_defdate_range.
l_defdate_range-key = '3'."'30DAY'.
l_defdate_range-value = 'Since 30 Days'.
APPEND l_defdate_range TO lt_defdate_range.
l_defdate_range-key = '4'."'MONTH'.
l_defdate_range-value = 'Last Month'.
APPEND l_defdate_range TO lt_defdate_range.
*--Default date range
wd_this->m_handler->add_parameter_field(
i_id = 'P_DEF_DT_RANGE'
i_description = 'Default date range'
it_value_set = lt_defdate_range
i_as_dropdown = abap_true
i_within_block = 'DATES'
i_value = l_value ).
Thanks in advance
Hi vickyachu2004
First bind an attribute ( of wdy_boolean type) to enable property of all fields ( which u want to disable ) on screen.
now use the conditiona validation.
For expample if dropdown value is equal to 1000
then
set above attribute to invisible ( 02 ).
Hope u understand the above logic. if not pls reply back with quiries
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI kris,
Your answer is very helpful and it even works. But my problem is slight different. You code works when i select the value and press enter key. But what i want it as soon as user selects the value from the drop down it should disable the fields.
Thaks for your reply
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vicky,
Create one attribute of type WDY_BOOLEAN and bind these fields to enable property of those fields which youw ant to disable.
Go to OnSelect Event of drop down write code.
First get the value selected from drop down. like..
DATA : lv_dropdown type string . // To store drop down value. you can take type as you required
get all declared attributes
lo_el_segment1->get_static_attributes(
IMPORTING
static_attributes = ls_segment1 ).
lv_dropdown = ls_segment1-segment. // Now dropdown value is in lv_dropdown.
if lv_dropdown = 1.
set single attribute
lo_el_input->set_attribute(
name = `SHIP_POINT` // your Attribute name
value =ABAP_FALSE ).
Endif.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1. Get a global reference of the View Interface via WDDOMODIFY view and write it to a global attribute
2. Downcast the UI-Tree for the UI-element you want to alter
3. make an instance for the WDUI-Type you want to alter (type ref to cl_wd_<xxx>)
4. use the respective method to alter the UI-element according to your needs
regards, Lukas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.