on 06-11-2014 9:40 PM
Hello,
I have a web dynpro application that has two views. The first view has an input field called 'MATNR'. The second view also has this field, but I would like to make it 'Read-Only' in this view. I cam up with a possible solution after searching SCN and the internet, but it doesn't work. Can anyone help with this problem ? My code is as follows inside the WDDOMODIFYVIEW method in the second view.
Data: lr_node TYPE REF TO if_wd_context_node.
lr_elem TYPE REF TO if_wd_context_element.
lv_bool TYPE wdy_Boolean.
lr_node = wd_context->get_child_node( NAME = PRODUCT1NODE ).
lr_elem = lr_node->get_element( index = 1 ).
lv_bool = ABAP_TRUE.
CALL METHOD lr_elem->set_attribute_property
EXPORTING
attribute_name = 'MATNR'
property = lr_elem->e_property-read_only
value = lv_bool.
Thank you,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
If you always want to keep this field 'Read Only', checking the checkbox is sufficient as you did. You need to use variable only if you want to change this property dynamically based on some condition.
Regards,
Arpit Agarwal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
To set the Input field UI element to read only, there is propery called Readonly.
1. Create an attribute Read type wdy_booelan,
2. Define context binding with the read only property to the Read attribute.
Based on the condition, write code and set the property ABAP_TRUE for non-editable and ABAP_FALSE for editable.
Thanks & Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.