Skip to Content
author's profile photo Former Member
Former Member

Reg: ALV Problem

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 07:05 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 07:09 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2009 at 08:29 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.