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: 

Unable to update Ztable data through program

Former Member
0 Kudos

Hello Guys,

I am creating a new ALV Report which need to display some dropdown columns in it. I have done this through OOPS concept without using function modules  REUSE_ALV_GRID_DISPLAY_LVC or  REUSE_ALV_GRID_DISPLAY or  REUSE_ALV_LIST_DISPLAY. The report is working fine but when I select values from dropdown columns and try to refresh the internal table data through  GET_GLOBALS_FROM_SLVC_FULLSCR but is coming Initial.

Please help me as I have to finish this ASAP.

Thank You in Advance.

1 ACCEPTED SOLUTION

Ashg1402
Contributor
0 Kudos

Hi,

If you are using ALV OOPs then why are you using this function module to refresh internal table data.?

In class CL_GUI_ALV_GRID , there is a standard method to check and get the changed data .

Call this method - CHECK_CHANGED_DATA.

Regards

Ashish

7 REPLIES 7

Ashg1402
Contributor
0 Kudos

Hi,

If you are using ALV OOPs then why are you using this function module to refresh internal table data.?

In class CL_GUI_ALV_GRID , there is a standard method to check and get the changed data .

Call this method - CHECK_CHANGED_DATA.

Regards

Ashish

Former Member
0 Kudos

Thanks for instant reply, but how to use that method when object is null. I tried and it gives dump error " Access via 'NULL' object reference not possible.".

0 Kudos

You have created an object for clas cl_gui_alv_grid, call it by that .

Where are you calling it.? Is there any button which you are pressing for refreshing the internal table.?

Former Member
0 Kudos

this is the code need to be edited.

module USER_COMMAND_0500 input.

   DATA l_selfield TYPE slis_selfield.

save_ok = ok_code.

   clear ok_code.

   case save_ok.

    WHEN 'SHIFT-F4'.

       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.

       MODIFY zqals FROM TABLE it_qals. "insert if no record found else update

       IF sy-subrc = 0.

         MESSAGE 'Data is saved' TYPE 'S'.

       ELSE.

         MESSAGE 'Error' TYPE 'E'.

       ENDIF.

endcase.

endmodule.

0 Kudos

Tell me one thing, why are you declaring a new data type ref_grid TYPE REF TO cl_gui_alv_grid.

And you are not even creating any object. What is the main object you created for displaying the table , in you PBO module.?

Call this method by that object. It will work.

Former Member
0 Kudos

Thanks Bro

You saved my life. I will require your help in future too.

Thanks Again.

0 Kudos

Sure, Happy to help