on 03-31-2015 2:34 AM
Hello Experts,
In standard SAP's WD component, I need to make a field (in this case its LONG TEXT of type TEXT EDIT UI element) ReadOnly dynamically, meaning, for User_1 make the LONG TEXT field as ReadOnly and if its User_2 then make the same UI element as editable.
Already the UI element's ReadOnly property is bound with the VIEW's CONTEXT's ATTRIBUTE (in this case its LONGTEXT attribute again).
FYI: This VIEW's CONTEXT is mapped with the COMPONENT CONTROLLER's CONTEXT.
And the UI element's VALUE property also bound w/ the same LONGTEXT attribute from the context.
Pls. check the below JPEG pic. by clicking it (also attached as file) and let us know how can we make ReadOny for User_1 and editable for User_2?
Hi ,
IF read only field is already used then check whether that attribute is used only for the require fields or any other fields also , If it used for only the required fields you can reuse the same attribute or else you can create one more same kind of attribute and control the property Enabled (Since read only property is already utilized).
- Gowtham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a Post-Exit enhancement in your WDDOMODIFYVIEW.
Now check the logic w.r.t user.
If lv_user = 'User_1'.
{
* set single attribute
lo_el_context->set_attribute_property(
EXPORTING
attribute_name = `LONGTEXT` " Attribute Name
property = 3 " Property (See E_PROPERTY-*)
value = abap_true " Replacement for Real Boolean Type: 'X' == True '' == False
).
elseif lv_user = 'User_2'.
* set single attribute
lo_el_context->set_attribute_property(
EXPORTING
attribute_name = `LONGTEXT` " Attribute Name
property = 3 " Property (See E_PROPERTY-*)
value = abap_false " Replacement for Real Boolean Type: 'X' == True '' == False
).
Try it out
BR,
RAM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
create another attribute with char1 in the view context. bind that to the read only property of the ui elemnet. in modify method set the attribute with X or space as you need
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 | |
9 | |
9 | |
9 | |
6 | |
6 | |
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.