Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Field symbols unassign problem

Former Member
0 Kudos

METHOD handle_data_changed.

DATA: x_change TYPE lvc_s_modi, "modified cells

l_modi_fieldname TYPE lvc_s_modi-fieldname.

FIELD-SYMBOLS <fs_fname> type any.

LOOP AT er_data_changed->mt_good_cells INTO x_change.

CONCATENATE '<fs_it_dev_list>-' x_change-fieldname INTO l_modi_fieldname.

IF <fs_fname> IS NOT ASSIGNED.

ASSIGN (l_modi_fieldname) TO <fs_fname>.

ENDIF.

<fs_fname> = x_change-value.

MODIFY g_it_dev_list FROM <fs_it_dev_list> INDEX x_change-row_id TRANSPORTING (x_change-fieldname).

ENDLOOP.

PERFORM check_light.

CALL METHOD g_grid->refresh_table_display.

========================================

using above code to handle data changed event.

run a first time, it's ok. it works perfect(but has a problem).

1st question.

but second time(edit a column ->enter-> edit another(or same) column->enter)

occurs an error

" Field symbol has not yet been assigned" at line 10 "ASSIGN (l_modi_fieldname) TO <fs_fname>." ->here

2nd question.

MODIFY g_it_dev_list FROM <fs_it_dev_list> INDEX x_change-row_id TRANSPORTING (x_change-fieldname).

=> g_it_dev_list is modified two lines, if i change 2nd row's data the 3rd row's values are changed ,too!!

plz help me..

sorry for my poor english.

2 REPLIES 2

Former Member
0 Kudos

it is solved.

Former Member
0 Kudos

Hi,

Is this a customized METHOD ?

One suggestion would be to unassign the field symbol inside the loop.

As i see it in the code below, you are assigning the field symbol

based on the information from x_change.

So before the ENDLOOP statement add this line.

UNASSIGN <fs_fname>.

I think this should solve the problem..

Happy coding ..

Regards,

SJ