‎2007 Apr 15 8:08 PM
Hi All
I'm writing an ALV report to do table maintenance of a Z table.
I've used bits of BCALV03 & 04 and other BCALVs.
I can add new lines and edit fields in the report screen.
I have build F4 to get possible values into my screen fields.
<b>My problem is if I find errors in the form Combi_check and the last
change to a field was made via F4 my Log-protocol is not shown.
If my last change to a field before Combi_check was done manuelly
my Log-protocol is shown OK.
What are I doing wrong ?</b>
I'm using
handle_data_changed
for event data_changed of cl_gui_alv_grid
importing er_data_changed.
method handle_data_changed.
data: ls_good type lvc_s_modi.
loop at er_data_changed->mt_good_cells into ls_good.
perform combi_check
if lv_error ne space.
Create Error-protocol
loop at it_error_tab into wa_error_tab.
if not wa_error_tab-error eq space.
CALL METHOD er_data_changed->add_protocol_entry
EXPORTING
i_msgid = '0K'
i_msgno = '000'
i_msgty = 'E'
i_msgv1 = wa_error_tab-txt
i_fieldname = wa_error_tab-fieldname
i_row_id = ls_good-row_id.
endif.
endloop.
clear it_error_tab[].
clear lv_error.
endloop.
LOOP AT er_data_changed->mt_deleted_rows INTO ls_delete.
Endloop.
endmethod. "handle_data_changed
Best regards
Svend Frederiksen
Frederiksen IT Consulting ApS
ABAP Developer / DK
‎2007 Apr 15 8:12 PM
‎2007 Apr 15 8:12 PM
‎2007 Apr 15 8:41 PM
If I use F4 and dobbelt click on the entry in the F4-popup window and after the value is updated in the field on screen - then ENTER - my protocol is not shown.
If I instead manuelly enter the value in the field - then ENTER - my protocol is shown.
Best regards
Svend Frederiksen
‎2007 Apr 15 9:06 PM
Hello Svend
As Rich has already implied the DATA_CHANGED event is not yet raised when you call a search help on the ALV list. However, the event will should be raised after hitting the ENTER button which causes the dynpro to run into PAI where you, most likely, call method go_grid->check_changed_data.
If you want to validate the values selected from a search help then you need to define a handler for event <b>ON_F4</b>. In addition, you need to call method <b>go_grid->register_f4_for_fields</b> (for more details see sample report <b>BCALV_TEST_GRID_F4_HELP</b>).
Regards
Uwe