cancel
Showing results for 
Search instead for 
Did you mean: 

How to change attribute "read_only" of a inputfield in a table?

Former Member
0 Kudos

Hi, experts,

action:

1.Create a table with name " A_TABLE" in the layout in a view.

2.Binding some fields from a structure to the table.

3.Field "Checkbox" is a checkbox type and field "input" is a inputfield type with readonly in the table "A_TABLE" .

4.I hope: When selecting a checkbox in the "Checkbox" colume in a row in the table, the field "input" corresponding will be changed readonly.

The follow is my code: When select Field "Checkbox" , the method is invoked.

method ONACTIONCLICK4DISDESC .

data view type ref to if_wd_view.

DATA input_desc TYPE REF TO CL_WD_INPUT_FIELD.

data tab type if_BIDDING_LIST_VIEW=>elements_ONSURVEY.

data struct type if_BIDDING_LIST_VIEW=>element_ONSURVEY.

  • I have set "wd_this->m_view = view" in the method wddomodify and add m_view to the attribute of the

  • "viewBIDDING_LIST_VIEW" .

view ?= wd_this->m_view.

input_desc ?= view->GET_ELEMENT( `TABLE_INPUT_EDITOR` ).

input_desc->SET_READ_ONLY( EXPORTING value = abap_false ).

endmethod.

result:

when I select a checkbox in the "Checkbox" colume in a row in the table, all field "input" is read and write.

How can I do it ?

Best regards,

tao

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hello Wang,

You need to bind the readOnly attribute of the input field to a newly to created attribute beneath the dataSource node of the table within the context. That way, each input field of each row of the table can have a different value for readOnly.

Best regards,

Thomas

Answers (0)