Application Development and Automation 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: 
Read only

Function module GET_GLOBALS_FROM_SLVC_FULLSCR issue

Former Member
0 Likes
3,102

Hi experts,

I am using the below code,

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

       EXPORTING

         i_callback_program      = sy-cprog

         i_callback_user_command = 'USER_COMMAND'    <--------------- for this

         i_callback_top_of_page  = 'TITLE'

         is_layout               = gd_layout

         it_fieldcat             = it_fieldcat

         i_save                  = 'X'

       TABLES

         t_outtab                = it_final

       EXCEPTIONS

         program_error           = 1

         OTHERS                  = 2.

     IF sy-subrc = 1.

       MESSAGE 'Program Error'(004) TYPE 'E'.

     ENDIF.

     REFRESH: it_fieldcat.

   ENDIF.

FORM user_command USING r_ucomm   TYPE sy-ucomm

                         sel_field TYPE slis_selfield.

   DATA: it_grid TYPE REF TO cl_gui_alv_grid,

         lv_is_valid.

   DATA: lv_flag_crt TYPE char1,

         lv_flag_chg TYPE char1.

   CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

     IMPORTING

       e_grid = it_grid.

   CALL METHOD it_grid->check_changed_data

     IMPORTING

       e_valid = lv_is_valid.

if lv_is_valid is not initial and r_ucomm = '&DATA_SAVE'.

Success message .

endif.

The problem is always i am getting lv_is_valid is 'X'. whenever the it_grid get filled lv_is_valid become 'X'.

I need only when there is a change in inputfields of report output(editable columns).  Now always i am getting success message.

Please suggest me a solution.

Thanks & regards

Venkat

1 ACCEPTED SOLUTION
Read only

former_member183069
Active Participant
0 Likes
1,550

Hi Venkat,

you need to take the data in another internal table before passing to the Reuse ALV FM, Then you have to compare the two tables. If not equal then there is a change in the output.

FORM user_command USING ucomm TYPE sy-ucomm

      slis_self  TYPE slis_selfield.

  CASE ucomm.



    WHEN '&DATA_SAVE'.

   


      IF  lt_final_1  <> lt_final.


     endif.

   endcase.

4 REPLIES 4
Read only

former_member183069
Active Participant
0 Likes
1,551

Hi Venkat,

you need to take the data in another internal table before passing to the Reuse ALV FM, Then you have to compare the two tables. If not equal then there is a change in the output.

FORM user_command USING ucomm TYPE sy-ucomm

      slis_self  TYPE slis_selfield.

  CASE ucomm.



    WHEN '&DATA_SAVE'.

   


      IF  lt_final_1  <> lt_final.


     endif.

   endcase.

Read only

0 Likes
1,550

Thanks machi......

Hope you are doing well .....

Thanks & Regards

Venkat

Read only

0 Likes
1,550

Hi Venkatram's

In your case user can only edit the field not to add the row and delete the row.

Loop at old_internal table.

read new_internal table " key field that cann't be change.

               and put the logic for the fresh value "

endloop.

Regards.

Nishant Bansal    

Read only

0 Likes
1,550

hello,

i also use this. i have one alv with checkbox column, its editable alv so when i click on check and edit that particular column changes reflected but on save button code why i called this get_global_form_slvc_fullscr. ? why does it work as i used it in if alv_r _grid is initial then

called following method . ??

kindly tell me what it is doing?