Delete lines from iternal table

Hi All!
The problem what I'm having is I have to delete
all the entries from the internal table which are
lets say equal 'XXXXXX'
regards
sas
data lt_itab type standard table of IS_PDATFU.
data wa_itab type IS_PDATFU.
data: lt_roles   type BAPIBUS1006_BPROLES  occurs 0 with header line,
      lt_return  type standard table of BAPIRET2,
      lv_partner type BU_PARTNER.
lt_itab[] = l_pdatfu_tab[].
LOOP AT lt_itab into wa_itab.
CALL FUNCTION 'BUPA_ROLES_GET_2'
  EXPORTING
    IV_PARTNER            = wa_itab-IPPERS 'PersID
  IV_PARTNER_GUID       =
  IV_DATE               = SY-DATLO
  TABLES
    ET_PARTNERROLES       = lt_roles
    ET_RETURN             = lt_return.
IF lt_roles-PARTNERROLE EQ 'XXXXXX'.
delete this lines from lt_itab[] ????
ENDIF.
ENDLOOP.

So u need to use DELETE ITAB:
LOOP AT lt_itab into wa_itab.
CALL FUNCTION 'BUPA_ROLES_GET_2'
EXPORTING
IV_PARTNER = wa_itab-IPPERS 'PersID
IV_PARTNER_GUID =
IV_DATE = SY-DATLO
TABLES
ET_PARTNERROLES = lt_roles
ET_RETURN = lt_return.
IF lt_roles-PARTNERROLE EQ 'XXXXXX'.
  delete lt_itab.
ENDIF.
ENDLOOP.
Max
Edited by: max bianchi on Feb 12, 2008 6:17 PM

