ALV editable popup based on classic style REUSE_ALV_GRID_DISPLAY function module

It's easy to develop an editable popup using ALV classic style. Just instead of function module REUSE_ALV_POPUP_TO_SELECT use REUSE_ALV_GRID_DISPLAY. It can be a nice extension, when the main table is based on CL_SALV_TABLE class, which is not editable. After a double click on the selected row in the main table, you can display such popup with corresponding fields and refresh the main table after user's edition.
Don't forget to press ENTER to transfer the changed data from ALV to internal table.
REPORT zkm_test.


  BEGIN OF ls_popup,
    bname TYPE uname,
    pass(20) TYPE c,
  END OF ls_popup,
  lt_popup         LIKE TABLE OF ls_popup,
  lt_fcat          TYPE slis_t_fieldcat_alv,
  ls_fcat          TYPE slis_fieldcat_alv,
  ls_exit          TYPE slis_exit_by_user.

SELECT bname
  FROM usr02.

CLEAR ls_fcat.
ls_fcat-col_pos       = 1.
ls_fcat-fieldname     = 'BNAME'.
ls_fcat-ref_fieldname = 'BNAME'.
ls_fcat-ref_tabname   = 'USR02'.
APPEND ls_fcat TO lt_fcat.

CLEAR ls_fcat.
ls_fcat-col_pos       = 2.
ls_fcat-fieldname     = 'PASS'.
ls_fcat-lowercase     = 'X'.
ls_fcat-edit          = 'X'.
APPEND ls_fcat TO lt_fcat.

    it_fieldcat            = lt_fcat
    i_screen_start_column  = 1
    i_screen_start_line    = 1
    i_screen_end_column    = 42
    i_screen_end_line      = 10
    es_exit_caused_by_user = ls_exit
    t_outtab               = lt_popup.

IF   ls_exit-back = 'X'
  OR ls_exit-exit = 'X'
  OR ls_exit-cancel = 'X'.

  WRITE: / 'cancel'.


  LOOP AT lt_popup INTO ls_popup.
    WRITE: / ls_popup.
See other related notes in my infodepot:
ALV popup based on class CL_SALV_TABLE ALV popup based on classic style REUSE_ALV_POPUP_TO_SELECT function module
Full list of examples in my infodepot

If you have a question, have found an error or just want to contact me, please use this form.

Copyright (C) 2010

Disclaimer: I am not affiliated or related to any division or subsidiary of SAP AG.
Trademarks or registered trademarks of any products or companies referred to on this site belong to those companies.
Anyone using the given solutions, is doing it under his/her own responsibility and at own risk.