on 01-23-2014 8:20 AM
Hi Friends,
I got requirement on following ...can anybody please let me know ,How to make all the screen elements non editable if there are 20 screen elements in screen based on condition on same screen .Thanks in advance.
Regards.
santhosh
Hi Santhosh,
You can achieve you requirement as below
- Create an attribute READ_ONLY of type WDY_BOOLEAN in your context and bind it to the property READONLY of 20 ui elements
- Based on condition, set the value of attribute either to ABAP_TRUE( non editable ) or ABAP_FALSE ( editable ) by using method SET_ATTRIBUTE( )
like,....
if sy-uname = 'xyz'.
" Set ui elements as non editable
lo_ctx_element->set_attribute(
exporting
name = 'READ_ONLY'
value = abap_true ).
else.
" Set ui elements as EDITABLE
lo_ctx_element->set_attribute(
exporting
name = 'READ_ONLY'
value = abap_false ).
endif.
Hope this helps you. Let me knwo if any further assistance is required.
Regards,
Rama
Message was edited by: Ramakrishnappa Gangappa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santhosh,
Its good that your issue is resolved.
Marking replies as helpul or correct answer is very important because in future if some one has same requirements they should not be wondering here n there for a correct answer.
pls mark the replies which helped you to resolve issue as correct answer and helpful replies as helpful answer.
Hope you understood my point.
Regards,
Rama
Santhosh,
Do you wan to hide fields on SAP provided WD Component or in your custom component?
For custom component, you already have received answers from Chandra and Rama.
To enhance standard UI of SAP WDA, you need to perform some additional steps and plenty of material is already available on SCN for the same like
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create an attribute of type "WDY_BOOLEAN" in context..
Bind the Attribute with Read only Property of input field..
Now in the DOINIT method or based on condition in some action..
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_read_only TYPE wd_this->element_context-read_only.
lo_el_context = wd_context->get_element( ).
* Condition we want all ediatable..
* lv_read_only = abap_false
* Condition we want all non ediatable..
* lv_read_only = abap_true
lo_el_context->set_attribute(
name = `READ_ONLY`
value = lv_read_only ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.