Similar Messages

  • Delete lines from internal table

    Hello experts!
    I have two internal tables.
    select options sa_tknr and gt_versand_plan.
    sa_tknr-low contents transportation-Nr.
    gt_versand_plan has transportation-Nr too (gt_versand_plan-tknum).
    How can I delete all transportation-Nr from
    gt_versand_plan which dont' appear in sa_tknr-tknum.
    THX
    sas

    Hi
    check this statement.
    <b>delete gt_versand_plan where not tknum in sa_tknr.</b>
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Efficiently deleting lines from internal table based on column comparison

    Hi all,
    let's assume, I have the following internal table MY_TAB:
    COL_1 | COL_2 | COL_3
    A       1       1
    B       2       2
    C       3       3
    D       3       4
    E       3       5
    I'd like to delete all rows, where the values in COL_2 and COL_3 are equal. That is, in the above table, the rows for A, B and C.
    What's the most performant / fastest and efficient way to do this?
    Thanks for any hints in advance!
    Best regards,
    Philipp

    I do not understand other proposal.
    The are two solutions possible
    LOOP AT itab INTO wa.
       IF ( wa-col2 = wa-col3).
         DELETE itab INDEX sy-tabix.
       ENDIF.
    ENDLOOP.
    If memory is not an issue and if many lines are to be deleted, then the APPEND in a new table is better.#
    I would use that one in all cases where the conditions are complicated.
    LOOP AT itab INTO wa.
       IF ( wa-col2 <> wa-col3).
         APPEND wa TO itab2.
       ENDIF.
    ENDLOOP.
    refresh itab.
    itab[] = itab2[].
    Siegfried

  • 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

  • How To delete the Chosen line from the Table Control

    Hi Friends,
      i am new to Module Pool Programming , i developed a Table Control in input mode and i am getting data also into that table control. my requirement is that i want to delete the current chosen line from that table control. please help me out.

    HI
    GOOD
    GO THROUGH THIS REPORT
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
          ENDIF.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
    ENDLOOP.
          ENDIF.
    ENDCASE.
    ENDMODULE.
    CHANGE THE CODE AS PER THIS LIGIC.
    THANKS
    MRUTYUN

  • How can we delete a line from the table control .

    hi all
    how can we delete a line from the table control .
    situation is.
    created table control in se51 which will display the data of a table.
    how could i select a line from the table control ?
    how could i delete the selected lines form the table.
    thanks in advance

    Change the Table Control attributes such that user can only select a single record(row).
    <u>Tip to delete a selected record</u>
    1) write a module 'Mark' in the PAI as below
    PROCESS AFTER INPUT.
    MODULE cancel AT EXIT-COMMAND.
    LOOP WITH CONTROL table_view.
    MODULE read_table_control.
    FIELD flag MODULE mark ON INPUT.
    ENDLOOP.
    MODULE user_command_0100.
    2) Module Mark is below.
    MODULE mark INPUT.
    CHECK flag = 'X'.
    x = table_view-top_line + sy-stepl - 1.
    Delete itab INDEX x.
    ENDMODULE. " mark INPUT
    Table_view is the TableControl Name.
    'flag' is of type char(1) available in the Internal table which was assigned to the select option in the table control.
    <u>award if uesful</u>
    Regards,
    Sudheer

  • WSo2 BDC to delete line item in table control

    Hi all,
    My requirement is to delete material from wso2 table control.
    The only way to delete a line item in this table control is to select the line in table control and delete it.
    The recording doesnt captures any selection of row.
    Any input on how to caputre particular row ??
    Please dont send me links to work with table control in bdc
    Regards
    Bhanu

    DaveL  wrote:
      I am not aware of any way to make the BDC delete the row, other than by running in 'A'-all mode and letting the user step through each screen and delete the rows that should be deleted.
    Well , if the user has to run it in "A" all screen mode why a BDC is required
    DaveL  wrote:
    Deleting them from the table control would obviously have no effect upon the database table though, would it....it would just hide a row from view in this particular table control
    Really ? Well it will delete it from database too i dont know what makes you think that it wont be deleted from database.
    Anways i have figured out how to capture row selection in BDC .
    Thanks for your reply it proves nothing i guess

  • Delete entries from the table

    Hi folks,
    I have delete program to delete entries from a custom table and has only one feld in it.
    tables: ZABC
    selection-screen begin of block B1 with frame title text-110.
    select-options: P_KOSTL for ZABC-KOSTL.
    selection-screen end of block B1.
    delete from ZABC where KOSTL in P_KOSTL.
    Upon executing I am entering certain cost center ids on the selection screen to delete them from the table.It did not work.
    what is it I am missing?
    Thanks,
    SK

    Hi,
    Try this sample code..Replace ZABC with your table..
    TABLES: ZABC.
    selection-screen begin of block B1 with frame title text-110.
    select-options: P_KOSTL for ZABC-KOSTL.
    selection-screen end of block B1.
    START-OF-SELECTION.
    * Delete the records from the table.
    DELETE FROM ZABC where KOSTL IN P_KOSTL[ ].  " [] for the select-options.
    IF sy-subrc <> 0.
      ROLLBACK WORK.
    ELSE.
      COMMIT WORK.
    ENDIF.
    Thanks,
    Naren

  • Deleting Duplicates from a table

    Its a huge table with 52 fields and 30k rows. I need to delete the duplicates based on one of the fields. GROUP BY is taking a lot of time. Is there a quicker way to delete the duplicates using SQL.
    Thanks.

    How many duplicates have you got? Do you have even a vague idea? 1%? 20%? 90%?
    One way would be to add a unique constraint on the column in question. This will fail, of course, but you can use the EXCEPTIONS INTO clause to find all the ROWIDs which have duplicate values. You can then choose to delete those rows using a variant on teh query already posted. You may need to run %ORACLE_HOME%\rdbms\admin\utlexcptn.sql to build the EXCEPTIONS table first.
    This may seem like some unnecessary work, but the most effective way of deleting duplicates from a table is to have relational integrity constraints in place which prevent you having duplicates in the first place. To paraphrase Tim Gorman, you can't get faster than zero work!
    Cheers, APC

  • Deleting data from EDPAR table

    hi  everyone,
                               I need to delete data forom table EDPAR. two conditions are there. Once through first radio button in selection screen based on values of kunnr selected from select options. In the second case. if i select the second radio button, all data from EDPAR table gets deleted.
    Can any one offer me proper CODE  to do it....Pls help.

    SAP delivers a standard transaction to edit the contents of this table, VOE4, this is safer then using a custom code to delete rows from the table.

  • 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

  • Deleting Text from a Table

    I want to know the shortcut for deleting text from a table on a macbook pro with the latest version of Microsoft Word. I want to keep the table and it's formatting but I want the current information deleted and don't want to have to do this cell by cell. I highlight all the text I want deleted and then.........???????
    Please help, this is very frustrating!!!

    Thanks David! You are the best!

  • Deleting data from a table where there are no indexes on the table

    Hi
    We have one interface program for one time process.When I was testing the process it was taking too much time to load the data around 1000 records.
    it happens in 2 steps
    1 puts into stage table
    2 puts into base table
    in the process/package I have delete statement that deletes data from stage table before each process.
    Stage table did not have any indexes but the base table has(obvisiosly)
    any idea?
    please help me on this.
    Thanks,
    Y

    Hi,
    Please post the application/database details along with the OS.
    Is this interface program a seeded or custom one?
    Please enable trace on this concurrent program as per (Note: 296559.1 - FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12) and generate the TKPROF to find out why it takes that long to load/delete the data.
    Thanks,
    Hussein

  • Delete records from internal table

    hi all,
    i want to delete records from intenal table which are starting with a particular starting number .
    eg internal table
    10000
    20000
    90000
    91000
    92000
    88880
    i want delete the records starting with 9 i.e. 90000 91000 92000.
    Thanks in Adv
            RAJ

    You can test this piece of code.
    DATA:
    i_tab TYPE STANDARD TABLE OF mara,
    wa_tab TYPE mara.
    wa_tab-matnr = '1000'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1002'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '1003'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '2001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '3001'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    wa_tab-matnr = '4010'.
    APPEND wa_tab TO i_tab.
    CLEAR wa_tab.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Aug 8, 2008 4:49 PM

  • How to choose in Delete Duplicates from internal table?

    Now I need to delete Duplicates from internal table,
    So at first I sort
    than I delete duplicate
    Sort itab1 BY Company_Code  Asset_No Capital_Date.
          DELETE ADJACENT DUPLICATES FROM itab1 COMPARING Company_Code  Asset_No  Capital_Date
    Company_Code
    Asset_No
    Capital_Date
    Remark
    BC35
    1515593
    20021225
    Helen
    BC35
    1515593
    20021225
    Common Asset
    BC35
    1515594
    20030109
    Judy
    BC35
    1515594
    20030109
    Common Asset
    But here comes my problem~If I want to delete the Common Asset in Remark Column,how I let it choose the right one to do it?

    Hi Jack
    Try the below coding..
    Report zsamp.
    types: begin of t_tab,
            comp_code(4) type c,
            ***_no(7) type n,
            cap_date type d,
            remark type string,
            end of t_tab.
    data: i_tab type TABLE OF t_tab,
           w_tab type t_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515593'.
    w_tab-cap_date = '20021225'.
    w_tab-remark = 'Helen'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515593'.
    w_tab-cap_date = '20021225'.
    w_tab-remark = 'Common Asset'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515594'.
    w_tab-cap_date = '20030109'.
    w_tab-remark = 'Judy'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515594'.
    w_tab-cap_date = '20030109'.
    w_tab-remark = 'Common Asset'.
    append w_tab to i_tab.
    sort i_tab by remark.
    delete ADJACENT DUPLICATES FROM i_tab COMPARING remark.

Maybe you are looking for

  • Select statement in a for loop

    Hi all, Can a select stmt be used in the body of the for loop/ nested for loop ? I tries using (even if its very simple for loop) it gives the following error PL/SQL: ORA-00933: SQL command not properly ended... code is DECLARE CURSOR C1 is select 'M

  • JMS Request - Response Correlation Not Working

    Hello Experts - I am new to OAG and hence seek your expert advice. Following is our use-case scenario: 1. OAG needs to push a sample XML Message to Weblogic Request JMS Queue. In the Request tab of "Routing to Messaging System filter" I set the Corre

  • Installationfail Itunes on Windows 8 brandnew laptop

    Goodmorning, yesterday I bought a new Sony Vaio E serie laptop with windows 8. I am trying to install Itunes. This however is not as easy as I am used to. I changed popup settings and all the other things they recommended, but unfortunally nothing wo

  • Need Days in 2010 instead of Hours

    Rule X935 is giving error when Calling Time Units in variable Key I got the solution  When rule x935 was going to start its calling time units via XEINCH How to transfer that to WTUNT , Wage type units. Please let me know

  • LRT224 Load Balancing

    Hi there just wondering can the LRT224 handle load balancing a 130/7 and 107/30 connection. Thanks