Delete row in itab

Hallow
I wont to delete from my internal table value with persg <>  6 or 7 or 8
I try like that but it delete data in my table with persg 6 7
How I can delete all the row in my table with 6, 7,8 in persg
This is my trying
and its not working
DELETE person_tab WHERE ( persg <> 6 OR persg <> 7 OR persg <> 8 ).
regards

hi,
do this way
DELETE person_tab WHERE ( persg <>' 6'  OR persg <> '7' OR persg <>' 8' ).
Regards,
Santosh

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

  • Delete rows dynmically from internal table

    Hi Gurus,
    I have got an problem. I have an internal table itab.
    Case 1. It has got some 10 rows. I want to delete rows between those two rows containing same field value of a Field 'X'. Here same value of that field could come on 1st and 7th row. Then mean, I need to delete 2nd to 6th row.
    It could come in 4th and 10th row. Then I need to delete 5th to 9th row.
    Case 2. It has got some 20 rows. Now same I want to delete rows between those two rows containing same field value of a Field 'X'. Here again, same value of that field could come on 1st and 17th row. Mean I will delete 2nd to 16th row. It could come in 7th and 19th row. Then I need to delete 8th to 18th row.

    Hi Vaibhav
    Please find the code, I hope it helps
    DATA: BEGIN OF itab OCCURS 10,
          val,
          END OF itab.
    DATA: jtab LIKE itab OCCURS 0 WITH HEADER LINE,
          l_ind1 TYPE i,
          l_ind2 TYPE i,
          l_lines TYPE i,
          l_flg.
    itab-val = 'a'.
    append itab.
    itab-val = 'b'.
    append itab.
    itab-val = 'c'.
    append itab.
    itab-val = 'd'.
    append itab.
    itab-val = 'e'.
    append itab.
    itab-val = 'f'.
    append itab.
    itab-val = 'c'.
    append itab.
    itab-val = 'g'.
    append itab.
    itab-val = 'c'.
    append itab.
    itab-val = 'h'.
    append itab.
    jtab[] = itab[].
    DESCRIBE TABLE itab[] LINES l_lines.
    LOOP AT itab.
    MOVE sy-tabix to l_ind1.
    l_ind2  = l_ind1 + 1.
    LOOP AT jtab FROM l_ind2 to l_lines WHERE val eq itab-val.
      l_ind1 = l_ind2.
      l_ind2 = sy-tabix.
      l_flg = 'X'.
      exit.
    ENDLOOP.
    IF l_flg eq 'X'.
      exit.
    ENDIF.
    ENDLOOP.
    delete itab FROM l_ind1 to l_ind2.
    LOOP AT itab.
      WRITE: /2 itab-val.
    ENDLOOP.
    Still if you want to apply this multiple values, create another internal table and store the values which have been deleted already. So before you going to delete them again you can check from these new internal table.
    Please let me know, if any issues still exists.
    Regards
    Praveen

  • The mechanism of Delete Row and Unto in program BCALV_GRID_EDIT

    Hi Experts,
        Users need to Delete/Insert/Change a row in OO ALV report and the row can be Undo when the undo button is press. I find the example program in my system and finally get a program BCALV_GRID_EDIT. Most functions in this program  meet my requirement. But I want to know what is the mechanism of the Delete/Insert and Undo function. For example, if I have delete a row in the screen, and then I press the undo button, the deleted row will be restored in the screen. But I want to know where(Internal table or soemwhere) the deleted row is stored after I press the Delete Row button, and where I can retrieve the deleted row after I press the Undo button. Please help~~
    Thanks in advance.
    Best regards
    Joe

    Hi
    1. first remove the ENDSELECT..use INTO table itab or INTO CORRESPONDING fields, Since you are joining the  more tables this will take lot of time.
    2. You are just using two fields from LIKP as selection screen  fields to fetch the so much data.
    see the table linkings apartfrom KUNNR between the tables
    LIKP-VBELN = LIPS-VBELN
    LIPS-VGBEL = VBAK-VBELN and  LIPS-VGPOS = VBAP-POSNR
    and
    VBRP-AUBEL = VBAK-VBELN and VBRP-AUPOS = VBAP-POSNR and
    VBRP-VGBEL = LIKP-VBELN  and VBRP-VGPOS = LIPS-POSNR
    use the above links and code again.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Delete row in titab

    hallow
    i have internal table with lot of data and i wont to delete row in the table
    if i find some value in field.
    like that
    loop at itab into wa_itab
    if wa_itab-field = '5'
    delete row
    endloop.
    <b>delete just the row in my itab that value in some field = 5.</b>how can i do that?
    regards

    Hi Antonio,
    Use the DELETE statement with WHERE clause.
    <b>DELETE ITAB WHERE FIELD = '5'.</b>
    It is not recommended to useDELETE statement inside LOOP...ENDLOOP.
    Check this link to know about DELETE statement
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/delete_i.htm
    Thanks,
    Vinay

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

  • Right way to delete row before insert

    I create a new row with method of ViewObject.
    Row row = viewObject.createRow();Then I want to delete this row. I found there are 4 methods. Which is the right answer?
    //1.
    row.remove();
    //2.
    row.refresh(Row.REFRESH_REMOVE_NEW_ROWS);
    //3.
    row.refresh(Row.REFRESH_FORGET_NEW_ROWS);
    //4.
    row.removeFromCollection();Thanks,

    Timo, we're having a problem when deleting as you describe, maybe you can offer some advice?
    We have a button to delete a row from an editable table, this is set to immediate=true (obviously the user should be able to skip validation when doing a delete). After deleting, if the user then clicks another button to add a new row, the values from the deleted row show in the new row :(
    If we set immediate=false this seems to fix the problem, but we then get the undesirable side effect that the user has to make sure all the values in the row are correct before it can be deleted (because the validation is firing). The user experience becomes a bit strange.

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

  • PL/SQL procedure for deleting rows

    We have to delete rows from a table by initiating parallel processes depending on no of connections, and also variable commit frequency. The procedure has to start by itself in case of failure of 1 or more parallel processes, by identifying the position where it stopped. Please some one help me what would be th elogic needed to write the [rocedure.
    Thanks in Advance
    Edited by: 864979 on Jun 9, 2011 10:02 PM

    Be careful of how this is designed and coded. It is very easy to do it horribly wrong, causing contention and problems.
    Have a look at DBMS_PARALLE_EXECUTE.
    If the package is not available on your Oracle version, then look at {message:id=1534900} for a manual approach.

  • 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 from a table

    COuld anyone tell me how to delete rows from a table which has millions of rows.
    TIA,
    Oracle user

    if you are deleting all the rows, use "truncate table" in sql*plus.
    or if you are deleting all but a handful of rows, then copy the rows you still want to a spare table, drop the original table, and rename the spare table back to the original table's name.
    hope this helps

Maybe you are looking for

  • How to disable annoying "Press Esc to exit fullscreen" message?

    Hi, every time I watch flash videos and go fullscreen, I see this annoing message in the center of the screen that blocks what I want to see in the first place. Is there any way to disable it permanently? There was a hex fix for this for older versio

  • How to call Java Validations from MDM Workflow

    We have some Java Validations which have to be triggerd from the Workflow. We do <b>NOT</b> want to use the Enrichment Framework for doing this. How can we call these Java Validations from the Workflow?

  • Can my power book g4 run on leopard????

    hey im trying to update my powerbook, i dont know to much about apple in trying to see if i cant put a new software.. My itunes wont accept my ipod my iphone. I tried updating my itunes and it said my software font allow it.. Just wanna know what kin

  • Is PrProCS3 able to encode H.264 Blu-ray file?

    It seems I overestimated the capabilities of CS3.  I have been unable to export a file to create a Blu-ray disc. System specs: 2009 Mac Pro 4,1 3.33GHz Quad core ATI Radeon HD 4870 512 (Apple) 16GB RAM 640GB HD for OS X 10.6.4, and all programs 3x 1T

  • Should I buy this computer?

    I am thinking about closing a deal on craigslist.com for a macbook pro. He is asking $1,200. Here are the specs: Intel Core 2 Duo 2.16 GHz, 15 inch display Mac OS X 10.49 2 GB ram HD capacity of 120 GB I checked the warranty and it is covered under a