Delete button in ALV Table

Hi,
Does any one have a code sample for the ALV Table Delete button? When I hit the DELETE button the selected row gets deleted but how can I save this deletion to the database table so that when I do a refresh the deleted row does not re-appear.
Thanks. Kim

Hi Kim,
         i am sorry but I dont have a sample code for this .. but yes i can tell you a very simple logic here that should work fine ..
When the user clicks on Delete Entry call method say "Delete_entry" and within this you can write code based on this logic..
1) On_Action_Lead_Select should copy the content of that row to another context node say "Selected_Entry"
2) Search for this entry in your internal table/database that was bound to the ALVs context node(data source) and remove it using standard functions
3) again read the database/internal table data and bind it to the context node ..
Your changes will be reflected in your ALV..
I hope this helps and if it does please do award points
Also please close the thread if the issue gets resolved ..
Regards,
Anoop

Similar Messages

  • Disable delete button in ALV grid

    Hi Experts,
    I have a functionality to disable some buttons in alv grid such as delete row,cut,print etc.
    I know how to exclude them by using it_toolbar_excluding , but I need to disable them.
    Can you please let me know how to handle this.
    I am displaying the ALV grid by calling the method set_table_for_first_display.
    Thanks in Advance
    Prasanth

    Hi,
    By using below code you can disable any button in ALV display
    data : tool_wa_exclude  type ui_func.
      tool_wa_exclude  = cl_gui_alv_grid=>mc_fc_loc_delete_row.
    append tool_wa_exclude  to tool_it_exclude .
      call method grid2->set_table_for_first_display
        exporting
          it_toolbar_excluding          = tool_it_exclude
        changing
          it_outtab                            = it_ekpo
          it_fieldcatalog                    = it_fcat
        exceptions
          invalid_parameter_combination = 1
          program_error                           = 2
          too_many_lines                         = 3
          others                                        = 4.
    U need to pass tool_it_exclude internal table to  method for displaying

  • Rendering Delete button in the table

    Hi,
    I have created a column in the table and dropped the delete operation in that column.
    My case is that whenever the create insert button is clicked a new row is added to the table and only to that row the delete button should be rendered, all the other older rows the delete button should not be rendered.
    This is similar to the advanced search option in the adf, when we add fields we will get a delete button at end of each field.
    How to implement the same case in the table ?

    I have given set property listener to create insert button and named to be 'new', then in the rendering condition of the delete button i gave as #{pageFlowScope['return']=='new'}. so initially the delete button is not rendered in the existing rows in the table but when create insert button is clicked delete button is rendered in all the existing rows and also in the newly created row.
    Am not sure whether this is the right approach.

  • Replacing SAP Object Selector with Radio Button in ALV table in WD ABAP

    Hi All,
    I have a view in Webdynpro ABAP which displays data in an ALV table view (using SALV_WD_TABLE component).
    By default we have the SAP Object Selector for selecting a particular row of the table. This has to be replaced with radio buttons.
    I mean instead of using the SAP Object Selector, I need radio buttons at the start of each row.
    What I have thought of is to make the SAP Object Selector Invisible and create another attribute for the radio button in the node which contains ALV output data.
    Can you please let me know how to remove the SAP Object Selector from ALV output table and also how to include a column with radio button in the ALV output table.
    Thanks and Regards,
    Sayan Ghosh

    Hi Lekha,
    I am working with HRASR00_PROCESS_EXECUTE WD component of MSS application. In order to generate the data, this in turn calls another component called DATAOBJECTPROVIDER. I need to make the table selection as none and replace the SAP Object Selector with the radio button.
    Do you know under which method in DATAOBJECTPROVIDER do we need make the changes. I tried to search all the methods but couldnt understand a suitable one.
    Thanks and Regards,
    Sayan Ghosh

  • Keyboard delete button and alv response

    Hello friends,
    I have a problem with editable alv.
    In alv grid if i select a line and press the delete button on the keyboard,  then the data is getting deleted.
    i do not want that to happen.
    how can i stop it from happening?
    Note: I am not talking about the delete icon which alv provides. I mean the DELETE BUTTON ON THE KEYBOARD

    I know what you mean, but surely when you are typing it makes sense to have a backspace key and not delete as the cursor is ahead of the error.
    Also, a simple tap on the screen at the place you want to edit also means that you can position the cursor after the error. Then, again, you can use the backspace key.
    Personally, I have never felt the need for a delete key, but you should leave feedback for Apple at http://www.apple.com/feedback/ipad.html
    I presume you are aware that if you hold your finger on the screen that you can move and select text anywhere on the screen.

  • Custom Button in ALV table

    Hi Experts,
    I have created a custom button 'SELECT' in ALV table toolbar.
    lo_function = l_value->if_salv_wd_function_settings~create_function( 'SELECT' ).
    Now i am getting position of this custom button next to the Standard buttons ('Print' and 'Export' ). So how do I change the custom button position to first place. I mean the custom button should be in the left most position in the toolbar.
    Please help me in resolving this.
    Regards,
    Sarathy.

    Thank you Lekha. Set_position is working.
    We have to change the positon of custom button and the standard button. So that the position of button gets interchnaged.
    Regards,
    Sarathy
    Edited by: DEVASARATHY PANDI on Jan 26, 2012 12:18 PM

  • Deleting rows in a table with a button

    Good Day All;
    I seemed to have run into a snag with trying to add a delete button in a table that will delete a row. Let me expain.
    The form has 1 table that has 7 cells made up of text fields and drop downs. This table is in its own subform.
    There is a button to add rows as the user requires. The code I am using to add rows: psl_list_subform.instanceManager.addInstance(1);
    I have been asked to add a delete button so a user can delete rows. I have added this to the end of the table. SO each time a row gets repeated, there is a delete button. The code I am “trying” to use is;
    Table4.Row1.instanceManager.removeInstance(this.parent.index);
    When I click on the button to delete, nothing happens. I brought up the JavaScript debugger, there are no errors.
    Any ideas what I missed.
    Thanks All
    Chomp

    Hi,
    from my understanding of your form, you adding new instances of the subform "psl_list_subform" which contains a single table row.
    The hierarchy that will look like "psl_list_subform.Table4.Row1.RemoveButton".
    To remove an instance of the subform, from a button within the table row the script needs to refer to the 3rd parent of the remove button.
    this.parent.parent.parent.instanceManager.removeInstance(this.parent.parent.parent.index);
    Explaination: this = RemoveButton, 1st parent = Row1, 2nd parent = Table4, 3rd parent = psl_list_subform

  • Remove standard button in ALV LIKE APPEND/INSERT/DELETE

    Hi Expert,
    I have a requirement in which we do not need APPEND/INSERT/DELETE button in ALV,Can you please tell how i can remove that.
    Pleaae suggest.
    Thanks
    Mahesh

    Check this
        data lo_cmp_usage type ref to if_wd_component_usage.
        lo_cmp_usage =   wd_this->wd_cpuse_alv1( ). " alv1 is my used alv component
        if lo_cmp_usage->has_active_component( ) is initial.
          lo_cmp_usage->create_component( ).
        endif.
        data lo_interfacecontroller type ref to iwci_salv_wd_table .
        lo_interfacecontroller =   wd_this->wd_cpifc_alv1( ).
        data lo_value type ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(    ).
    data: lr_std type ref to if_salv_wd_std_functions.
        lr_std ?= lo_value.
    lr_std->SET_EDIT_APPEND_ROW_ALLOWED( abap_false ).
    lr_std->SET_EDIT_DELETE_ROW_ALLOWED( abap_false ).
    lr_std->SET_EDIT_INSERT_ROW_ALLOWED( abap_false ).
    Regards
    Srinivas

  • How to delete rows from multiple tables when pressing button

    Hi, I'm wondering how do I delete a row from two different tables at the same time when I press the Delete button. Both tables have GROUP_ID as their primary key.

    Nevermind! I realized that I had "reset" before my process to delete from the 2nd table.

  • Delete Filter in ALV

    Hi there,
    i am using SALV in my view and i enabled the filterfunction. Question: Does exist a method with which i can delete the filter set by user e.g. on Button-Click?
    D. Wallner

    Hi,
    Just look at the reply given by Prashant in this thread: Re: how to delete filter in alv table. It meight be helpful.
    Regards
    Arjun

  • How to disable delete button of UITableView automatically appears when it i

    Hi,
    My app has a UITextField on a UITableViewCell, and having a trouble with editing text in the UITextField.
    When I am going to edit the text, first I tap the UITextField, then a loupe appears, and it should follow the move of my finger.
    But when I move my finger intending to move the loupe, UITableView misunderstands the gesture and show a delete button on the table view. And once the delete button appears, it blocks control to the loupe and the loupe freezes.
    As table row can be deleted just by turning UITabeView's editing YES, there is no need to display delete button in my application when the table view is swiped, and I need to disable this function of UITableView.
    Are there any ways to prevent delete button from appearing?

    Its in my TableViewController which also acts as my delegate method.
    // FavouritesViewController.h
    #import <UIKit/UIKit.h>
    @interface FavouritesViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
    IBOutlet UITableView *favouritesTable;
    @property (nonatomic, retain) UITableView *favouritesTable;
    the "myTable" reference is the reference to my tableview. So with the example above I have the following in my FavouritesViewController.m:
    #pragma mark Table Edit Delegate Methods
    - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [super setEditing:editing animated:animated];
    [favouritesTable setEditing:editing animated:YES];
    Hope this helps. Regards, Michael.

  • Removing "print version" button in alv

    Hi Experts,
    I am trying to hide the buttons in ALV table.
    I did hide all other buttons except "Print Version".
    Can anyone assist.
    Thanks,
    Siva.

    Hi,
    I think use this "'SALV_WD_EXPORT' to hide the print version
    Use the below code -
    ***Reference to the standard button reference of the ALV
      DATA:
        ls_functions_std type SALV_WD_S_FUNCTION_STD_REF.
    ***Modifying The standard functionality buttons
    if lt_functions_std1 is not initial.
      loop at lt_functions_std1 into ls_functions_std.
        case ls_functions_std-id.
          when wd_assist->GC_APPEND_ROW.                           "'SALV_WD_INPUT_APPEND_ROW'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_INPUT_DELETE.                         "'SALV_WD_INPUT_DELETE'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_INSERT_ROW.                           "'SALV_WD_INPUT_INSERT_ROW'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_EXPORT_EXCEL.                        "'SALV_WD_EXPORT_EXCEL'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_PDF.                                     "'SALV_WD_PDF'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_INPUT_CHECK.                            "'SALV_WD_INPUT_CHECK'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_EXPORT.                                "'SALV_WD_EXPORT'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_FILTER .                               "'SALV_WD_FILTER'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
          when wd_assist->GC_SETTINGS.                              "'SALV_WD_SETTINGS'
            CALL METHOD LS_FUNCTIONS_STD-R_FUNCTION->SET_VISIBLE
              EXPORTING
                VALUE = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
        endcase.                     "Case ls_functions_std-id
        clear LS_FUNCTIONS_STD.
      endloop.                       "LOOP at lt_functions_std1 into ls_functions_std.
    endif.                           "IF lt_functions_std1 is not initial.
    Regards,
    Lekha.

  • How to delete a particular row in ALV table

    Hi,
    How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
    Thanks
    Bala Duvvuri

    Hello Bala,
    Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
    data : lr_table_settings  TYPE REF TO if_salv_wd_table_settings,
                 lr_config          TYPE REF TO cl_salv_wd_config_table.
      lr_table_settings  ?= lr_config.
    ** Setting the ALV selection to multiple selection with no lead selection
      lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
    Next delete the selected rows in the action triggered by the button:
    METHOD onactiondelete_rows .
      DATA:  wd_node TYPE REF TO if_wd_context_node,
             lt_node1 TYPE ig_componentcontroller=>elements_node,
             wa_temp  TYPE REF TO if_wd_context_element,
             lt_temp  TYPE wdr_context_element_set,
             row_number TYPE i VALUE 0.
      wd_node = wd_context->get_child_node( name = 'NODE' ).
      CALL METHOD wd_node->get_selected_elements
        RECEIVING
          set = lt_temp.
      LOOP AT lt_temp INTO wa_temp.
        wd_node->remove_element( EXPORTING element = wa_temp ).
      ENDLOOP.
      CALL METHOD wd_node->get_static_attributes_table
        EXPORTING
          from  = 1
          to    = 2147483647
        IMPORTING
          table = lt_node1.
      wd_node->bind_table( new_items = lt_node1 ).
    ENDMETHOD.
    If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
    Regards,
    Uday

  • How to create alv table dynamically by performing action on the button.

    Hi all,
    my requirement is to create alv table dynamically.
    that is i will create two buttons
    1) show alv table
    2) close alv table
    if user selects show alv table then the alv table should be displayed.
    and if user selects clsoe alv table then the alv table should be closed.
    to create alv table dynamically  i have followed this procedure.
    under view properties i have added salv_wd_table component. then under the action of showalvbutton i went to code wizard and i have selected instantiate used component component use salv_wd_table. the following code will be generated
    with this code i am unable to display alv table dynamically correct me where i went wrong kindly send me the necessary steps how to create alv table dynamically
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_salv_wd_table( ).
    if lo_cmp_usage->has_active_component( ) is initial.
      lo_cmp_usage->create_component( ).
      endif.
    to close table i have used the following code. with this code i am able to achieve the functionality to delete the alv table
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_salv_wd_table( ).
    if lo_cmp_usage->has_active_component( ) is initial.
      else.
      lo_cmp_usage->Delete_component( ).
    endif.
    Thanks & Regards,
    Naveen
    Edited by: naveen.webhelp on Feb 10, 2011 5:52 AM

    Hi
    ALV table will be shown in the viewcontainerUI element.
    it is shown there empty if you dont fill the node bound to the data node of the interface controller of the comp usage
    SALV_WD_TABLE.
    and if you are not getting the table filled in the first place.
    then check have you mapped the DATA node to some node in the comp controller
    wht basically is your requirment is that you want to show ALV gird on click of one button and delete it on click of other button.
    there are many ways to do so.
    best way is control the visiblity of the viewcontainer UI element which containes the TABLE view of SALV_WD_table comp.
    create an attribute of type WDUI_VISIBILITY name say VIS.
    now go to the layout and bound hte visible property of the viewcontainer to this attribute VIS.
    then in the showalv grid button's eventhandler write
    wd_context->set_attribute(
    name = 'VIS'
    value = '02'
    and in the wddoinit and delete alv grid button's event handler write
    wd_context->set_attribute(
    name = 'VIS'
    value = '01'
    thanks
    sarbjeet singh

  • Disable delete button in Table Maintainance Generator

    Hello all,
      How to disable delete button in Table maintainance generator???

    Hi Maya,
    It is very interesting question. If you debug your table maintenance screen, the program of table maintenance screen will not have statically defined pf status. So you cannot exclude delete functionalities using the below statement.
    SET PF-STATUS <the GUI status> EXCLUDING 'DELE'.
    For viewing pf status SAP has programmed in dynamic manner using this FM VIEW_SET_PF_STATUS.
    Before calling above FM you need to exclude delete function. Follow the following step for achieving this
    Go to sm30. Put your table name and press on maintain push button. It will display table entries in maintenance screen.
    Go to system->status
    Click on program name.
    Go to your flow logic of you table maintenance screen number.
    It will have following code in flow logic
    PROCESS BEFORE OUTPUT.
    MODULE LISTE_INITIALISIEREN.
    LOOP AT EXTRACT WITH CONTROL
      TCTRL_ZMAINTAIN CURSOR NEXTLINE.
       MODULE LISTE_SHOW_LISTE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
    MODULE LISTE_BEFORE_LOOP.
    LOOP AT EXTRACT.
       MODULE LISTE_INIT_WORKAREA.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        FIELD ZMAINTAIN-KUNNR .
        FIELD ZMAINTAIN-LIFNR .
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
       ENDCHAIN.
       FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        MODULE LISTE_UPDATE_LISTE.
       ENDCHAIN.
    ENDLOOP.
    MODULE LISTE_AFTER_LOOP.
    Add new module in PBO for excluding delete function. ex  module set_pf.
    PROCESS BEFORE OUTPUT.
    ****here I added my own code for excluding delete function
    ****begin of addion
    module set_pf.
    ****end of addition
    MODULE LISTE_INITIALISIEREN.
    LOOP AT EXTRACT WITH CONTROL
      TCTRL_ZMAINTAIN CURSOR NEXTLINE.
       MODULE LISTE_SHOW_LISTE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
    MODULE LISTE_BEFORE_LOOP.
    LOOP AT EXTRACT.
       MODULE LISTE_INIT_WORKAREA.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        FIELD ZMAINTAIN-KUNNR .
        FIELD ZMAINTAIN-LIFNR .
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
       ENDCHAIN.
       FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        MODULE LISTE_UPDATE_LISTE.
       ENDCHAIN.
    ENDLOOP.
    MODULE LISTE_AFTER_LOOP.
    *****inclule one line of code for excluding delete fucion
    module set_pf output.
          MOVE 'DELE' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    endmodule.
    Basically sap fetching status dynamically from program SAPLSVIM using FM VIEW_SET_PF_STATUS. Status name is EULG.
    Please donu2019t hardcode anything by using set pf status statment, you just add one line of code the PBO by creating new module.
    Let me know if you need any help .
    Cheers.
    Regards,
    Peranandam

Maybe you are looking for

  • Importing CSV into table - problem with tab-deliminated files

    Hi All, I have written an application based on well-known Uploading excel sheet using Oracle Application Express (APEX) example from the following site: http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/ All work

  • Connection to remote database failed

    I have configured the cman.ora file and changed the connection string for the java applet, but I encountered the error "The NT Adapter could not establish the connection" when I tried to connect to remote database from JDev2.0(beta). Any ideas of wha

  • Authorization control for cost analysis/itemization view

    Hi Experts, Can we control the access to cost analysis/itemization report  in CO03 by authorization control ? Thanks

  • Solaris 10 x86 Install skips Network Configuration

    I am trying to install solaris 10 x86 on a Dell Dimension and not able to get the network card to work. The network card is Ok as I tested it by installing Windows XP on the same box. Ifconfig -a shows only le0. What is the best way to enable the net

  • Photo albums on iphone

    How do I save more than one photo album on my iphone?