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

Reg: ALV Problem

Former Member
0 Likes
632

Hi Experts,

I have developed a ALV program using "REUSE_ALV_GRID_DISPLAY" function module that will give edit option for particular fields and user will edit the fields and save the entry, then it will reflect in the database table.

Problem is: when i changed any entry in the ALV output, if i save directly after edition it is not getting reflected in the internal table but if i double click the entry then it is getting reflected in the internal table.

i found some forums like "need to refresh the ALV" , i have done using

selfield-refresh = 'X'.

selfield-col_stable = 'X'.

selfield-row_stable = 'X'.

but it is not reflected,

Can anyone guied me how to acheive the result.

Expected result: After changed any entry, if i save the entry without double clicking, it should get reflected in the internal table.

Thanks in advance

Vijay.R

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
580

Hi Vijay,

Use this in Interactive section even if you are doing simple ALV.

DATA:

lv_ref_grid TYPE REF TO cl_gui_alv_grid.

CLEAR : gv_tcode.

*-- to ensure that only new processed data is displayed

IF lv_ref_grid IS INITIAL.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = lv_ref_grid.

ENDIF.

IF NOT lv_ref_grid IS INITIAL.

CALL METHOD lv_ref_grid->check_changed_data.

ENDIF.

THis will solve your problem.

Regards,

Vijay

4 REPLIES 4
Read only

Former Member
0 Likes
581

Hi Vijay,

Use this in Interactive section even if you are doing simple ALV.

DATA:

lv_ref_grid TYPE REF TO cl_gui_alv_grid.

CLEAR : gv_tcode.

*-- to ensure that only new processed data is displayed

IF lv_ref_grid IS INITIAL.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = lv_ref_grid.

ENDIF.

IF NOT lv_ref_grid IS INITIAL.

CALL METHOD lv_ref_grid->check_changed_data.

ENDIF.

THis will solve your problem.

Regards,

Vijay

Read only

Former Member
0 Likes
580

Hi

Try in this way

In Sy-ucomm, when you click the SAVE button, call the method like this.

WHEN 'SAVE'.

DATA w_ref1 TYPE REF TO cl_gui_alv_grid.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = w_ref1.

CALL METHOD w_ref1->check_changed_data.

CALL METHOD w_ref1->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified.

This will help u...

Read only

0 Likes
580

Thanks a lot vijay and selva..

Read only

Former Member
0 Likes
580

Hi, I think you should use a method : CHECH_CHANGED_DATA before updating any table. This method you will find in class CL_GUI_ALV_GRID. CALL METHOD grid->check_changed_data IMPORTING E_VALID = l_valid1. where l_valid1 is of type c.