Delete row in tablecontrol through webdynpro

[http://www.blogger.com/post-create.g?blogID=6914282228603174052]
In the above link,
There is a delete icon.we want to select the particular row in table control and click the delete icon means the row should be deleted in the table control and in the database table.
Another one there is a deleteall button ,If we select all the row in table control  and press the deleteall button all the row should be deleted in the table control and in the database table.
I need the sample code for my requirement.Please send me the example code to suit my requirement..

Hi Prabhu,
I saw the picture. I'll give you a solution similar to that using buttons.
While creating the node for the table, just add one more attribute for the button (i used boolean type). While binding make this field as button and bind the attribute to some unused property of button (I bound it to tooltip property of the button). Now on WDDOINIT I put the following code to initialize the data
method WDDOINIT .
  data: begin of stru,
          kunnr type kunnr,
          name1 type name1,
          butid type boolean,
        end of stru,
        itab like standard table of stru with key kunnr,
        node type ref to if_wd_context_node.
        node = wd_context->get_child_node( name = 'KNA1_NODE' ).
        select kunnr name1 from kna1 into corresponding fields of table itab.
        loop at itab into stru.
          stru-butid = 1.
          modify itab from stru.
        endloop.
        node->bind_table( itab ).
endmethod.
Now on the action of the button on the table. Add a code similar to the following one. Include your code for deleting from the database.
method ONACTIONDELETE_ROW .
  data: ind type i,
        itab type standard table of if_main=>element_kna1_node,
        node type ref to if_wd_context_node,
        elem type ref to if_wd_context_element.
  wdevent->get_context_element( exporting name ='CONTEXT_ELEMENT' receiving value = elem ).
  elem->get_index( receiving my_index = ind ).
  node = wd_context->get_child_node( 'KNA1_NODE' ).
  node->get_static_attributes_table( importing table = itab ).
  delete itab index ind.
  node->bind_table( itab ).
endmethod.
Now this will delete the corresponding row of which the delete button is pressed. And for delete all my previous post will work I suppose.
Hope it ll be useful for you. If you got the answer, please dont forget to close the thread.
Regards,
Fareez

Similar Messages

  • How to add or delete rows in tablecontrol?

    Hi,
    I am using a tablecontrol to enter data records.
    I want to use 2 buttons, one to insert a row into a tablecontrol and another to delete a selected row of a tablecontrol.
    How do I insert or delete rows of a tablecontrol?
    Thanks.

    Hi Kumar,
    Please look at the below sections......
    ADDING BLANK LINES
    To add blank lines to table control we do not need to change any of the fields of the structure CXTAB_CONTROL simply adding blank lines to the internal table will do.
    INSERT INITIAL LINE INTO itab.
    DELETING SELECTED ROWS
    Deletion of selected rows is simple. To delete selected rows first we will determine the rows which have been selected through selection column .
    FOR SINGLE ROW SELECTION
    IF mark EQ 'X' .             "mark is the name of selection column field
    DELETE itab FROM workarea . 
    ENDIF.
    FOR MULTIPLE ROW SELECTION
    *To deetermine the rows selected we will use the selection column field to loop
    *through the internal table.
    LOOP AT itab WHERE mark EQ 'X'.  "mark is the name of selection column field
    DELETE itab                                    " and is part of the internal table .
    ENDLOOP.
    Thanks,
    Ravi Kanth

  • Loop through result set and delete row

    so here is what I need -
    I have a query that pulls rows from the Database through a stored procedure.(these are properties in an area)
    Before I start looping through the query, I need to check the distance between my current location and the property. If it less than 5 miles, only then should I display that property. The distance in miles will be chosen while submitting the search form.
    So is there a way to delete rows from the result set based on the criteria? Or
    Is there a better way to accomplish this? I am using the the google api to get the latitudes and longitudes. The other issue to keep in mind is the load time.
    Thanks

    You can do this the easy way or the hard way.  Depends on whether your condition that needs to be checked can be expressed in the form of a SQL where clause.  If it can, then do what BKBK suggested, and use a query of query to create a new resultset that only has the rows from the original resultset that don't meet your condition.
    If the calculation of the condition is more complex, then do a CFLOOP over the query and examine each row to see if you want to keep it or toss it.  if you want to toss it, the delete that row - there is a function in CFLIB.ORG called querydeleterow that should help you.  Or, you could just clear out the row's contents and then do the query of query as described in BKBK's post to create a new resultset that doesn't include the blank rows.

  • Replicate deleted rows through Archiver

    Hi all
    I'm trying to replicate deleted rows from a custom UCM table, but when a record is deleted from the source table, the deleted record doesn't get replicated to the target table through Archiver.
    The source archive is setup to export and transfer automatically. Also, the "replicate deleted rows" option is ticked on the source archive and the recommended Create and Modify time stamp columns are selected.
    I'm deleting the records through the Configuration Manager applet after creating a view on the table.
    I can see that new rows (the deleted record) are added into the "DeletedRows" table but they don't get deleted on the target instance. Am I missing anything else?
    Regards,
    Alex
    Edited by: user8859325 on Jan 18, 2013 2:28 AM

    Hi
    I have done other tests and can see that there is first of all a problem with the strSQL = strSQL & " AND PeriodKey = '" & dtePerKey & "'"
    in the where clause.
    If I execute this SQL request in SQL Developer, I have a non-zero number in the TMP table :
    INSERT INTO TMP (SELECT COUNT(*) FROM tDataSeg3 WHERE PartitionKey='749' AND CatKey = '12' AND PeriodKey = to_date('30/04/10'))If I execute the same request through FDM, I have 0 in the TMP table.
    Thanks for your help
    Fanny

  • Table compare deleting rows which does not exist in target table

    Hi Gurus,
    I am struggling with an issue in Data Services.
    I have a job which uses Table Compare, then History Preserving and then a Key Generation transforms.
    There is every possibility that data would get deleted from the source table.
    Now, I want to delete them from the target table also.
    I tried Detect deleted rows but it is not working.
    Could some one please help me on this issue.
    Thanks,
    Raviteja.

    Doesn't history preserving really only operate on "Update" rows.  Wouldn't it only process the deletes if you turned the "Preserve Delete row(s) as update row(s)" on?
    I would think if you turned on Detect Delete rows in the Table compare and did not turn this on in the history preserving it would retain those rows as delete rows and effectively remove them from the target.
    Preserve delete row(s) as update row(s)
    Converts DELETE rows to UPDATE rows in the target warehouse and, if you previously set effective date values (Valid from and Valid to), sets the Valid To value to the execution date. Use this option to maintain slowly changing dimensions by feeding a complete data set first through the Table Comparison transform with its Detect deleted row(s) from comparison table
    option selected.

  • Table layout w.r.t other tables and text while inserting/deleting rows.

    I have 3 tables in a single page. One is left aligned and other two are right aligned. Then there is some text below the tables. 
    Now when I delete some rows from Table-1 the left aligned one, the Table 2 and text shift up filling the space below Table1.
    Now I don't want the text/table to shift up/down when I add/delete rows from Table1 i.e Table1  should expand/contract in the empty space below it.
    Now If I do the same thing for Table3 (Right aligned one) i.e add/delete rows there is no effect on text as shown :
    All 3 tables are same and have exact positioning and other properties.
    Please suggest any solution as I would be populating the table through word automation service (interop).

    Another approach would be to use nested tables, with your 'outer' table having two columns and the inner tables going into different columns. You can hide the outer table's cell borders so its presence is less apparent. If the Outer table has auto row
    height, it will adjust to accommodate whatever row addition/deletion you do to the inner tables. The only proviso is that the inner tables shouldn't have 'around' text wrapping. The two rhs tables can go into the same cell - all they need is a separating paragraph.
    With this layout, the text will always remain below the outer table.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • How to invoke delete rows event in ALV_GRID

    I have two screens.
    The first screen 100 have several splitter control ALV grids that display data.
    The second screen 200 is the maintenance of screen on 100 that have two grids side by side need to update simultanously.
    When I update or insert data on the second screen, I refresh data on screen 100 so that when user navigate to screen 100 they can see the updated data.
    For insert rows or modified rows, it works as expected.
    However when I delete rows on screen 200 and click go back to 100, screen 100 still shows the rows that I deleted in screen 200.  I think that I missed something. 
    I debug in even data_changed in cl_gui_alv_grid when I deleted, it did not go through this logic therefore I cannot refresh the other grids on screen 100.
    Here are the events that I defined and registered in the PBO of screen 200.
    class lcl_event_handler definition.
    class-methods:
    on_data_changed FOR EVENT data_changed
               OF cl_gui_alv_grid   IMPORTING er_data_changed e_ucomm,
    on_user_command for event user_command of cl_gui_alv_grid importing e_ucomm.
    endclass.
    set handler:
    lcl_event_handler=>on_data_changed for go_grid,
    lcl_event_handler=>on_user_command for go_grid.
    What did I do wrong?
    Thanks,

    Hi Akinosora,
    >
    Akinosora wrote:
    > When I update or insert data on the second screen, I refresh data on screen 100 so that when user navigate to screen 100 they can see the updated data.
    >
    > For insert rows or modified rows, it works as expected.
    >
    > However when I delete rows on screen 200 and click go back to 100, screen 100 still shows the rows that I deleted in screen 200.  I think that I missed something. 
    Don't you need to do a refresh of the data for a delete action as well?
    Kind regards,
    Robert

  • Deleting rows by key from several tables

    Hello! 
    One of action of my stored procedure is deleting rows from several tables on a key , that I'm getting through statement :
    delete from table3 where key_column in ();
    delete from table4 where key_column in ();
    commit;
    select key_column from Table!
    minus
    select key_column from Table2
    Unfortunately the number of lines mentioned by this statement isn't known in advance .
    How do You think , is better way to
    -- execute select each time for every delete-statement or
    -- create table as select result set and then select again keys for each delete- ststement or
    I'm usung 11.2.0.3
    Thanks and regards,
    Pavel

    By using : 1.trigger 2. on delete cascade you can achieve this.
    OraFAQ Forum: SQL & PL/SQL » delete rows from multiple tables (more than 2 tables)
    Regards
    Girish Sharma

  • Cannot commit delete row from VO

    I have a VO that I have no problem create new row, update existing row and commit. But I can't commit deleted row to database. no exception or error message etc... and All other VOs are working fine,
    anybody has any idea why? is that an option or something on VO? or is it an BC4J bug?
    Thanks,
    -Ming
    Edited by: user715460 on Oct 16, 2008 3:40 PM

    You are in the wrong forum. Try your question JDeveloper and ADF .
    And please consider this too (copied from this thread Concerned in delayed response
    a) Use a good subject line that briefly describes the issue. This will attract those familiar with that area to come and help.
    b) Tell us what database version you are using. Not just saying e.g. "10g" but more specifically "10.2.0.3"
    c) Describe the issue clearly stating what you have tried, and what you are trying to achieve.
    d) Don't use txt spk because this is a professional forum, not a chat room and not everyone can follow it.
    e) Don't USE CAPITAL LETTERS IN YOUR DESCRIPTION as this is considered shouting and agressive.
    f) Provide sample data for us to use if necessary either with the CREATE TABLE and INSERT statements to create it or providing a WITH clause that we can use. This saves us from having to type in and format the sample data for ourselves and is more likely to attract us to help.
    g) Show the code that you have already tried (if you haven't tried any code yet then why not? have a go yourself and only ask for help when you get stuck).
    h) Show us any error messages you are getting, in full, and with information of the line numbers where the error is occurring
    i) Wherever you provide data or code remember to use the tag before and after or the [code] tag before and the [/code] tag after, so that it keeps it's layout and is clear to read.
    j) Perhaps one of the most important things of all... never suggest that you need a solution "urgently" or that your issue is "urgent". This implies that your issue is somehow more important than the issues posted by other people. Everybody would like an answer to their issue promptly, but it just depends when people are online who can answer the question and nobody is being paid to answer it, so it is arrogant and rude to demand urgent attention to your own. If something is that urgent then you should raise it through oracle metalink as a priority issue or pay for someone with the necessary skills to come and do the work for you.
    Timo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Deletion of dynamic button in Webdynpro?

    Hi Experts,
    We are upgrading from SRM 5.0 to SRM 7.0.
    The requirement is to make few buttons invisible on SC screen (in NWBC portal), those buttons are generated by SAP dynamically,(when I have seen the respective componenet in WebDynpro, there is no Such button seen). How to delete dynamically created button in webdynpro?I have tried deleting through SPRO but not able to find those buttons.
    Could you pls throw some light on this.
    Thanks,
    KP.

    Hi Pranitha ,
    To hide this buttons
    1)System info
    2)Export
    3)Memory snapshot
    4) import
    if you remove SAP_ALL profile to the user then system info and Memory snap shot button will wont be visibel
    and export button can be hide from component configuration .
    go to tcode 80 in webdynpro /component : FPM_OIF_COMPONENT expand thei webdynpro component go to component configuration folder -->go this configuration : /SAPSRM/XYZ
    click on the start configurator
    on screen will open in browser
    in this screen
    click on other function button
    click on this and create the enhancement , after creating enhancement then click on change button
    in the screen you can find the export button & Import button click onit
    here you can set the visibility as invisible .
    Thanks & Regards
    Pradeep Kumar Dondeti

  • Add/delete row in JTable

    I went through the tutorial of JDK about how to programming JTable, i can NOT find a way to add/delete row into/from JTable.
    I immagine it would be a difficult task because the data set it takes 'Object data[][]' is NOT dynamically grow/shrinkble.
    Can we make it take ArrayList[] as input dataset so that the dataset can dynamically grow/shrink?
    Any other way around to add/delete row?
    THANKS for your consideration.

    You have to write your own TableModel like extending AbstractTableModel. In that class add custom methods to add and remove rows. From those methods call fireTableRowsDeleted(..) and fireTableRowsInserted(..) to update UI.

  • Delete Rows from T1 which are Not in T2

    Hi
    I've 2 Tables like below
    T1
    N1
    N2
    2
    11
    2
    22
    3
    33
    8
    44
    8
    88
    T2
    N1
    N2
    2
    22
    8
    88
    If I Run Delete query, I must delete Rows from T1 which are Not in T2
    For example, I must delete Rows 1,3,4 from T1
    So how to write that delete query? Please advice

    Delete from T1
    Where not Exists (select * from T2 Where t1.N1=t2.N1 and t1.N2=t2.N2)
    --or
    Delete t
    From t1 t
    left JOIN t2 m
    ON m.N1=t.N1 and m.N2=t.N2
    WHERE m.N1 is null and m.N2 is null
    --Or
    ;With mycte as
    select N1,N2 from T1
    Except
    select N1,N2 from T2
    Delete t
    From t1 t
    INNER JOIN mycte m
    ON m.N1=t.N1 and m.N2=t.N2

  • Cannot DELETE rows from LOV on running...is it a bug ??

    One of the features I appreciated in the new version of JHeadstart is that we can now insert, modify and delete rows on LOV (even in the database).
    We have just to check on Lookup properties :
    Multi-row insert allowed
    Multi-row update allowed
    Multi-row delete allowed
    I cheked all of them and on runnig I could insert and update records in LOV.
    When I tried to delete records from LOV the system display information message "nothing to save" and in fact no records were deleted.
    Normally since I checked the delete property it should be possible to delete rows from LOV
    thanks for any Help

    Monta,
    I could reproduce this, it is a bug. Added to the fix list for the next release.
    Thanks for reporting,
    Steven Davelaar,
    JHeadstart Team.

  • Unable to delete rows from Target.

    Hello everyone,
    I am unable to delete rows from target data store. Here is what I have done.
    Source Oracle 10g - staging 11g - Target Oracle 11g
    I have implemented consistent set CDC on data model in staging and added 2 tables to CDC and turned on the journals . Both tables A and B are joined together via Column E (primary key of table A). Table A is the master table(has foreign key). Table B is child table. Target column consists of all the columns of both table A and B.
    Following is what I am able to do and not to do
    ABLE TO DO. If data is inserted into both or any of journalized tables I can successfully load the same in target by performing following steps. 1. Extend the consistency window at model level. Lock subscriber. Run the interface with any source table marked as Journalized data only. Unlock subscriber and purge journal.
    ABLE TO DO. If data is updated in any of the journalized table, along with the steps mentioned above I can execute two interfaces. In one Interface table A marked as journalized data only Joined with table B and in second interface table B marked as Journalized data only joined to table a.
    NOT ABLE TO DO If data is deleted from one or both tables it shows up as journalized data in JV$D<tablename> marked as D with date and subscriber name but when i run the interface by extending the window , locking subscriber executing both interfaces, unlock subscriber purge journals. no change takes place is Target. After unlocking subscriber step, journalized data gets removed from JV$D view. Please let me know what I am doing wrong here. How can rows delted from source can also be deleted from TARGET?
    NOTE : In the flow table SYNC_JRNL_DELETES is YES
    In moel under jounalized table tab Table have following order Table A folloed by Table B
    Thanks in advance
    Greenwich

    Sorry I still do not get it. when you say "Its a legacy app", are you talking about the VB.NET app ?
    If so then I repeat my self :-) Why not to connecting to the SQL server directly?
    * even if you need information from several databases (for example ACCESS + SQL Server), in most cases, it is much better to connect directly and get each information to the app. Then in your app you can combine the information and analyse it
    [Personal Site] [Blog] [Facebook]
    Access app is the legacy app. 

  • Database, Dataset, Table Adaptors Error "Unable to load, Update requires a valid DeleteCommand when passed DataRow collection with deleted row"

    Microsoft Visual Basic 2010 Express.
    I am new to Visual Basic programing and i am trying to understand the relationships between Datasets, database, table Adaptors. I have to following code that is is giving me the following error" Unable to load, Update requires a valid DeleteCommand
    when passed DataRow collection with deleted rows". 
    I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    It seems that i can delete the data on the DataGridView Table and it only displays the correct data. but my database is not updating, even though the data grid displays differently.I can determine this because, when i save the offset database, i have all
    the previous uploads and all the rows that i wanted to delete are still there.
    My final goal is to be able to import offset data from a CSV file, save this data on the pc, send a copy of this data to a NuermicUpDown so the customer can modify certain numbers. From here they download all the date to a controller.  IF the customer
    needs to modify the imported data, they can go to a tab with a data grid view and modify the table. They will also have to option to save the modified data into a csv file.  
    Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    CODE:
    Private Function LoadOffSetData()
            Dim LoadOffsetDialog As New OpenFileDialog 'create a new open file dialog and setup its parameters
            LoadOffsetDialog.DefaultExt = "csv"
            LoadOffsetDialog.Filter = "csv|*.csv"
            LoadOffsetDialog.Title = "Load Offset Data"
            LoadOffsetDialog.FileName = "RollCoaterOffset.csv"
            If LoadOffsetDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then  'show the dialog and if the result is ok then
                Try
                    Dim myStream As New System.IO.StreamReader(LoadOffsetDialog.OpenFile) 'try to open the file with a stream reader
                    If (myStream IsNot Nothing) Then 'if the file is valid
                        For Each oldRow As MaterionOffsetDataSet.OffsetTableRow In MaterionOffsetDataSet.OffsetTable.Rows
                            oldRow.Delete()                       
    'delete all of the existing rows
                        Next
                        'OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        Dim rowvalue As String
                        Dim cellvalue(25) As String
                        'Reading CSV file content
                        While myStream.Peek() <> -1
                            Dim NRow As MaterionOffsetDataSet.OffsetTableRow
                            rowvalue = myStream.ReadLine()
                            cellvalue = rowvalue.Split(","c) 'check what is ur separator
                            NRow = MaterionOffsetDataSet.OffsetTable.Rows.Add(cellvalue)
                            Me.OffsetTableTableAdapter.Update(NRow)
                        End While
                        Me.OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        MainOffset.Value = OffsetTableTableAdapter.MainOffsetValue          'saves all the table offsets
    to the offset numericUpDown registers in the main window
                        StationOffset01.Value = OffsetTableTableAdapter.Station01Value
                        StationOffset02.Value = OffsetTableTableAdapter.Station02Value
                       myStream.Close() 'close the stream
                        Return True
                    Else 'if we were not able to open the file then
                        MsgBox("Unable to load, check file name and location") 'let the operator know that the file wasn't able to open
                        Return False
                    End If
                Catch ex As Exception
                    MsgBox("Unable to load, " + ex.Message)
                    Return False
                End Try
            Else
                Return False
            End If
        End Function

    Hello SaulMTZ,
    >>I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    This error usually shows that you do not initialize the
    DeleteCommand object, you could check this
    article to see if you get a workaround.
    >> Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    If you are working CSV file, you could use OleDB to read it which would treat the CSV file as a Table:
    http://www.codeproject.com/Articles/27802/Using-OleDb-to-Import-Text-Files-tab-CSV-custom
    which seems to be easier (in my opinion).
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • I am trying to Integrate EBS-12.1.3 with Endeca on  RHEL5-64 bit

    Hi, am new to Endeca i m doing a Ebs connection with Oracle endeca but i m not been able to do it. I done setup of (./envSetup.sh)Database, Domains but when i start (./startAllEndeca.sh) Endeca Components Endeca Studio Managed Server (5) giving error

  • What is maximum length .mov file that can be used in iDVD?

    Hello Appleheads I created an HD .mov file in iMovie which I had added as a movie in iDVD - I find this works best for me, as exporting directly to iDVD from iMovie always results in stuttering when played back on a regular DVD player. The .mov file

  • BPM  HTTP Sync - IDOC Async Timeout

    Hi!!! my scenary is using a BPM          HTTP sync <--> BPM -> IDOC my IP receiver            sender1             transforme              sender2 SI_ABS_SYNC         SI_ABS_REQ          OM_ABS_REQ_to_ABS_RES   SI_ABS_RES SI_ABS_REQ                   

  • How to change mouse pointers?

    I would like to change the mouse pointer (from arrow to hourglass) while the application is doing a certain task. How is this done? thanks!

  • Accurate RoboHelp to PDF conversion?

    I've been attempting to generate PDFs that accurately reflect my RoboHelp projects. The output always comes out a bit funky (blank pages, orphaned headings and text, etc.). Also, the PDFs generate with headers which I don't want and the TOC as the fr