Application Development 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: 

REUSE_ALV_GRID_DISPLAY save data

alberto_colonna
Participant
0 Kudos

Hi,

I use REUSE_ALV_GRID_DISPLAY to display a database-table as an ALV-GRID.

I made some cells of the ALV editable by using a fieldcatalog.

Now it should be possible to update the data of the database-table with the data of

the ALV-GRID.

Can you help me?

Best regards & Thanks in advance

1 REPLY 1

former_member194669
Active Contributor
0 Kudos

Hi,

In your user_command form


    call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        it_fieldcat                 = i_fieldcat[]
        is_layout                   = pt_grplayout2
        i_callback_program          = 'YATTU0007'
        i_callback_html_top_of_page = p_header
        i_callback_user_command     = 'USER_COMMAND'
        it_events                   = i_events[]
      tables
        t_outtab                    = i_yatthdr.

In user_command form


*&---------------------------------------------------------------------*
* Form  user_command                                                   *
*&---------------------------------------------------------------------*
* This form will handle the user command from fm REUSE                 *
*----------------------------------------------------------------------*
form user_command using p_ucomm type sy-ucomm
                     rs_selfield type  slis_selfield.

  data p_ref1 type ref to cl_gui_alv_grid.
  call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    importing
      e_grid = p_ref1.
  call method p_ref1->check_changed_data.
  case p_ucomm.
    when '&DATA_SAVE'.
   " WRITE YOUR CODE FOR SAVE

  endcase.
  rs_selfield-refresh = c_x.             " Grid refresh

endform.                                 " User_command
*