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

manage alv data changed

Former Member
0 Likes
1,158

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.

1 ACCEPTED SOLUTION
Read only

Kiran_Valluru
Active Contributor
0 Likes
1,086

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

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.

7 REPLIES 7
Read only

SreekanthKrishn
Contributor
0 Likes
1,086

Hi,

Check calling register_events method.

Thanks,

Sreekanth

Read only

Kiran_Valluru
Active Contributor
0 Likes
1,087

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

Read only

0 Likes
1,086

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?

Read only

0 Likes
1,086

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

Read only

0 Likes
1,086

yes the condition is ok, the add_data_protocol is called but the popup is not showing and the process not stopped.

Read only

0 Likes
1,086

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.

Read only

0 Likes
1,086

solved my issue by moving the check in the handle_data_changed.