cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a table field as read-only in a standard webdynpro component

Former Member
0 Kudos

Hi all - I am trying to make a screen table field as read-only in webdynpro component GRAC_UIBB_ACCESS_REQUEST view
V_REQUEST_ITEMS. Table N_ITEM_DATA has the field valid_from and that needs to be set as read only. I have tried below code in POST-EXIT on the method WDDOMODIFYVIEW. But it isn't working, ui_element is empty after this code is triggered. Please help, if anyone knows how to do this.

DATA : ui_element TYPE REF TO cl_wd_input_field.

ui_element ?= view->get_element( id = 'VALID_FROM' ).

ui_element->set_read_only(  abap_true ).

Thanks in advance.

Pranav

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

I think you are using the wrong id for the element. Use id = 'INPT_VALIDFROM' in your code.

I hope it helps.

Regards,

Taiyeb

Former Member
0 Kudos

Hi Taiyeb - Thanks for your reply. That did help. Now ui_element has the values but its still not make that field as read-only. I am able to change that field, but when I change the date I am getting runtime error 'Element/Node COMPONENTCONTROLLER.1.N_ITEM_DATA.1.VALID_FROM Cannot be changed'. Am I missing something here?

Thanks,

Pranav

0 Kudos

Hi,

Is the field still editable??

There is another method set_display_only in the class cl_wd_input_field.

Try using this method. Hope it will solve your problem.

Regards,

Taiyeb

Former Member
0 Kudos

Yes, the field is still editable. I couldn't find the method set_disply_only in that class. I tried set_read_only, set_display_as_text and set_enabled. Still it allows me to change the value.

Thanks,

Pranav

former_member197475
Active Contributor
0 Kudos

Hi Pranav,

Have you tried changing the field property through customization.

Hope you can try for that. Please follow the below doc and modulate to the same methodology.

BR,

RAM.

Answers (0)