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

Clear user inputted data in CL_GUI_ALV_GRID

Hi All experts,

I am using CL_GUI_ALV_GRID to develop a function for user to input something. After user's input, if somthing is Wrong, I would like clear user's input. Is there any method to do this? Or have to refresh display?

Thanks in advance ..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 02, 2012 at 06:12 AM

    Hi,

    Just call the method : refresh_table_display.

    DATA: O_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: L_No type ref to LVC_S_STBL .
    
    CALL METHOD  O_GRID->refresh_table_display
    
     EXPORTING
             IS_STABLE    = L_No.

    Regards

    Sreenivas P

    Edited by: sreenivas.p on Feb 2, 2012 7:13 AM

    Edited by: sreenivas.p on Feb 2, 2012 7:15 AM

    Edited by: sreenivas.p on Feb 2, 2012 7:17 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 06, 2012 at 09:54 AM

    I suggest to handle that in event data_changed .

    - create a handler to this event (method)

    - in the method check modified cells and if something went wrong modify them in the backend

    Something like:

    "handler
    method handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
                                  IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after.
    
    "implemantation
      METHOD handle_data_changed .
        DATA: ls_mod_cells TYPE lvc_s_modi.
         LOOP AT er_data_changed->mt_mod_cells INTO ls_mod_cells.
             IF ls_mod_cells-value >= 5.
                 er_data_changed->modify_cell( i_row_id =  ls_mod_cells-row_id 
                                                 i_fieldname = ls_mod_cells-FIELDNAME        
                                                 i_value = space ). 
             ENDIF.
         ENDLOOP.
     ENDMETHOD.
    

    Regards

    Marcin

    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.