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: 

change the data in fieldcat and update the database table in alv oops

Former Member
0 Kudos
153

Hi,

my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..

this has to be done using alv oops...

1 ACCEPTED SOLUTION

I355602
Product and Topic Expert
Product and Topic Expert
0 Kudos
81

Hi,

This code will reflect all the changes into the internal table that is being displayed.


* 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.

Now after this code is executed the internal table is modified as per the changes done in alv output.

Now you can use this internal table to update the database table.

Hope this helps you.

Regards,

Tarun

2 REPLIES 2

I355602
Product and Topic Expert
Product and Topic Expert
0 Kudos
82

Hi,

This code will reflect all the changes into the internal table that is being displayed.


* 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.

Now after this code is executed the internal table is modified as per the changes done in alv output.

Now you can use this internal table to update the database table.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos
81

THANK U