Deleteing Rows in a block

I am using Forms 6i.
I have a data block that automatically generates values for certain items. It will create insert the items into the rows of the canvas. The user can then enter the date in any number of the existing colums.
This is my pl/sql for the deleting
declare
     num number(4);
     counter number;
begin
if :system.cursor_value is null then
     last_record;
     num := get_block_property('MA31_HEM', current_record);
     first_record;
     go_item('ma31_hem.hem_dt');
     for counter in 1..num loop
          if :system.cursor_value is null then
                    delete_record;
          end if;
          next_record;
          go_item('ma31_hem.hem_dt');
     end loop;
          go_item('ma31_bio.inv');
     else
          next_item;
     end if;
end;
What i want it to do, is go through every record in the block after they leave it, and delete the records that don't have a date entered. However it is not doing anything right now

Hello Tugnutt7
11>if :system.cursor_value is null then
12>delete_record;
13>end if;
delete the records that don't have a date Try..
if ma31_hem.hem_dt is null then -- if ur date is null
delete_record;
end if;
Try to trace ur code with messages or using the debug..
Regards,
Abdetu..

Similar Messages

  • Unable to Disable Delete row option in FBCJ tcode

    Hello Sir/Madam,
                             I am giving authorizations to users, and I have given auth of FBCJ t-code to a user with create/generate and park activity codes, but I am surprised to see that delete row option is by default working in the tcode, which needs to be disabled or blocked or hidden. Kindly suggest if anything needs to be done in configuration, or from basis side.  I havent given 06  i.e delete access to this user.
    Thanks and Regards,
    Harsha
    SAP-Basis
    Clockwork Business Solutions

    Hi,
    Please refer the below link and SAP notes which might help in solving the issue. If disabling the delete option does work with standard authorization, then please take help of your ABAPER's and check if the same can be disabled using user exits.
    Note 304685 - FI Cash Journal (FBCJ): Authorizations
    Note 304984 - FBCJ: Missing/incorrect authorization checks
    Note 785283 - FBCJ: Authorization check with external call
    http://help.sap.com/saphelp_47x200/helpdata/en/95/ab201b137b11d3a6fc00104b57ed65/frameset.htm
    Regards,
    Sharath

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

  • Is it possible to delete data from a block based on a view?

    I have a data block based on a view. I have set the delete allowed property to 'yes' using the object navigator, have set the database permission to allow delete, done a search through all the code to see where the delete_allowed property on the block may be reset in some trigger yet cannot delete records from the block.
    Any ideas?

    There are at least two/three ways to do this...
    Put an on-delete trigger on the block of the view with code something like this...
    delete from mytable where mytable_id = :myblock.mytable_id;
    ...or...
    dont do the above and add an instead of trigger to the view in the database. The instead of trigger intercepts the delete statement that would fail and executes code that you write in the trigger to go delete in mytable "instead of" the view.
    ... or...
    if you want to base a block on a procedure.. See this thread... Notice the metalink id in the thread..
    Re: Data block based on a procedure..
    Message was edited by:
    Mark Reichman

  • Delete row in a table (not ALV)

    i have a table on my web-dynpro-view. I defined a delete-Button and a method with some coding.
    If the User marks a row and press the button, the row is deleted. Here's the code:
    METHOD onactioneintrag_loeschen .
      DATA:  wd_node TYPE REF TO if_wd_context_node,
             wa_temp  TYPE REF TO if_wd_context_element,
             lt_temp  TYPE wdr_context_element_set.
      wd_node = wd_context->get_child_node( name = 'LV' ).
      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.
    ENDMETHOD.
    My problem: in the context-change-log i can't identify the deleted rows. It's impossible to make a difference between a change of selection and a delete.

    Hi David,
    You can declare one attribute in the view of type ur row.
    and store the deleted row in this attribute in ur delete method.
    DATA: wd_node TYPE REF TO if_wd_context_node,
    wa_temp TYPE REF TO if_wd_context_element,
    lt_temp TYPE wdr_context_element_set.
    wd_node = wd_context->get_child_node( name = 'LV' ).
    CALL METHOD wd_node->get_selected_elements
    RECEIVING
    set = lt_temp.
    LOOP AT lt_temp INTO wa_temp.
    <Attribute_name> = wa_temp .
    wd_node->remove_element( EXPORTING element = wa_temp ).
    ENDLOOP.
    ENDMETHOD.
    Hope this will help you.
    Thanks & Regards,
    Arvind

Maybe you are looking for