2013 Jan 24 8:33 PM
HY folks,
i'm facing an issue with an oo editable alv and a custom toolbar button.
I'm checking the value of the data changed with the handler_data_changed method when the user click on the BACK button, if the new value is not acceptable, the method add_protocol_entry method is trigger. So far , so good, But if the user click a second time, the BACK button without adjusting the value, the handler_changed_data_changed is not triggered and i can leave the screen.
How can i avoid it please?
Thank you.
2013 Jan 29 10:14 AM
Hi,
Use check_changed_data method. Before that take copy of internal table data say itab_old.
After check_changed_data method you will get new internal table data say itab_new.
When 'BACK'
if itab_old <> itab_new.
" do processing .
else .
leave screen.
Hope this helps u.,
Regards,
Kiran
HY folks,
i'm facing an issue with an oo editable alv and a custom toolbar button.
I'm checking the value of the data changed with the handler_data_changed method when the user click on the BACK button, if the new value is not acceptable, the method add_protocol_entry method is trigger. So far , so good, But if the user click a second time, the BACK button without adjusting the value, the handler_changed_data_changed is not triggered and i can leave the screen.
How can i avoid it please?
Thank you.
2013 Jan 28 4:56 PM
2013 Jan 29 10:14 AM
Hi,
Use check_changed_data method. Before that take copy of internal table data say itab_old.
After check_changed_data method you will get new internal table data say itab_new.
When 'BACK'
if itab_old <> itab_new.
" do processing .
else .
leave screen.
Hope this helps u.,
Regards,
Kiran
2013 Jan 29 11:02 AM
Hy thanx for reply, it was helpful but i'm still having the issue.
now the protocol is trigger when the user click on enter and that's is ok, but if he clickes on back, the protocol is not blocking the process and let you leave the screen.
this is my piece of code
..
call method &7->register_edit_event
exporting
i_event_id = &7->mc_evt_enter.
...
METHOD handle_data_changed_finished.
PERFORM data_changed_finished USING e_modified.
ENDMETHOD. "handle_data_changed_finished
FORM data_changed_finished USING p_modified.
DATA total TYPE zmmsa_catambperc.
LOOP AT it_zmm_st_amb INTO wa_zmm_st_amb.
total = total + wa_zmm_st_amb-zmmsa_catambperc.
ENDLOOP.
IF total > 100.
CREATE OBJECT alv_grid_pro
EXPORTING
* I_CONTAINER =
i_calling_alv = alv_grid.
CALL METHOD alv_grid_pro->add_protocol_entry
EXPORTING
i_msgid = 'NO'
i_msgno = '000'
i_msgty = 'E'
i_msgv1 = text-m03
i_msgv2 = '100'
i_fieldname = 'ZMMSA_CATAMBPERC'
i_row_id = '1'.
CALL METHOD alv_grid_pro->display_protocol( ).
ENDIF.
ENDFORM.
what do i miss?
2013 Jan 29 11:19 AM
Hi,
keep a break point in the handle_data_changed_finished method and execute. I observed that there is condition if total > 100. does this condition satisfying..? check in debugger.
Regards,
Kiran
2013 Jan 29 11:23 AM
yes the condition is ok, the add_data_protocol is called but the popup is not showing and the process not stopped.
2013 Jan 29 11:35 AM
any way i noticed that the protocol and the popup is triggered when i recall the screen.
so this is the situation.
when i clicked on back the protocol is loaded ( i can see it in debug), but not the popup, if i recall the screen, i the popup is showed.
2013 Jan 29 2:13 PM
solved my issue by moving the check in the handle_data_changed.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |