Application Development and Automation 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: 
Read only

Why F4 help is triggering data_changed event?

Former Member
0 Likes
1,844

Hi all,

I am using oops ALV and when i try to do a F4 on a editable field, it takes me to the event data_changed.

But I have not registed F4 event with the ALV. I dont want the F4 to trigger data_changed event. What do I need to do?

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,143

Hello

If you do not want to do do any pre-setting of values for the search help or post-processing (e.g. validation, update of ALV list depending on selected F4-value) then just ignore the fact that event DATA_CHANGED is raised, e.g.:


METHOD handle_data_changed.

  CHECK ( e_onf4 = abap_false ). " = ' ' (space)
  CHECK ( e_onf4_before = abap_false ).
  CHECK ( e_onf4_after = abap_false ).

  " ELSE: execute coding...
ENDMETHOD.

Regards

Uwe

Hi all,

I am using oops ALV and when i try to do a F4 on a editable field, it takes me to the event data_changed.

But I have not registed F4 event with the ALV. I dont want the F4 to trigger data_changed event. What do I need to do?

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,144

Hello

If you do not want to do do any pre-setting of values for the search help or post-processing (e.g. validation, update of ALV list depending on selected F4-value) then just ignore the fact that event DATA_CHANGED is raised, e.g.:


METHOD handle_data_changed.

  CHECK ( e_onf4 = abap_false ). " = ' ' (space)
  CHECK ( e_onf4_before = abap_false ).
  CHECK ( e_onf4_after = abap_false ).

  " ELSE: execute coding...
ENDMETHOD.

Regards

Uwe

Read only

0 Likes
1,143

That also works fine for me, but:

When the user presses 'SAVE' afterwards, I trigger the check_changed_data event. And now all other  changes, expect the f4-help row,  made by the user are gone.

So let's say the user changed 4 rows of the ALV. Afterwards, he presses the 'F4-Help' of one of the modified rows. Now your CHECK solution successfully stops the Modfication of the Database for all four entries.

However, when the user finished selecting his F4 value and presses 'SAVE' afterwards, then the database should be modified by all 4 rows. But because the data_changed event already raised as a result of the F4-help, only this row is now part of the er_data_changed->Mp_mod_rows.

So is there a solution to suppress the data_changed event after F4-Help completly?

Thanks,

Best regards