No Record Changes when Using Editable ALV Grid

Problem:
Pada saat checkbox dalam field ALV di-check, kemudian dilakukan action dg menekan button (user command) pada GUI Status ALV. Saat button ini di click, program harusnya menjalankan action tertentu untuk record yang checkbox-nya = ‘X’. But, nothing happened, internal table tidak ter-update. Setelah di-debug, ternyata ALV Grid tidak langsung ter-update saat editable checkbox-nya di-check.

Solution:
Tambahkan logic berikut pada user command ALV:

* to reflect the data changed into internal table
      DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new

      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.

      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid->check_changed_data.
      ENDIF.

Result:
Horai! Checkbox pada internal table ter-update.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s