cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a particular cell non editable

former_member226203
Active Contributor
0 Kudos

Hi,

I need to run a Zprogram 1st and after that a particular cell needs to be freezed(non editable) in the web dynpro component. Can any one kindly suggest of how In the web dynpro component, a paricular cell can be made non editable based on some condition.

Regards,

Kalyan Chakravarthi.M

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Kalyan,

Create a node in context and attribute type wdy_boolean, map this attribute to the u201Cenabled' of the input field, and set the value to "abap_true" initially.

DATA lo_nd_read_only_step2 TYPE REF TO if_wd_context_node.

DATA lo_el_read_only_step2 TYPE REF TO if_wd_context_element.

DATA ls_read_only_step2 TYPE wd_this->element_read_only_step2.

DATA lv_inp_read_only LIKE ls_read_only_step2-inp_read_only.

  • navigate from <CONTEXT> to <READ_ONLY_STEP2> via lead selection

lo_nd_read_only_step2 = wd_context->get_child_node( name = wd_this->wdctx_read_only_step2 ).

  • get element via lead selection

lo_el_read_only_step2 = lo_nd_read_only_step2->get_element( ).

lv_inp_read_only = abap_false.

  • get single attribute

lo_el_read_only_step2->set_attribute(

EXPORTING

name = `INP_READ_ONLY`

value = lv_inp_read_only ).

Reward if useful,

Regards,

Muneesh Gitta.

former_member226203
Active Contributor
0 Kudos

Hi Nithya,

Thnks for ur reply..

Actually, i have a Zprogram and after runing this program some particular cells need to be made non editable in the webdynpro component.

I am trying to achive this through a table.I am new to webedynpro. Can u tell me of how to acheive this. Can we set the cell property(non-editable) from an external program.

Plz let me know.(any sample code would be of help).

Regards,

Kalyan Chakravarthi.M

Former Member
0 Kudos

You cannot modify the Web Dynpro component from an external program. Instead, you can call your program using the SUBMIT and RETURN, and based on the result, set the property. Better thing would be to convert the program to an API and call it from your component.

You need to bind the read_only property of your table cell to a context attribute of type char01. Then, when you set the value in this attribute, the editable property will get modified accordingly. There are several threads in the forum discussing this, so you can probably search them.

Regards,

Nithya

Former Member
0 Kudos

Hello,

Firstly, can you clarify some things. Do you want to set the cell property from an external program? And what UI element are you using? Are you trying to achieve this with a table or an ALV?

Regards,

Nithya