10-09-2008 12:20 PM
Hi,
i am working on Module a module pool program. There is one ALV grid which is editable. It has three columns. 2 for checkbox and one input enable field. How to capture the changed internal output table.
I am using this code....
CALL METHOD W_ROGRID->CHECK_CHANGED_DATA.
I am getting runtime error after this statement is getting executed.
The error is 'Field Symbol has not yet been assigned'.
Can anyone tell me why i am getting this error.
Thnx
10-09-2008 1:00 PM
Hi mohammed,
In order to reply to your question here not in someone's else post.
You need additionally register the event. I forgot about this, sorry my fault.
"register edit events
CALL METHOD W_ROGRID->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
Now it should work.
Regards
Marcin
10-10-2008 6:29 AM
Marcian,
Please find these piece of codes....
CREATE OBJECT w_alv_event.
CALL METHOD W_ROGRID->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
SET HANDLER w_alv_event->cell_changed FOR w_rogrid.
No change in the output with this piece of code.....The method cell_changed is not getting triggered.
CREATE OBJECT w_alv_event.
SET HANDLER w_alv_event->cell_changed FOR w_rogrid.
CALL METHOD W_ROGRID->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
No change in the output with this piece of code.....The method cell_changed is not getting triggered.
I am writing the above code in PAI event.
****************************************************************
CALL METHOD W_ROGRID->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
If i call the above method in the PBO event then i am getting runtime error as soon as i click on one of the checkbox of my ALV grid.
10-10-2008 6:37 AM
the problem is with the checkbox. i am sure. show your fieldcatalog and layout code. the error is from there. are you using the layout-box_fieldname..?
10-10-2008 7:17 AM
TYPES : BEGIN OF tp_rodata,
fname(25) TYPE c,
checkbox,
fcount TYPE int4,
checkbox1,
END OF tp_rodata.
Data : t_rodata TYPE TABLE OF tp_rodata,
t_fcat_rodata TYPE lvc_t_fcat,
wa_rodata TYPE tp_rodata,
wa_fcat_rodata TYPE lvc_s_fcat.
*********************************************
REFRESH t_rodata.
wa_rodata-fname = 'Zone'.
APPEND wa_rodata TO t_rodata.
CLEAR wa_rodata.
wa_rodata-fname = 'Part Number'.
APPEND wa_rodata TO t_rodata.
CLEAR wa_rodata.
wa_rodata-fname = 'Part Number Description'.
APPEND wa_rodata TO t_rodata.
CLEAR wa_rodata.
*****************************
REFRESH t_fcat_rodata.
wa_fcat_rodata-tabname = 'T_RODATA'.
wa_fcat_rodata-fieldname = 'FNAME'.
wa_fcat_rodata-coltext = 'Fieldname'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
wa_fcat_rodata-coltext = 'Required'.
wa_fcat_rodata-checkbox = 'X'.
wa_fcat_rodata-edit = 'X'.
wa_fcat_rodata-auto_value = 'X'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
wa_fcat_rodata-coltext = 'Sequence No'.
wa_fcat_rodata-edit = 'X'.
wa_fcat_rodata-auto_value = 'X'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
wa_fcat_rodata-coltext = 'Edit'.
wa_fcat_rodata-checkbox = 'X'.
wa_fcat_rodata-edit = 'X'.
wa_fcat_rodata-auto_value = 'X'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
******************************************************
IF w_rocontainer IS INITIAL.
CREATE OBJECT w_rocontainer
EXPORTING
container_name = 'CONTAINER_INIT'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc = 0.
IF w_rogrid IS INITIAL.
CREATE OBJECT w_rogrid
EXPORTING
i_parent = w_rocontainer
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
ENDIF.
ENDIF.
ENDIF.
CALL METHOD w_rogrid->set_table_for_first_display
CHANGING
it_outtab = t_rodata
it_fieldcatalog = t_fcat_rodata
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
10-10-2008 7:19 AM
10-10-2008 7:25 AM
wa_fcat_rodata-tabname = 'T_RODATA'.
wa_fcat_rodata-fieldname = 'FNAME'.
wa_fcat_rodata-coltext = 'Fieldname'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
wa_fcat_rodata-coltext = 'Required'.
wa_fcat_rodata-checkbox = 'X'.
wa_fcat_rodata-fieldname = " ???? where is it
wa_fcat_rodata-edit = 'X'.
wa_fcat_rodata-auto_value = 'X'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
wa_fcat_rodata-coltext = 'Sequence No'.
wa_fcat_rodata-fieldname = " ???? where is it
wa_fcat_rodata-edit = 'X'.
wa_fcat_rodata-auto_value = 'X'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
wa_fcat_rodata-coltext = 'Edit'.
wa_fcat_rodata-fieldname = " ???? where is it
wa_fcat_rodata-checkbox = 'X'.
wa_fcat_rodata-edit = 'X'.
wa_fcat_rodata-auto_value = 'X'.
APPEND wa_fcat_rodata TO t_fcat_rodata.
CLEAR wa_fcat_rodata.
just mention the fieldname related to checkbox and sequence number and see how it works.
10-10-2008 7:27 AM
just go to Your Control panel which is on the top right corner . if you wish to convey some message how you resolved then post the comment when you are trying to close the thread. if you don't have anything to say just silently close the thread by marking the thread as answered.
10-09-2008 4:06 PM
>I am getting runtime error after this statement is getting executed.
>The error is 'Field Symbol has not yet been assigned'
the error is coming from the fieldcatalog. are you editing the quantity/currency fields. if you have some quantity and currency fields you have to mention some important details in the fieldcatalog.
CFIELDNAME "currency unit ex: MEINS
QFIELDNAME " Quantity unit ex: WAERS
REF_FIELD " Quanity/currency field " EX: KWMENG / NETWR
REF_TABLE " Table ex: VBAP
10-10-2008 5:59 AM
10-10-2008 6:01 AM
show your fieldcatalog population once along with your internal table defintion.
10-10-2008 8:06 AM