on 12-26-2018 11:40 AM
Code in main WDDOMODIFYVIEW
IF first_time EQ abap_true.
DATA lo_table TYPE REF TO cl_wd_table.
DATA lt_grp_cols TYPE
cl_wd_abstr_table_column=>tt_abstr_table_column.
DATA ls_grp_cols LIKE LINE OF lt_grp_cols.
DATA lt_cols TYPE cl_wd_table_column=>tt_table_column.
DATA ls_cols LIKE LINE OF lt_cols.
DATA lo_inp TYPE REF TO cl_wd_input_field.
DATA lv_path TYPE string.
"Get table reference
lo_table ?= view->get_element('TABLE_2'). " 'LT_IT_PA0021').
"Get Columns of table
lt_cols = lo_table->get_columns( ).
"Check if no columns found
IF lt_cols[] IS INITIAL.
"get grouped columns list
lt_grp_cols = lo_table->get_grouped_columns( ).
"collect into columns table
LOOP AT lt_grp_cols INTO ls_grp_cols.
ls_cols ?= ls_grp_cols.
APPEND ls_cols TO lt_cols.
ENDLOOP.
ENDIF.
"For each column and its editor, set the read only property
LOOP AT lt_cols INTO ls_cols.
" get the cell editor,
lo_inp ?= ls_cols->get_table_cell_editor( ). " WHERE GETTING Error
IF lo_inp IS BOUND.
lv_path = lo_inp->bound__primary_property( ).
CONCATENATE lv_path 'READ_ONLY' INTO lv_path SEPARATED BY ':'.
"bind the read_only property to the attributes property
lo_inp->bind_read_only( path = lv_path ).
ENDIF.
ENDLOOP.
ENDIF.
Before assigning lo_inp, check if cell editor is input filed or not. From above code, I believe that , this assignment might cause the said error.
lo_inp ?= ls_cols->get_table_cell_editor( ).
"not all cell editors are input fields .
BR, Krishna S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.