Help for delete data!!!

hi,
i want to delete some data from a table and i wrote a sql query likes that
DELETE
FROM crm2.employee e
WHERE e.lastname = 'VOX'
AND length(e.loginname) >= 39
AND e.pkey NOT IN (SELECT employeegroup FROM groupmember)
AND ROWNUM < 2;
although that query deletes 1 row but it takes too much time to delete.
how can i fix that problem, i want to do that delete operation very fast.
PS: groupmember is the parent table of the crm2.employee
Thanks...

This should help you delete your data faster.
When your query takes too long ...

Similar Messages

  • F4 help for PO date field in VA01 transaction during upgrade

    Hi All,
    We are working on upgrade project 4.6c to ECC 6.
    We came across one scenario.
    F4 help for PO date field is not coming in newer version in VA01 transaction but i checked in older version it is coming F4 help for PO date(calender).
    May i know the reason regarding this.
    Any clues
    Regards
    Jai
    Edited by: Jayanth16 on Nov 12, 2009 6:14 PM
    Edited by: Jayanth16 on Nov 12, 2009 6:22 PM

    Hi,
    User did some changes in include LSDSDF05 due to that F4 help is not coming.
    So i correct that one.
    Regards
    Jai

  • Customized delta data source for deleting data record in the source system.

    Hello Gurus,
           there is a customized delta data source,  how to implement delta function for deleting data record in the source system?
    I mean if there is record deleted in the source sytem, how to notify SAP BW system for this deleting change by this customized delta
    data source?
    Many thanks.

    Hi,
    when ever record deleted we need to write the code to insert the record in  Z table load this records into BW in a cube with similar structure.while loading into this cube multiply the Keyfigure by -1.
    add this cube in the Multi Provider.The union of the records in the orginal cube and the cube having deleted records will result in zero vale and will not be displayed in report .
    Regards,

  • Help for merging data

    Hi Experts
    require your help for my one of requirements .My database is oracle 11g.table name is STG_TABLE.
    table stucture is like below
    select * from stg_tables where batch_id in('2806','2805')
    BATCH_ID     COMMITMENT_NUM     SAP_CREDITMEMO_NUM     SAP_ORDER_NUM     CREDIT_AMOUNT     SAP_CUST_NUM     RECORD_STATUS     RECORD_STATUS_MSG     HANDSHAKE_DATE
    2805     209427     81034559     30386865     34     1000035     S     Billing document successfully posted     2/13/2013 18:42
    2806     209427     85287754     40180808     60     1000035     S     Billing document successfully posted     2/13/2013 20:33
    2806     209534     85287755     40181806     60     1000037     S     Billing document successfully posted     2/13/2013 14:42
    2806     209534     85287755     40181806     90     1000037     S     Billing document successfully posted     2/13/2013 14:42here for same commitment_num column value if batch_id are different then dont have to do anything ,but if batch_id are same ,I have to merge record
    and credit_amount column value should be sum(credit_amount) and all records should be converted into one single record ..like below for above data .
    BATCH_ID     COMMITMENT_NUM     SAP_CREDITMEMO_NUM     SAP_ORDER_NUM     CREDIT_AMOUNT     SAP_CUST_NUM     RECORD_STATUS     RECORD_STATUS_MSG     HANDSHAKE_DATE     SIEBEL_PROCESS_DATE
    2805     209427     81034559     30386865     34     1000035     S     Billing document successfully posted     2/13/2013 18:42     
    2806     209427     85287754     40180808     60     1000035     S     Billing document successfully posted     2/13/2013 20:33     
    2806     209534     85287755     40181806     150     1000037     S     Billing document successfully posted     2/13/2013 14:42     Please help me on it and le me know if my requirement is not clear.
    will it be possible using merge ? ..if I think using simple cursor approce ...like take data into cursor as per below and then insert the records but when I should delete existing records then .
    CURSOR abc
          IS
             SELECT   commitment_num AS commitment_num,
                      sap_cust_num AS customer_number, batch_id AS batch_id,
                                      ----CRQ000000161235-Allow Debit-Credit both
                      -- Max(Cust_Ref_Num)           As Customer_Reference,--Commented on 30-aug-2011 madhuri,as per reqt cust-ref should be in *ctl table and invoice# should be in *adcoms table
                      COUNT (*) AS line_count,
                      --Sum(Commitment_Amount)      As Committed_Amount, -- As Per Conversation With Greg Send The Sum Of Approved Amount As Committed Amount.
                      SUM (approved_amount) AS approved_amount,
                      sales_org AS sales_org
                                     --CRQ124450 KS Canadian payments in 9AM feed
                 FROM stg_vg_credits
                WHERE TRUNC (last_update_date) <= TRUNC (SYSDATE)
                       AND siebel_process_date IS NULL and record_status='S'
                       and sales_org='2403'
                                              --CRQ000000161235-Allow Debit-Credit
             GROUP BY commitment_num, sap_cust_num, sales_org, batch_id;

    You can use MERGE to update some rows and delete others. Here's the code, then I will explain.MERGE INTO stg_tables o
    using (
      SELECT rid, rn, sum_credit_amount FROM (
        SELECT ROWID rid,
        count(*) OVER(PARTITION BY commitment_num, batch_id) cnt,
        row_number()
         over(PARTITION BY commitment_num, batch_id order by handshake_date desc) rn,
        sum(credit_amount)
         OVER(PARTITION BY commitment_num, batch_id) sum_credit_amount
        FROM stg_tables A
        WHERE batch_id IN('2806','2805')
      WHERE cnt > 1
    ) n
    ON (o.ROWID = n.rid)
    WHEN MATCHED THEN UPDATE SET credit_amount = sum_credit_amount
    delete where rn > 1;Look at the inner query in the USING clause: CNT is the number of rows having the same commitment_num and batch_id. RN numbers those rows, with 1 for the newest row. I also get the credit amount sum and the ROWID of the row.
    Now for the outer query in the USING clause: I only keep the rows with CNT > 1, because the others don't need to be merged. This is important, because you don't want to be updating rows that are already OK.
    Now the MERGE statement matches the table and my USING clause on ROWID, which can be very efficient. It updates all the rows with the new credit amount, but then it DELETEs all the rows but the most recent one.
    If you run the MERGE twice, you will see that the second time it merges "0 rows". No unnecessary updates!
    Edited by: Stew Ashton on Feb 25, 2013 9:50 AM

  • Search Help for custom data element

    Hi experts,
      I have a small question regarding accessing data on different clients.
      Can I have an abap program where I can make reference to data /tables in different client AAA, assuming the system (AAA) with data is logically connected to the client that has the ABAP Program ?
    thanks,
    Rajesh

    Thanks Ankur and Rich,
       I would like to clarify your responses.
       I have a custom field my material in SAP xRPM system( different client from R/3).  As per your previous replies, I understand it is possible to have search help for material in xRPM and validate the data with material in R/3. Is this correct? Do I need to maintain all the data in the xRPM ?
    thanks again,
    Rajesh

  • Need help for retreiving data

    Hi All,
    what i need to do is to loop through a FM when some particular checkbox is checked for each date (it is in range format) entered through the selection screen by user.
    I would like to just create one spool with all of the statements
    now how to get this date from the selection screen with all these requirements??
    useful answers will be awarded points..
    thanks

    I have solved the problem now, it may no be the best way, quite bit complex. //thanks

  • Help for "insert data to variable tables"

    hi, guys.
    I want to make a tool to upload mass-data then insert the data to tables of SAP for integrative test.
    for example, to input the object tablename "AAAA" from screen, the program willl find the information of this table then input the data to the "AAAA" tables.
    But i have no idea how to define the internal table to suit various tables ( by define dynamic table? or any other ways) ,could you kindly give me some advice?
    thanks a lot in advance.
    Message was edited by:
            huijuan zhao

    hi zhao,
    welcome to sdn,
    for your requirement u can use bdc to upload file to internal table then u can update these internal table fileds to sap tables.
    or
    use <b>gui_upload</b> function module to upload data to internal table then u can use just <b>insert</b> keyword to update sap tables.
    see this sample code to update the database table <b>edpar</b>,
    report  zsd_edpar_update no standard page heading.
    *&Purpose:
    *&        program will be used to update EDAPR table on a daily basis.
    *&        This update will be based on Customer Sold To / Ship To partner
    *&        functions assignment. Ship To customer(s) will be linked to
    *&        the appropriate Sold To customer using the ?Acct at Cust?
    *&        number as a reference.  Then, Ship To customer(s) will be
    *&        set up withthe appropriate partner function with the Sold
    *&        To customer.it updated the DB tabel and gives the information
    *&        of customer level visibility t account receivable.
    *define database tables...
    tables: edpar,
            knvv,
            knvp.
    *define types...
    types: begin of t_tab_edpar,
           mandt type mandt,
           kunnr type kunnr,
           parvw type parvw,
           expnr type edi_expnr,
           inpnr type edi_inpnr.
    types: end of t_tab_edpar.
    types: begin of t_tab_knvv,
           kunnr type kunnr,
           vkorg type vkorg,
           vtweg type vtweg,
           spart type spart,
           eikto type eikto.
    types: end of t_tab_knvv.
    types: begin of t_tab_knvp,
           kunnr type kunnr,
           vkorg type vkorg,
           vtweg type vtweg,
           spart type spart,
           parvw type parvw,
           kunn2 type kunn2.
    types: end of t_tab_knvp.
    type-pools: slis.
    *define data statments...
    data: g_tab_edpar type standard table of t_tab_edpar,
          g_wa_edpar  like line of g_tab_edpar.
    data: g_tab_edpar1 type standard table of t_tab_edpar,
          g_wa_edpar1  like line of g_tab_edpar1.
    data: g_tab_edpar2 type standard table of t_tab_edpar,
          g_wa_edpar2  like line of g_tab_edpar2.
    data: g_tab_knvv type standard table of t_tab_knvv,
          g_wa_knvv  like line of g_tab_knvv.
    data: g_tab_knvp type standard table of t_tab_knvp,
          g_wa_knvp  like line of g_tab_knvp.
    data: repid like sy-repid,
          l_tab_fieldcat  type slis_t_fieldcat_alv,
          l_tab_fieldcat1 type slis_t_fieldcat_alv,
          l_tab_fieldcat2 type slis_t_fieldcat_alv,
          layout type slis_layout_alv,
          events  type slis_t_event,
          events1 type slis_t_event,
          wa_events  like line of events,
          l_pos type i.
    *selection screen...
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_cust for knvv-kunnr obligatory,
                    s_sorg for knvv-vkorg,
                    s_dcha for knvv-vtweg,
                    s_divi for knvv-spart,
                    s_parf for knvp-parvw.
    selection-screen end of block b1.
    *start-of-selection...
    perform get_data.
    *to update the db table edpar...
    perform update_edpar.
    *display alv block...
    perform alv_block.
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data .
      select kunnr
             vkorg
             vtweg
             spart
             parvw
             kunn2
             from knvp
             into table g_tab_knvp
             where
             kunnr in s_cust
             and
             vkorg in s_sorg
             and
             vtweg in s_dcha
             and
             spart in s_divi
             and
             parvw in s_parf.
      loop at g_tab_knvp into g_wa_knvp.
        move: g_wa_knvp-kunnr to g_wa_edpar-kunnr,
              g_wa_knvp-kunn2 to g_wa_edpar-inpnr,
              g_wa_knvp-parvw to g_wa_edpar-parvw.
        append g_wa_edpar to g_tab_edpar.
      endloop.
      if not g_tab_knvp[] is initial.
        select kunnr
               vkorg
               vtweg
               spart
               eikto
               from knvv
               into table g_tab_knvv
               for all entries in g_tab_knvp
               where
               kunnr eq g_tab_knvp-kunnr
               and
               vkorg eq g_tab_knvp-vkorg
               and
               vtweg eq g_tab_knvp-vtweg
               and
               spart eq g_tab_knvp-spart.
        loop at g_tab_knvp into g_wa_knvp .
          sort g_tab_knvv by kunnr.
          clear g_wa_knvv-eikto.
          read table g_tab_knvv into g_wa_knvv with key kunnr = g_wa_knvp-kunnr.
          if sy-subrc eq 0.
            move: g_wa_knvv-eikto to g_wa_edpar-expnr.
            modify g_tab_edpar from g_wa_edpar transporting expnr where kunnr eq g_wa_knvp-kunnr.
          endif.
        endloop.
      endif.
      sort g_tab_edpar by kunnr.
      delete adjacent duplicates from g_tab_edpar comparing kunnr parvw.
    endform.                    " get_data
    *&      Form  update_edpar
          text
    -->  p1        text
    <--  p2        text
    form update_edpar .
      delete from edpar." FROM TABLE g_tab_delete.
      call function 'DB_COMMIT'.
      loop at g_tab_edpar into g_wa_edpar.
        insert into edpar values g_wa_edpar.
        if sy-subrc  eq 0.
          move-corresponding g_wa_edpar to g_wa_edpar1.
          append g_wa_edpar1 to g_tab_edpar1.
        else.
          move-corresponding g_wa_edpar to g_wa_edpar2.
          append g_wa_edpar2 to g_tab_edpar2.
        endif.
      endloop.
    reward points if helpful,
    regards,
    seshu.

  • Help for : Recover datas (Photos and Video) afert ...

    Hello
    Do someone know how to recover my data ?, I already tried recovery file tools without success.
    I make a hard reset, I was sure that hard reset don't delete Mass Storage.
    But it's not the case, I lost all my photos, and my videos. For me the built in storage was exactly a same behavior as a external SdCard.
    Thank you for your help.

    Unfortunately it cannot be done, that's why it is always adviseable to backup/sync your phone on a regular basis ! Sorry
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

  • Report help for multiple Date Select options

    Hi Friends,
    For a particular year wise report, the client wants 12 date select-options which are changeable and informal every year .The report will also be displayed as per the given date selection period wise. Please help me how to fetch the datas from the table as per the given selection period. Currently the report have one date select-option where the user gives selection range as 1.04 to 31.03. It's related to EB power consumption report and hence the new requirement on date selection which are informal and not a fixed date of every year.
    Ex:Selection-Screen
    Period 1 : 08.04.2008 to 12.05.2008
    Period 2: 12.05.2008 to 20.06.2008
    Period 3: 21.06.2008 to 28.07.2008
    Period 4: 29.07.2008 to 15.08.2008
    Period 5: 15.08.2008 to 21.09.2008
    Period 6 : 21.09.2008 to 14.10.2008
    The data will derive as per the above selection ranges.......
    Please advise with example.
    thanks & regards
    Sankar.

    >
    sankar babu wrote:
    > Ex:Selection-Screen
    > Period 1 : 08.04.2008 to 12.05.2008
    > Period 2: 12.05.2008 to 20.06.2008
    > Period 3: 21.06.2008 to 28.07.2008
    > Period 4: 29.07.2008 to 15.08.2008
    > Period 5: 15.08.2008 to 21.09.2008
    > Period 6 : 21.09.2008 to 14.10.2008
    Hi,
    In this case just derive all records matching dates between 08.04.2008 (low in first select-options) and 14.10.2008(high in last select-options.
    Also my advice is to use a single select-options and prompt the user to give the dates as ranges in the multiple entries dialog which can be opened by clicking the button on the right side of the select-options.
    Regards
    Karthik D

  • Need help for SRM Data Extraction into BI-7

    Hi Experts,
    I am looking for help regarding SRM DataSource Extraction to BW. I am working on BW project and need to extract data from SRM Data Source 0BBP_TD_CONTR_2 and 0SRM_TD_PRO. I need to know about the extraction process from SRM. Is there a tool available like LO Cockpit in SRM for extraction and how can we manage the delta in it. Or i can use the T-code RSA5 for that and follow the normal process. If I can get some documentation that can give me an idea for data extraction and delta management in SRM that would be appreciated. Any kind of help will be welcome.
    Thanks in Advance.

    SRM doesn't use kind of "cockpit" LO-like in ECC.
    Overall picture:
    http://help.sap.com/saphelp_srm40/helpdata/en/b3/cb7b401c976d1de10000000a1550b0/content.htm
    If you setup data flows accordign Business Content of SRM:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/7aeb3cad744026e10000000a11405a/frameset.htm
    Then just perform an init load and schedule the deltas.

  • Best strategy for deleting data

    For example: I should delete a lot of data from big databases. There are a lot of indexes and I know about the problem with the Bayer trees which must reorganized by the DMBS at every delete. If there a faster way to delete a big pile of data from the tables?

    Hi,
    go through the asktom post, its clearly explained.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5033906925164]
    Regards,
    Vijayaraghavan K

  • Need help for HR data migration

    Hi Experts,
         I need a help that i want to do data migration for PA30 and PP01 transactions.so if any std bapi for upload the data or bdc programs you have means let me know for further process.if early it is good for me.
    Thanks,
    Deesanth

    You can use the standard batch program RPUSTD00.  Also you can use the function module HR_INFOTYPE_OPERATION.
    Hope this is helpful.
    Thanks,
    Pavan

  • Help for configuring Data Guard Broker

    Hi All,
    Can any body help me in configuring data guard broker for oracle 9i on windows.
    What are all requirements needed. I already configured physical standby database.
    I did this is on my laptop using vm-ware. One node is having Primary database and
    second node is having standby database. Now I am planning to use DG broker on primary node.
    Regards
    Kiran

    Here's the help you need:
    http://tahiti.oracle.com.
    Without version information (what does 9i mean?) no further help is possible.
    Please also be advised that VMware is unsupported so if you run into issues you are on your own.

  • Need help for deleting XI message performance header

    Hi,
    In our production system, we are sheduling job SAP_XMB_PERF_REORG to removes all XI message performance headers (as per SAP note 820622). In this job we are using report SXMS_PF_REORG. But when are trying to execute this report, it asks for some input parameter.
    Can anybody gives us detailed information about these parameters? Below are the 5 input parameters.Also please let us know whether all these parameters are mandatory or optional.
    1. Days Until Raw Data Deletion
    2. Days Until Delete Aggregation
    3. Block Size
    4. Max Data Record No. per Select
    5. Parallelization Level
    Thanks & Regards,
    Sari

    per 5: With this parameter you can activate the built-in parallelizer. This one is deactivated per default and it was implemented for dealing with giant backlogs. If, for example, the reorganization did not run for quite some time and there are millions of data records remaining in the database, the parallizer is designed to deal with it. However, activating the parallelizer will put a high load to the database and it will also consume a large percentage of CPU resources.
    What happens in detail is this:when running this report as batch job having the parallelizer deactivated the job will simply use it's own background work process. When activating the parallelizer this background work process starts up several parallel tasks running in dialog work processes. This is pretty important as entire message processing is done in dialog work processes. Consequnently a large number of parallel reorg tasks will speedup the reorganization, but it will also impact the overall performance of message processing.
    Enter -1 to make the system default 1 active (meaning: degree of paralleization  = 1 = parallelizer off) or enter any value 2 .. 5 to activate the parallelizer and to run up to 5 reorg tasks in parallel.
    As lined out above there is no need in the normal case for setting all these parameters explicitely. Simply run the report using the default -1.
    In case you do want to use the parallelizer you should adjust the number of data records read per select (4.) to an accordingly. This number should at least be 10 times higher that the degree of parallelism (5.) multiplying by the block size (3.).
    Example: you would like to run 4 reorg tasks in parallel and each task shall delete up to 6,000 records in one go.
    Hence,
    Max Data Record No. per Select >= 10 * 4 * 6,000 = 240,000
    Here you might want to set Max Data Record No. per Select to 250,000.
    Best regards,
    Harald Keimer
    XI Development Support
    SAP AG, Walldorf

  • F4 help for the Date field in Module-Pool program

    Hi,
    I have a requirement wherein the user shud be allowed to choose a date on the calendar using F4 help and after choosing, it shud get displayed as dd.mm.yyyy format in the field. Is there any functional module to implement this.
    Thanks in Advance,
    Saranya.

    Hi,
    Please try the below code in your prgm.
    You have to write the below code in the POV of the required field.
    ***INCLUDE MZDATE_POV_DATEI01 .
    *&      Module  pov_date  INPUT
          text
    module pov_date input.
    DATA: li_ret_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
    tabname = ' '
    fieldname = ' '
    searchhelp = 'BU_DATE_CHAR'
    TABLES
    return_tab = li_ret_tab
    EXCEPTIONS
    field_not_found = 1
    no_help_for_field = 2
    inconsistent_help = 3
    no_values_found = 4
    OTHERS = 5.
    IF sy-subrc IS INITIAL.
    READ TABLE li_ret_tab INDEX 1.
    IF sy-subrc IS INITIAL.
    wrk_date = li_ret_tab-fieldval. "The required field
    ENDIF.
    ENDIF.
    endmodule.                 " pov_date  INPUT
    Hope it suits ur requirement.
    Reward points if useful.
    Thanks and regards,
    Litta.

Maybe you are looking for

  • New FIOS router, VIsta Laptop Cannot Access Internet

    I too have the new FIOS router with 75/35 speed.  I have just been trying to install the router and have been successful in getting wifi connected on two devices (Win 7 laptop and Kindle), but I cannot get my Vista laptop to access the internet.  It

  • New psu for a hp pc

    http://www.ocia.net/articles/hpmod/hpmod.shtml this gave me a good laugh

  • Opening Sony DVD in Mac OSX 10.6.4

    opening Sony DVD in Mac OSX 10.6.4 Have a Sony recorder made DVD+R I want to open on Mac. and edit in iMovie. I can open DVD on PC and on TVs but not Mac. Told I need a plug in but do not know what or how or where to get?? Any ideas? I do not know ho

  • I can't click on sign-in on one of my assignment's website

    My brother brought up this last Sunday that he can't click on a few things. I tried to go to mcgraw-hill.com website to do my homework but I can't get in. When I click on the sign-in, it doesn't click at all.

  • My home imac has crashed and will not boot up.

    Hi My home imac has crashed and will not boot up and I'm not sure where to start. It wouldn't shut down properly so I turned off the power, and now it won't go beyond the apple logo and timeer when I try to restart it. It is an imac (4 years old), In