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

Similar Messages

  • Insert row in a table (not ALV)

    Hi there,
    i know, i can insert a row in a table in 3 steps:
    1. get_static_attributes_table
    2. insert line into table
    3. bind_table
    Is there another way possible maybe one without reading the whole table?

    Hello,
    If your requirement is to add a row to the TABLE i.e. adding a context element to the context node which is bound to the TABLE, then you can do the following:
    DATA lo_nd_scarr TYPE REF TO if_wd_context_node.
    DATA lo_el_scarr TYPE REF TO if_wd_context_element.
    lo_nd_scarr = wd_context->get_child_node( name = wd_this->wdctx_scarr )."get the reference to the context node
    lo_el_scarr = lo_nd_scarr->create_element( ). "create a context element
    lo_el_scarr->set_attribute( name = 'attr_name' value = 'attr_value') "set the attributes
    lo_nd_scarr->bind_element(
    new_item = lo_el_scarr
    set_initial_elements = abap_false ). "bind the created element to the context node
    Hope this helps!
    If this is not the info which you are looking for, please revert back!
    Regards,
    Srilatha M
    Edited by: Srilatha M on Jul 23, 2010 11:31 AM

  • Insert row and delete row in a table control

    Hi Experts,
    I am using a table control in module pool programming, How can I Insert row and delete row in a table control?
    Thanks in Advance....

    Santhosh,
    Iam using this code..
    FORM fcode_delete_row
                  USING    p_tc_name           TYPE dynfnam
                           p_table_name
                           p_mark_name   .
    -BEGIN OF LOCAL DATA----
      DATA l_table_name       LIKE feld-name.
    data: p_mark_name type c.
      FIELD-SYMBOLS <tc>         TYPE cxtab_control.
      FIELD-SYMBOLS <table>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <wa>.
      FIELD-SYMBOLS <mark_field>.
    -END OF LOCAL DATA----
      ASSIGN (p_tc_name) TO <tc>.
    get the table, which belongs to the tc                               *
      CONCATENATE p_table_name '[]' INTO l_table_name. "table body
      ASSIGN (l_table_name) TO <table>.                "not headerline
    delete marked lines                                                  *
      DESCRIBE TABLE <table> LINES <tc>-lines.
      LOOP AT <table> ASSIGNING <wa>.
      access to the component 'FLAG' of the table header                 *
        ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
    if <MARK_FIELD> = 'X'.
        PERFORM f_save_confirmation_9101.
        IF gv_answer EQ '1'.
          DELETE <table> INDEX syst-tabix.
          IF sy-subrc = 0.
            <tc>-lines = <tc>-lines - 1.
          ENDIF.
          ELSE.
          ENDIF.
        ENDIF.
      ENDLOOP.
    in this code   ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
    if <MARK_FIELD> = 'X'.
    this code is not working...

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • Prevent user from deleting rows from all tables in his own schema

    Hi,
    How can I prevent user from deleting rows in all tables in his own schema.
    I want the user to not able to delete rows from any existing or new tables that might be added in the future.
    The user does not have the "DELETE ANY TABLE" system privilege.
    Please advise.
    Thanks.

    Nowadays, I'd also avoid triggers (if possible).
    Sometimes, when I daydream, I'm rewriting a few applications that I've contributed to as a newbie, and I'm very ashamed of it nowadays.
    From what I've experienced, in retrospective, the emphasis on teaching 'Oracle stuff' has been lying far too much on PL/SQL row-by-row oriented processing instead of letting Oracle 'crunch' sets at once.
    Most of my debugging hours ended up in discovering one or more database triggers 'doing stuff automagically'.
    Another nice blogpost: http://rwijk.blogspot.com/2007/09/database-triggers-are-evil.html
    Regarding OP's question:
    I would just rethink/reconsider this requirement completely.
    Correctly implementing privileges and roles seems the best way to go, yes.
    Triggers? Nah...
    pre-post-edit, noticed thread got updated just before posting
    Don't know what you mean with 'namedropping', but I think it's legitimate to point other readers to interesting Oracle related opinions/articles that do have a technical background and lots of interesting examples.
    post dreaded OTN outage edit (from here)
    Again: I would just rethink/reconsider this requirement completely.
    Both trigger/vpd are being used to hide a design flaw here.

  • 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

  • What is the keyboard shortcut for "delete row" in a table?

    What is the keyboard shortcut for "delete row" in a table within a pages document?

    Click on the row number to select the entire row. Right-click, and select Delete Row from the menu. There is no keyboard shortcut.

  • Delete row in database table

    Hi!
    Is there a way to delete row in database table by telling the number of the row?
    Thanx!

    Oh, sorry I didn't properly read your post.
    Try out what rvflannery suggests.
    But, for reference, you should always delete a row by it's unique ID.
    Don't go deleting things, by their position on a table, because a rows position can change.
    V

  • Row coloring in WD table (not ALV) based on condition

    HI All,
    I have created WD table with 8 columns
    8 Th columns is “color “   type wdui_table_cell_desgin
    All 7 are bounded to table except color.
    Depending on my condition I am passing the domain values colors
    Loop at itab into WA.
    Ex: if wa-abc = ‘ABC’.
        Wa-color = 27
    Modify statement …….
    End loop.
    I followed the below link .
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/707fb792-c181-2d10-61bd-ce15d58b5cf1?quicklink=index&overridelayout=true
    My problem is WD Table row is not coloring, any suggestion or related links
    Will be awarded. If iam in wrong way please correct me.
    Thanks
    Gopal

    Hi Gopal,
    There are two posibilities that, your Table row/cell coloring is not working
    1:
              Make sure that you have bound the columns "CellDesign" property to COLOR attribute as below
         Note: If you need to color whole ROW, then you need to bind the cellDesign of all columns to COLOR, otherwise, only respective cells gets colored.
    2. Make sure that the property "Design" of table should not be set to "ALTERNATING", because it overrides the color. Hence, set the design of table to "standard"
    Hope this resolves your issue.
    Regards,
    Rama

  • Deleting row from a table binded to a matrix

    Hi all
    i have a form with a matrix binded to a user table which is handled as a Master Data lines by UDO.
    i want to enable deleting lines from the table by selecting a row in the matrix and clicking a delete button.
    currently i'm handling the click event by usint the method DeletRow of the matrix object.
    when i press the Update button (UID = "1"). the fact that a row was deleted from the matrix does not affect the bounded table.
    my question is how in code can i cause the deletion of a row from the matrix to also be deleted from the database table?
    appreciate the help
    Yoav

    Hi Yechiel
    flushToDatasource make the following:
    Flushes current data from the GUI to the bounded data source using the following process:
    1)Cleans the data source.
    2)Copies each row from the matrix to the corresponding data source record.
    In other words: This method load data from Matrix to DataSource (but not to database)
    the next step is update database from userdatasource
    Note: You migth read sdk help for more information

  • DELETED rows from internal table

    Hi Experts,
    If I delete row/s from an internal table
    using the command DELETE ADJACENT DUPLICATES,
    is there a way to get these deleted rows.
    Thanks in advance.
    Rose

    Hi roselie,
    1. ofcourse not.
    2.hence, before that,
      u can declare another internal table,
      similar to original,
      and use like this.
    3. ITAB1[]   = ORIGINALITAB[].
    regards,
    amit m.

  • Delete Rows for a Table in VC 7.2

    I could able to delete the rows of a table some times and some times it is not clearing
    I have a button with different actions and one of the action is to clear the delete the rows of a table.
    some times it is working some times it is not.
    I am trying to get different values and populate in the table.
    Also after deleting the rows, the table is populated with old values when the other action is performed
    please advice.

    Hello,
    You can use the following workaround:
    Add the DataStore Connector to the Storyboard (from the Compose Task Panel)
    Add to this connector two fields from type Boolean (BOOL1 and BOOL2 - for example) with the Default Values  - True and False accordingly
    Create the Union operator for the first two DataServices and define the output table (for example - Union1)
    Create another Union Operator for the second two DataServices and define another output table (name it also - Union1)
    In the input table of the first DataService insert additional action for the button that fires event to get the data:
    Assign Action:
    From - none
    Value - true
    To - Data Store
    Target Field - BOOL1
    In the input table of the third DataService insert additional action for the button that fires event to get the data:
    Assign Action:
    From - none
    Value - true
    To - Data Store
    Target Field - BOOL2
    Insert the Visibility Condition for the first Union1 Table:
    =store@BOOL1
    Insert the Visibility Condition for the second Union1 Table:
    =store@BOOL2
    Add the button to the Toolabr of the first Union1 Table:
    Assign Action:
    From - none
    Value - false
    To - Data Store
    Target Field - BOOL1
    Add the button to the Toolabr of the second Union1 Table:
    Assign Action:
    From - none
    Value - false
    To - Data Store
    Target Field - BOOL2
    Hope it will be helpful
    Best Regards,
    Luba

  • Deleting Rows in a Table

    Is it possible to have a button to delete rows in a static table?  Each row is different but certain rows may not be needed depending on customer and was wondering if rows in a static table can be deleted.  Help on this is very much appreciated...thanks.

    You can surely remove Rows from Static Tables.
    The Row which the User wants to remove should satisfy the following conditions.
    1. Repeat Row for each Data Item option must be selected
    2. Min Count should be set to 0. (This will deselct the Min Count option, but no worry)
    3. Initial Count should be set to 1 (Otherwise the row will not appear in the form)
    Now, write the code to delete the row; as shown below..
    Table1._Row2.removeInstance(0);
    Hope this may helps..
    Reach me on [email protected] if you need a sample for this.
     Nith

  • Deleting rows from one table while filter condition lies into another table

    Hi All,
    I'm facing a problem deleting a row from a table where the condition lies in other table. To ealaborate the scenario further let's say I have two table T1 (transaction table) and T2 (Master Table). I want to delete a record from table T1 by checking some conditions lies in table T2.
    I tried with the below query but this query deleting records from both the table.
    DELETE FROM ( SELECT * FROM T1 top INNER JOIN T2 tp
    ON top.TID = tp.TID
    WHERE top.DEAL_SITE_ID = inputparameter1
    AND (TP.SEGMENT <>inputparameter2 OR tp.segment is not null));
    Here the record is getting deleted from both the tables but I don't want to delete data from my master table i.e table T2.
    Any help would be highly appreciated. Thanks in advance.
    Regards,
    Subhadeep

    SQL> select *
      2   from the_table;
    X          Y
    AA         a
    BB         a
    CC         a
    AA         b
    DD         b
    SQL> select *
      2   from the_table_2;
    X          Y
    AA         a
    BB         a
    CC         a
    SQL>  delete from
      2  (
      3  select *
      4  from the_table  t1 inner join the_table_2 t2
      5  on  t1.x = t2.x
      6  and t1.y = t2.y);
    3 rows deleted.
    SQL> select *
      2   from the_table;
    X          Y
    AA         b
    DD         b
    SQL> select *
      2   from the_table_2;
    X          Y
    AA         a
    BB         a
    CC         a

  • Deleting Rows From A Table After Running a Report

    I've created a report that inserts rows into a table on the asp page then calls a BI Publisher report to display the data. After running the report in BI Publisher I need to delete the rows from the table that had just been inserted. How is the best way to go about this in BI Publisher?

    The best way I know of would be to use an "afterReport trigger".
    An afterReport trigger fires after the XML output has been generated.
    Thanks,
    Bipuser

Maybe you are looking for

  • USB Devices lock-up iMac 2011

    2011 iMac 3.4Ghz i7 SSD+2TB 2GB AMD 16GB Corsair RAM I noticed I was experiencing random lock-ups and freezes during the first few weeks of owning the iMac. I went down the line of changes I made to the system. RAM Upgrade, software installs. I went

  • Flash Drive not found anymore

    After using a flash drive frequently whil creating documents on a MacBook, now the flash drive is not recognized by either the Macbook or the G5 we have. I can't check settings or anything because the comuter doesn't even register it is there, howeve

  • Landscape planning with BI and APO

    Hello all, This is more of planning question rather than issue. If you have upgraded your R/3 system first to Unicode before the BI and APO/SCM - how did you manage the interface testing within BI and APO, especially on how to avoid impact on existin

  • Problem releasing workbench transports

    We had created a number of changelists in our workbench and are trying to release these to transport them into out test system.  When we release the transports which are created without issue in the development workbench we get the following message:

  • Space for IPAD 2

    We have 3 iPads (2). All of them on one Account name. I believe that it has over excited the space on all on my Account. Ive  added extra space but still can't get anything to down load. The messages say your out of space. How do I fix this problem?