cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error : - Dynamic type conflict when assigning references

bhavinnayi28
Explorer
0 Kudos

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.
maheshpalavalli
Active Contributor
0 Kudos

You need to provide more information, like the error screenshot or where you are getting the error.

BR, Mahesh

Accepted Solutions (0)

Answers (1)

Answers (1)

s1252
Participant
0 Kudos

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