My original code :
READ TABLE lt_fields TRANSPORTING NO FIELDS WITH KEY column_name = lv_column_name ).
INSERT ls_field INTO lt_fields INDEX sy-tabix.
ABAP CLEANER replace it with :
INSERT ls_field INTO et_fields INDEX line_index( et_fields[ column_name = lv_column_name ] ).
This occurs when the internal table et_field_tech is a sorted table.
In the original code :
If lv_column_name does not exist in et_fields, ABAP returns in sy-tabix the correct place to insert it in the table and the isert works correctly.
In the abap cleaner conversion :
if lv_column_name does not exist in et_fields, the index = 0 and this is dumping with a message like this :
when inserting rows into table, 0 was used as the row index. An index less than or equal to zero is not allowed.
My original code :
READ TABLE lt_fields TRANSPORTING NO FIELDS WITH KEY column_name = lv_column_name ).
INSERT ls_field INTO lt_fields INDEX sy-tabix.
ABAP CLEANER replace it with :
INSERT ls_field INTO et_fields INDEX line_index( et_fields[ column_name = lv_column_name ] ).
This occurs when the internal table et_field_tech is a sorted table.
In the original code :
If lv_column_name does not exist in et_fields, ABAP returns in sy-tabix the correct place to insert it in the table and the isert works correctly.
In the abap cleaner conversion :
if lv_column_name does not exist in et_fields, the index = 0 and this is dumping with a message like this :
when inserting rows into table, 0 was used as the row index. An index less than or equal to zero is not allowed.