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

Update ALV table

marcelom_bovo
Participant
0 Likes
542

Hi people,

I'm with a problem in my ALV OO

I'm using a ALV with the EDIT option so the user can edit the values from the ALV.

But I'm having a problem with this. When the user change a value from the ALV the table just change IF the user pressed a button from the ALV menu or pressed the ALV with a double click.

So IF the user change a value, press ENTER and then the SAVE button on the SAP menu the value is not saved into the ALV table.

I don't want to order the user to double click the ALV everytime he wants to save his changes.

Can u help me?

Tks

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
506

Try this way


module pai input.
  save_ok = ok_code.
  clear ok_code.
  case save_ok.
    when 'EXIT'.
      perform f_exit_program.
    when 'CANC'.
      perform f_exit_program.
    when 'BACK'.
      perform f_exit_program.
    when 'SAVE'.
      perform f_save_data.
  endcase.
endmodule.                               " Pai INPUT


form f_save_data .
  data : p_index like sy-index.

  call method g_grid->check_changed_data
    importing
      e_valid = v_valid.

  if not v_valid is initial.
   " From here update your table , Your ALV table have changed data

Try this way


module pai input.
  save_ok = ok_code.
  clear ok_code.
  case save_ok.
    when 'EXIT'.
      perform f_exit_program.
    when 'CANC'.
      perform f_exit_program.
    when 'BACK'.
      perform f_exit_program.
    when 'SAVE'.
      perform f_save_data.
  endcase.
endmodule.                               " Pai INPUT


form f_save_data .
  data : p_index like sy-index.

  call method g_grid->check_changed_data
    importing
      e_valid = v_valid.

  if not v_valid is initial.
   " From here update your table , Your ALV table have changed data

2 REPLIES 2
Read only

former_member194669
Active Contributor
0 Likes
507

Try this way


module pai input.
  save_ok = ok_code.
  clear ok_code.
  case save_ok.
    when 'EXIT'.
      perform f_exit_program.
    when 'CANC'.
      perform f_exit_program.
    when 'BACK'.
      perform f_exit_program.
    when 'SAVE'.
      perform f_save_data.
  endcase.
endmodule.                               " Pai INPUT


form f_save_data .
  data : p_index like sy-index.

  call method g_grid->check_changed_data
    importing
      e_valid = v_valid.

  if not v_valid is initial.
   " From here update your table , Your ALV table have changed data

Read only

marcelom_bovo
Participant
0 Likes
506

Thanks a®s

It worked just fine.

Everytime the program passes through the method it refresh my table with the changes