2019 Nov 04 3:40 PM
I am working on a editable ALV grid control. I have created a button for user to upload excel file. To trigger data_changed event following is coded:
DATA : lt_bad_cells TYPE lvc_t_modi,
lt_msg TYPE lvc_t_msg1.
IF go_obj->go_data_obj IS NOT BOUND.
CREATE OBJECT go_obj->go_data_obj " Error handler object reference to cl_alv_changed_data_protocol
EXPORTING
i_calling_alv = go_grid. "ALV Grid
ENDIF.
LOOP AT <fs_gt_read_table> ASSIGNING FIELD-SYMBOL(<fs_read>).
IF <fs_read> IS ASSIGNED.
MOVE-CORRESPONDING <fs_read> TO gwa_park_jou_it.
INSERT gwa_park_jou_it INTO gt_park_jou_it INDEX lv_next.
ls_mod_cell-row_id = sy-tabix.
ls_mod_cell-tabix = sy-tabix.
LOOP AT lt_fcat ASSIGNING FIELD-SYMBOL(<fcat>).
ls_mod_cell-fieldname = <fcat>-fieldname.
ASSIGN COMPONENT <fcat>-fieldname OF STRUCTURE <fs_read> TO FIELD-SYMBOL(<value>).
IF sy-subrc = 0.
ls_mod_cell-value = <value>.
INSERT ls_mod_cell INTO TABLE gt_mod_cells.
ENDIF.
ENDLOOP.
lv_next = lv_next + 1.
ENDIF.
ENDLOOP.
CALL METHOD go_grid->refresh_table_display.
CALL METHOD go_grid->if_cached_prop~set_prop
EXPORTING
propname = 'GridModified'
propvalue = '1'.
go_obj->handle_data_changed( er_data_changed = go_obj->go_data_obj
sender = go_grid ).
go_obj->go_data_obj->display_protocol( ).
The messages are added as following in various check methods
er_data_changed->add_protocol_entry( " In case of issue send error message
EXPORTING
i_msgid = text-038
i_msgno = lc_msgno
i_msgty = gc_e
i_msgv1 = text-011
i_msgv2 = lo_exe->get_text( )
i_fieldname = lv_good-fieldname
i_row_id = lv_good-row_id ).
In handle data changed method following is coded.
IF gt_mod_cells IS NOT INITIAL.
INSERT LINES OF gt_mod_cells INTO TABLE er_data_changed->mt_good_cells.
INSERT LINES OF gt_mod_cells INTO TABLE er_data_changed->mt_mod_cells.
DATA(lv_no_value) = abap_true.
REFRESH: gt_mod_cells.
ENDIF.
IF er_data_changed IS BOUND.
er_data_changed->refresh_protocol( ).
ENDIF.
All is working fine. Error messages for data validations are being displayed as POPUP as well.
The issue which I am facing is that system generates an ABAP dump when protocol box is closed.
At close of protocol box event "on_close" is triggered which tries to set_focus to calling ALV.
The value of calling ALV is blank in the method set_focus of Cl_GUI_CONTROL.
When method go_obj->go_data_obj->display_protocol( i_calling_alv = go_grid ) is called with ALV Grid reference no messages are displayed.
Go_data_obj is defined as class-data.
Any help will be really appreciated. I am just having a black out for last few days to resolve this.
If you don't analyze the short dump, you won't be able to solve the issue. Or tell us if you're stuck...
PS: Please use the CODE button to format your code so that it's shown in a more user-friendly format (colorized).
2019 Nov 04 5:34 PM
Advice you to use the CODE button to paste the code which will help us to have a better look at the issue.
Regards!
2019 Nov 04 7:41 PM
If you don't analyze the short dump, you won't be able to solve the issue. Or tell us if you're stuck...
PS: Please use the CODE button to format your code so that it's shown in a more user-friendly format (colorized).
2019 Nov 06 8:04 AM
Your question is about a short dump? If you don't give more information, it's impossible to help.
Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.
2019 Nov 06 11:53 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |