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

Deletion of Editable ALV records

Hello Experts,

I am working on a requirment where in I need to delete the entries on display on Editable ALV screen selected by Check boxes provided on the first column of the list. The moment I select the records ( by check boxes ) and click the Delete button the entries selected ( Records selected ) must disappear from the ALV screen.

Kindly give me your valuable inputs on this front.

Regards,

Murthy.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 06:25 AM

    Hi Pr Murthy,

    Refer this thread with same requirement controlling-the-deletion-of-rows-from-alv-grid

    Regards,

    Flavya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 06:30 AM

    Hi,

    When you catch the user command for 'Delete', write the logic to

    delete entries either from table where check box = 'x' then 'perform' the form which contains the ALV again.

    Regards,

    Manoj Kumar P

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 06:49 AM

    Hi,

    DATA: lt_rows TYPE lvc_t_row,
            lt_index TYPE  lvc_s_row-index,
            l_id TYPE sy-repid.
    Data: FIELD-SYMBOLS: <dyn_table>    TYPE  STANDARD TABLE
    *--- Getting the Selected Rows
        CALL METHOD g_grid->get_selected_rows
          IMPORTING
            et_index_rows = lt_rows.
      LOOP AT lt_rows INTO lt_index.
    * For deleting data
          PERFORM delete_dyn USING lt_index p_bom.
        ENDLOOP.
    
    FORM delete_dyn USING    p_index.
        DELETE <dyn_table> INDEX p_index.
      CALL METHOD w_ref_grid->refresh_table_display.
    
     Endform.
        DELETE <dyn_table1> INDEX p_index."RT
        DELETE it_final_bom1 WHERE instance = wa_final_bom-instance.
      ENDIF.
      pERFORM refresh_frontend.
    ENDFORM.                    "delete_dyn
    

    Thanks,

    Krishna...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 06:32 AM

    Hi,

    If you want to delete the table entries and if you are using a grid alv display use this code after the

    DATA: gs_fieldcat TYPE lvc_s_fcat,

    ls_layout TYPE lvc_s_layo.

    LOOP AT gt_fieldcat INTO gs_fieldcat.

    gs_fieldcat-edit = 'X'.

    MODIFY gt_fieldcat FROM gs_fieldcat.

    ENDLOOP.

    CALL METHOD gv_grid->set_table_for_first_display

    EXPORTING

    i_structure_name = 'V_T001B'

    i_save = 'A'

    • it_toolbar_excluding = lt_exclude

    CHANGING

    it_outtab = gt_output

    it_fieldcatalog = gt_fieldcat[].

    CALL METHOD gv_grid->get_frontend_layout

    IMPORTING

    es_layout = ls_layout.

    ls_layout-edit = 'X'.

    CALL METHOD gv_grid->set_frontend_layout

    EXPORTING

    is_layout = ls_layout.

    CALL METHOD gv_grid->refresh_table_display.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 08:19 AM

    Thank you guys for your valuable inputs

    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.