Deleting duplicate records from different data packets in BI data source.

Hi,
I am getting same (duplicate) records from different data packets in BI data source, after completion of extraction.
I tried to store key fields of the first data packet in an internal table. But this internal table is not carrying the previous data at the time of extraction of second data packet.
Is there any other way to remove duplicate records after completion of extraction.
Thanks in advance.

I did not extensively worked in BI routenes. But I recon there will be routene which will het executed before data mapping part there will be a start routene in which you can validate the existense of data before beeing passed from data source to cube.
Hope this helps,
Regards,
Murthy.

Similar Messages

  • How to delete Duplicate records from the informatica target using mapping?

    Hi, I have a scenario like below: In my mapping I have a source, which may containg unique records or duplicate records. Source and target are different tables. I have a target in my mapping which contains duplicate records. Using Mapping I have to delete the duplicate records in the target table. Target table does not contain any surrogate key. We can use target table as a look up table, but target table cannot be used as source in the mapping. We cannot use post SQL.

    Hi All, I have multiple flat files which i need to load in a single table.I did that using indirect option at session level.But need to dig out on how to populate substring of header in name column in target table. i have two columns Id and Name. in all input file I have only one column 'id' with header like H|ABCD|Date. I need to populate target like below example. File 1                                    File2     H|ABCD|Date.                      H|EFGH|Date.1                                            42                                            5  3                                            6 Target tale: Id    Name1     ABCD2     ABCD3     ABCD4     EFGH5     EFGH6     EFGH can anyone help on what should be the logic to get this data in a table in informatica.

  • To delete duplicate records from internal table

    hi friends,
    i have to delete records from internal table based on following criterion.
    total fields are 7.
    out of which  if 4 fields are same and 5th field is different,then both records must be deleted.
    in case all five fields are same,the program should do nothing.
    for example.
    if there are 3 records as follows
    a1 b1 c1 d1 e1 f g
    a1 b1 c1 d1 e2 w r
    a1 b1 c1 d1 e1 j l
    then first two records should be deleted as four fields are same but fifth(e) field differs.
    but third record should remain as it is evenif first five fields are same for first and third record.
    values of last two fields need not to be consider for deleting the records.

    LOOP AT ITAB.
      V_FILED5 = ITAB-F5. "to compare later
      V_TABIX = SY-TABIX. "used to delete if condition not matches
      READ TABLE ITAB WITH KEY F1 = ITAB-F1
                               F2 = ITAB-F2
                               F3 = ITAB-F3
                               F4 = ITAB-F4.
      IF SY-SUBRC = 0.
        IF ITAB-F5 <> V_FIELD5.
    *--both the records to be deleted,as Field5 is different.
          DELETE ITAB INDEX SY-TABIX. "deletes that record
          DELETE ITAB INDEX V_TABIX. "deletes the current record
        ENDIF.
      ENDIF.
    ENDLOOP.
    Message was edited by: Srikanth Kidambi
    added comments
    Message was edited by: Srikanth Kidambi

  • Af:query : Delete duplicate records from results manually

    Hi
    I have an ADF page with af:quey on a view object.  I have created a viewcriteria to choose few attributes from the view object.
    The view object is created manually using a sql query, where the query has joins to various other tables (it has outer joins too).
    On submit, due to one to many relationship in the joins, i am getting duplicate rows in the results.
    I am currently using 11.1.1.7.0 jDeveloper (We can't upgrade to upper versions due to other constraints of the project).  I thought the property 'Selected in Query = false' on the view object attribute would fix this problem (to eliminate duplicate rows).  But, i guess, 11.1.1.7.0 don't seem to be supporting this option.
    Hence, i was thinking of manually deleting the duplicates from the results of the af:query before displaying it to the user.
    Please let me know, if there is a better way to solve the problem, if not, how can i manually remove duplicates from the resultset before displaying the results.
    I created a new QueryLIstener method to delete the duplicates, by executing the view object, but it retruns all the records without applying the criteria.  May be i am doing something wrong.
    Please suggest the best way.
    Thanks
    Pradeep

    Hi Frank,
    I do have a distinct in my sql but due to 1->M joins i get duplicate rows.  I can avoid it only if i can unselect the attributes in the select.
    I like to display the attributes to the user to choose the criteria (which adds as a predicate to the sql).  But I would like to unselect the 1-M attributes from the results, so i get distinct rows as i have mentioned distinct in the sql.
    Is there a way to restrict duplicate rows ?
    Thanks
    Pradeep

  • Delete overlapping/duplicate records from cube

    Hi All,
    Kindly let me know how to delete overlapping requests from a cube. Actually the cube is getting loaded from varuous infosources, but there are records which get duplicated and the are not wanted , then hiow to delete the duplicate records from the cube.
    Regards,
    dola

    I think what arun is perfectly right....
    use DSO for consolidation of various requests..from diferenet infosources...
    Now load from DSO to cube...and it is very much possible...though will require little work.
    Delete duplicate records option is usually used for master data.With transacdtion data i don't think its advisable.
    Regards,
    RK

  • Deleting a record from Master data

    Hi all,
    I need some help with deleting a record from the master data.I did go to the master dta maintenance screen and selected the record to be deleted. I saved it. I received the message, "master Data record cannot be deleted".
    I then went into transaction slg1 to check for the details of the record. A message stating " Master data record XXX is being used in the cube /BIC/Dzzzyyy312.
    This record is no longer needed by the end user and was requested to be deleted. Could some one tell me if there is a possibility to delete this unused masterdata record. Your suggestions are appreciated.
    Regards!

    Hi Sumana,
       Check this...Similar Post..
    MAster data deletion throws a dump
    Hope it helps
    Srini

  • How to delete duplicate records in 10 G.

    how to delete duplicate records in 10 G.

    --Here is one way to do it using a second table 
    create table temp1
    (col1 char(1));
    --Table created.
    insert into temp1 (col1) values('A');
    insert into temp1 (col1) values('B');
    insert into temp1 (col1) values('B');
    --1 row created.
    --1 row created.
    --1 row created.
    create table temp2 as select distinct * from temp1;
    --Table created.
    --now you have a second table with no duplicates
    --truncate your old table
    truncate table temp1;
    --Table truncated.
    --and reload it with data from the new table
    insert into temp1 select * from temp2;
    --2 rows created.
    --then drop the temp2 table
    drop table temp2

  • Delete duplicate records

    Hi everyone,
    I am writing a statement to delete duplicate records in my data.
    For example:
    select identnr,datum,klokin,klokuit,count(datum)
    from fus_timesheets
    group by identnr,datum,klokin,klokuit
    having count(datum) > 1; Above code gives following result:
    IDENTNR                DATUM                     KLOKIN     KLOKUIT    COUNT(DATUM)          
    10376                  14/09/2009                                                     2                     
    10376                  16/09/2009                                                     3                     
    10376                  15/09/2009                                                    16    What i want to do is delete duplicate records, meaning that count(datum) will have a value of 1.
    I have written following code to delete duplicate records :
    declare
    type tst_type is record
        (identnr number
        ,datum varchar2(15)
        ,klokin varchar2(10)
        ,klokuit varchar2(10)
        ,aantal  number(3));
        type type_coll_tst
        is table of tst_type;
        t_tst type_coll_tst;
    begin
    select identnr,datum,klokin,klokuit,count(datum)
    bulk collect into t_tst
    from fus_timesheets
    group by identnr,datum,klokin,klokuit
    having count(datum) > 1;
    for i in 1..t_tst.count loop
    dbms_output.put_line(t_tst(i).identnr ||' '|| t_tst(i).datum||' '||t_tst(i).aantal);
    end loop;
    for i in 1..t_tst.count loop
    delete from fus_timesheets
    where identnr = t_tst(i).identnr
    and klokin = t_tst(i).klokin
    and klokuit = t_tst(i).klokuit
    and datum = t_tst(i).datum
    and rownum < t_tst(i).aantal;
    end loop;
    end;My delete statement is not working good.
    Can someone please help me with the delete part?
    Thanks,
    Diana

    Manage correctly null values:
    for i in 1..t_tst.count loop
    delete from fus_timesheets
    where identnr = t_tst(i).identnr
    and (klokin = t_tst(i).klokin or (t_tst(i).klokin is null and klokin is null))
    and (klokuit = t_tst(i).klokuit or (t_tst(i).klokuit is null and klokuit is null))
    and datum = t_tst(i).datum
    and rownum < t_tst(i).aantal;
    end loop;Max

  • Importing and Updating Non-Duplicate Records from 2 Tables

    I need some help with the code to import data from one table
    into another if it is not a duplicate or if a record has changed.
    I have 2 tables, Members and NetNews. I want to check NetNews
    and import non-duplicate records from Members into NetNews and
    update an email address in NetNews if it has changed in Members. I
    figured it could be as simple as checking Members.MembersNumber and
    Members.Email against the existance of NetNews.Email and
    Members.MemberNumber and if a record in NetNews does not exist,
    create it and if the email address in Members.email has changed,
    update it in NetNews.Email.
    Here is what I have from all of the suggestions received from
    another category last year. It is not complete, but I am stuck on
    the solution. Can someone please help me get this code working?
    Thanks!
    <cfquery datasource="#application.dsrepl#"
    name="qryMember">
    SELECT distinct Email,FirstName,LastName,MemberNumber
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    </cfquery>
    <cfquery datasource="#application.ds#"
    name="newsMember">
    SELECT distinct MemberNumber
    FROM NetNews
    </cfquery>
    <cfif
    not(listfindnocase(valuelist(newsMember.MemberNumber),qryMember.MemberNumber)
    AND isnumeric(qryMember.MemberNumber))>
    insert into NetNews (Email_address, First_Name, Last_Name,
    MemberNumber)
    values ('#trim(qryMember.Email)#',
    '#trim(qryMember.FirstName)#', '#trim(qryMember.LastName)#', '#
    trim(qryMember.MemberNumber)#')-
    </cfif>
    </cfloop>
    </cfquery>
    ------------------

    Dan,
    My DBA doesn't have the experience to help with a VIEW. Did I
    mention that these are 2 separate databases on different servers?
    This project is over a year old now and it really needs to get
    finished so I thought the import would be the easiest way to go.
    Thanks to your help, it is almost working.
    I added some additional code to check for a changed email
    address and update the NetNews database. It runs without error, but
    I don't have a way to test it right now. Can you please look at the
    code and see if it looks OK?
    I am also still getting an error on line 10 after the routine
    runs. The line that has this code: "and membernumber not in
    (<cfqueryparam list="yes"
    value="#valuelist(newsmember.membernumber)#
    cfsqltype="cf_sql_integer">)" even with the cfif that Phil
    suggested.
    <cfquery datasource="#application.ds#"
    name="newsMember">
    SELECT distinct MemberNumber, Email_Address
    FROM NetNewsTest
    </cfquery>
    <cfquery datasource="#application.dsrepl#"
    name="qryMember">
    SELECT distinct Email,FirstName,LastName,MemberNumber
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    and membernumber not in (<cfqueryparam list="yes"
    value="#valuelist(newsmember.membernumber)#"
    cfsqltype="cf_sql_integer">)
    </cfquery>
    <CFIF qryMember.recordcount NEQ 0>
    <cfloop query ="qryMember">
    <cfquery datasource="#application.ds#"
    name="newsMember">
    insert into NetNewsTest (Email_address, First_Name,
    Last_Name, MemberNumber)
    values ('#trim(qryMember.Email)#',
    '#trim(qryMember.FirstName)#', '#trim(qryMember.LastName)#', '#
    trim(qryMember.MemberNumber)#')
    </cfquery>
    </cfloop>
    </cfif>
    <cfquery datasource="#application.dsrepl#"
    name="qryEmail">
    SELECT distinct Email
    FROM members
    WHERE memberstanding <= 2 AND email IS NOT NULL AND email
    <> ' '
    and qryMember.email NEQ newsMember.email
    </cfquery>
    <CFIF qryEmail.recordcount NEQ 0>
    <cfloop query ="qryEmail">
    <cfquery datasource="#application.ds#"
    name="newsMember">
    update NetNewsTest (Email_address)
    values ('#trim(qryMember.Email)#')
    where email_address = #qryEmail.email#
    </cfquery>
    </cfloop>
    </cfif>
    Thank you again for the help.

  • How to remove duplicates records from output ?

    how to remove duplicates records from output ?  i used delete adjacent but duplicates records are coming again ..suggest me

    hi shruthi,
    thanks for ur answer ..but duplicates records coming again
    here is my code >> plz check it out
    *& Report  ZCRM_TROUBLE_TICKET
    REPORT  zcrm_trouble_ticket.
    TYPES : BEGIN OF ty_qmih,
            qmnum TYPE qmnum,
            equnr TYPE equnr,
            iloan TYPE iloan,
            ausvn TYPE ausvn,
            ausbs TYPE ausbs,
            auztv TYPE auztv,
            auztb TYPE auztb,
            iwerk TYPE iwerk,
            END OF ty_qmih,
            BEGIN OF ty_qmel,
            qmnum TYPE qmnum,
            qmtxt TYPE qmtxt,
            indtx TYPE indltx,
            priok TYPE priok,
            strmn TYPE strmn,
            strur TYPE strur,
            ltrmn TYPE ltrmn,
            ltrur TYPE ltrur,
            objnr TYPE qmobjnr,
            arbpl TYPE lgwid,
            vkorg TYPE vkorg,
            vtweg TYPE vtweg,
            spart TYPE spart,
            END OF ty_qmel,
            BEGIN OF ty_ihpa,
            parnr TYPE i_parnr,
            parvw TYPE parvw,
            objnr TYPE qmobjnr,
            END OF ty_ihpa,
            BEGIN OF ty_crhd,
            arbpl TYPE arbpl,
            objid TYPE cr_objid,
            END OF ty_crhd,
            BEGIN OF ty_crtx,
            ktext TYPE cr_ktext,
            objid TYPE cr_objid,
            END OF ty_crtx,
            BEGIN OF ty_qmfe,
            fecod TYPE fecod,
            fegrp TYPE fegrp,
            qmnum TYPE qmnum,
            END OF ty_qmfe,
            BEGIN OF ty_qmur,
            urcod TYPE urcod,
            urgrp TYPE urgrp,
            urtxt TYPE urstx,
            qmnum TYPE qmnum,
            END OF ty_qmur,
            BEGIN OF ty_iloa,
            tplnr TYPE tplnr,
            iloan TYPE iloan,
            END OF ty_iloa,
            BEGIN OF ty_output,
            qmnum TYPE qmnum,
            equnr TYPE equnr,
           iloan TYPE iloan,
            ausvn TYPE ausvn,
            ausbs TYPE ausbs,
            auztv TYPE auztv,
            auztb TYPE auztb,
            iwerk TYPE iwerk,
            qmtxt TYPE qmtxt,
            indtx TYPE indltx,
            priok TYPE priok,
            strmn TYPE strmn,
            strur TYPE strur,
            ltrmn TYPE ltrmn,
            ltrur TYPE ltrur,
           objnr TYPE qmobjnr,
           arbpl TYPE lgwid,
            vkorg TYPE vkorg,
            vtweg TYPE vtweg,
            spart TYPE spart,
            parnr TYPE i_parnr,
            parvw TYPE parvw,
            arbpl TYPE arbpl,
           objid TYPE cr_objid,
           arbpl1 TYPE arbpl,
            ktext TYPE cr_ktext,
            fecod TYPE fecod,
            fegrp TYPE fegrp,
            urcod TYPE urcod,
            urgrp TYPE urgrp,
            urtxt TYPE urstx,
            tplnr TYPE tplnr,
            END OF ty_output.
    DATA : it_qmih TYPE STANDARD TABLE OF ty_qmih,
           it_qmel TYPE STANDARD TABLE OF ty_qmel,
           it_ihpa TYPE STANDARD TABLE OF ty_ihpa,
           it_crhd TYPE STANDARD TABLE OF ty_crhd,
           it_crtx TYPE STANDARD TABLE OF ty_crtx,
           it_qmfe TYPE STANDARD TABLE OF ty_qmfe,
           it_qmur TYPE STANDARD TABLE OF ty_qmur,
           it_iloa TYPE STANDARD TABLE OF ty_iloa,
           it_output TYPE STANDARD TABLE OF ty_output,
           wa_qmih TYPE ty_qmih,
           wa_qmel TYPE ty_qmel,
           wa_ihpa TYPE ty_ihpa,
           wa_crhd TYPE ty_crhd,
           wa_crtx TYPE ty_crtx,
           wa_qmfe TYPE ty_qmfe,
           wa_qmur TYPE ty_qmur,
           wa_iloa TYPE ty_iloa,
           wa_output TYPE ty_output.
    INITIALIZATION.
      REFRESH : it_qmih,
                it_qmel,
                it_ihpa,
                it_crhd,
                it_crtx,
                it_qmfe,
                it_qmur,
                it_iloa,
                it_output.
      CLEAR:     wa_qmih,
                 wa_qmel,
                 wa_ihpa,
                 wa_crhd,
                 wa_crtx,
                 wa_qmfe,
                 wa_qmur,
                 wa_iloa,
                 wa_output.
    start-of-selection.
      SELECT  qmnum
              equnr
              iloan
              ausvn
              ausbs
              auztv
              auztb
              iwerk
              FROM qmih
              INTO  TABLE it_qmih.
      SORT it_qmih BY qmnum .
      DELETE ADJACENT DUPLICATES FROM it_qmih COMPARING qmnum equnr iloan ausvn ausbs auztv auztb iwerk.
      SELECT   qmnum
               qmtxt
               indtx
               priok
               strmn
               strur
               ltrmn
               ltrur
               objnr
               arbpl
               vkorg
               vtweg
               spart
               FROM qmel
               INTO TABLE it_qmel
               FOR ALL ENTRIES IN it_qmih
               WHERE qmnum = it_qmih-qmnum.
      SORT it_qmel BY qmnum.
      DELETE ADJACENT DUPLICATES FROM it_qmel COMPARING  qmnum
                                                         qmtxt
                                                         indtx
                                                         strmn
                                                         strur
                                                         ltrmn
                                                         ltrur
                                                         objnr
                                                         arbpl
                                                         vkorg
                                                         vtweg
                                                         spart.
      IF it_qmel IS NOT INITIAL.
        SELECT parnr
               parvw
               objnr
               FROM ihpa
               INTO TABLE it_ihpa
               FOR ALL ENTRIES IN it_qmel
               WHERE objnr = it_qmel-objnr.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_ihpa COMPARING  parnr
                                                         parvw
                                                         objnr.
      IF it_qmel IS NOT INITIAL.
        SELECT arbpl
               objid
               FROM crhd
               INTO TABLE it_crhd
               FOR ALL ENTRIES IN it_qmel
               WHERE objid = it_qmel-arbpl.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_crhd COMPARING  arbpl
                                                         objid.
      IF it_qmel IS NOT INITIAL.
        SELECT ktext
               objid
               FROM crtx
               INTO TABLE it_crtx
               FOR ALL ENTRIES IN it_crhd
               WHERE objid = it_crhd-objid.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_crtx COMPARING ktext
                                                        objid.
      IF it_qmih IS NOT INITIAL.
        SELECT fecod
               fegrp
               qmnum
               FROM qmfe
               INTO TABLE it_qmfe
               FOR ALL ENTRIES IN it_qmih
               WHERE qmnum = it_qmih-qmnum.
      ENDIF.
      SORT it_qmfe BY qmnum.
      DELETE ADJACENT DUPLICATES FROM it_qmfe COMPARING fecod
               fegrp.
      IF it_qmih IS NOT INITIAL.
        SELECT urcod
               urgrp
               urtxt
               qmnum
               FROM qmur
               INTO TABLE it_qmur
               FOR ALL ENTRIES IN it_qmih
               WHERE qmnum = it_qmih-qmnum.
      ENDIF.
      SORT it_qmur BY qmnum.
      DELETE ADJACENT DUPLICATES FROM  it_qmur COMPARING urcod
                                                         urgrp
                                                         urtxt.
      IF it_qmih IS NOT INITIAL.
        SELECT  tplnr
                iloan
                FROM iloa
                INTO TABLE it_iloa
                FOR ALL ENTRIES IN it_qmih
                WHERE iloan = it_qmih-iloan.
      ENDIF.
      DELETE ADJACENT DUPLICATES FROM it_iloa COMPARING tplnr
                                                        iloan.
      LOOP AT it_qmih INTO wa_qmih.
        wa_output-qmnum = wa_qmih-qmnum.
        wa_output-equnr = wa_qmih-equnr.
       wa_output-iloan = wa_qmih-iloan.
        wa_output-ausvn = wa_qmih-ausvn.
        wa_output-ausbs = wa_qmih-ausbs.
        wa_output-auztv = wa_qmih-auztv.
        wa_output-auztb = wa_qmih-auztb.
        wa_output-iwerk = wa_qmih-iwerk.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_qmel INTO wa_qmel WITH KEY qmnum = wa_qmih-qmnum.
        wa_output-qmtxt = wa_qmel-qmtxt.
        wa_output-indtx = wa_qmel-indtx.
        wa_output-priok = wa_qmel-priok.
        wa_output-strmn = wa_qmel-strmn.
        wa_output-strur = wa_qmel-strur.
        wa_output-ltrmn = wa_qmel-ltrmn.
        wa_output-ltrur = wa_qmel-ltrur.
       wa_output-objnr = wa_qmel-objnr.
       wa_output-arbpl = wa_qmel-arbpl.
        wa_output-vkorg = wa_qmel-vkorg.
        wa_output-vtweg = wa_qmel-vtweg.
        wa_output-spart = wa_qmel-spart.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_ihpa INTO wa_ihpa WITH KEY objnr = wa_qmel-objnr.
        wa_output-parnr = wa_ihpa-parnr.
        wa_output-parvw = wa_ihpa-parvw.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_crhd INTO wa_crhd WITH KEY objid = wa_qmel-arbpl.
        wa_output-arbpl = wa_crhd-arbpl.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_crtx INTO wa_crtx WITH KEY objid = wa_crhd-objid.
        wa_output-ktext = wa_crtx-ktext.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_qmfe INTO wa_qmfe WITH KEY qmnum = wa_qmih-qmnum.
        wa_output-fecod = wa_qmfe-fecod.
        wa_output-fegrp = wa_qmfe-fegrp.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_qmur INTO wa_qmur WITH KEY qmnum = wa_qmih-qmnum.
        wa_output-urcod = wa_qmur-urcod.
        wa_output-urgrp = wa_qmur-urgrp.
        wa_output-urtxt = wa_qmur-urtxt.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
        READ TABLE it_iloa INTO wa_iloa WITH KEY iloan = wa_qmih-iloan.
        wa_output-tplnr = wa_iloa-tplnr.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM it_output  COMPARING        qmnum
                                                                  equnr
                                                                  ausvn
                                                                  ausbs
                                                                  auztv
                                                                  auztb
                                                                  iwerk
                                                                  qmtxt
                                                                  indtx
                                                                  priok
                                                                  strmn
                                                                  strur
                                                                  ltrmn
                                                                  ltrur
                                                                  vkorg
                                                                  vtweg
                                                                  spart
                                                                  parnr
                                                                  parvw
                                                                  arbpl
                                                                  ktext
                                                                  fecod
                                                                  fegrp
                                                                  urcod
                                                                  urgrp
                                                                  urtxt
                                                                  tplnr.
    *CALL FUNCTION 'STATUS_TEXT_EDIT'
    EXPORTING
      CLIENT                  = SY-MANDT
      FLG_USER_STAT           = ' '
       objnr                   =
      ONLY_ACTIVE             = 'X'
       spras                   = en
      BYPASS_BUFFER           = ' '
    IMPORTING
      ANW_STAT_EXISTING       =
      E_STSMA                 =
      LINE                    =
      USER_LINE               =
      STONR                   =
    EXCEPTIONS
      OBJECT_NOT_FOUND        = 1
      OTHERS                  = 2
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *CALL FUNCTION 'READ_TEXT'
    EXPORTING
      CLIENT                        = SY-MANDT
       id                            =
       language                      =
       name                          =
       object                        =
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
    tables
       lines                         =
    EXCEPTIONS
      ID                            = 1
      LANGUAGE                      = 2
      NAME                          = 3
      NOT_FOUND                     = 4
      OBJECT                        = 5
      REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *LOOP AT IT_OUTPUT INTO WA_OUTPUT.
    *WRITE : / WA_OUTPUT-qmnum,
             WA_OUTPUT-equnr,
             WA_OUTPUT-iloan,
             WA_OUTPUT-ausvn,
             WA_OUTPUT-ausbs,
             WA_OUTPUT-auztv,
             WA_OUTPUT-auztb,
             WA_OUTPUT-qmtxt,
             WA_OUTPUT-indtx,
             WA_OUTPUT-strmn,
             WA_OUTPUT-strur,
             WA_OUTPUT-ltrmn,
             WA_OUTPUT-ltrur,
             WA_OUTPUT-objnr,
             WA_OUTPUT-arbpl,
             WA_OUTPUT-parnr,
             WA_OUTPUT-parvw,
             WA_OUTPUT-objid,
             WA_OUTPUT-ktext,
             WA_OUTPUT-fecod,
             WA_OUTPUT-fegrp,
             WA_OUTPUT-urcod,
             WA_OUTPUT-urgrp,
             WA_OUTPUT-urtxt,
             WA_OUTPUT-tplnr.
    *ENDLOOP.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          filename                        = 'E:\CRM1.TXT'
      FILETYPE                        = 'ASC'
      APPEND                          = ' '
         write_field_separator           = '|'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
      WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    IMPORTING
      FILELENGTH                      =
        TABLES
          data_tab                        = it_output
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • Problem in identifying unique records from different tables

    Hello gurus,
    I am on E-Recruitment module.
    I order to get more fields in CANDIDATE_ATTR datasource I have enhanced it. I am getting additional fields from HRP5103 (Employer, Employment Start Date & Employment End Date) & from HRP5104 (Institute, City, Region). In both of the tables there are 9 primary keys out of which only two are different through which we can identify duplicate records i.e. OBJID (denote Candidate ID in both tables) & SEQNR(Number of Infotype Record with Same Key).
    I know that compounding InfoObjects (since i need to pull duplicate records from table as one candidate can have many institute & employer but they will always be referred by same OBJID) is one of the way but how to manage data through compounding coming from 2 tables.
    Also i donot want to create new objects as it will effect whole of the setup.
    Is there any other way.
    Can anyone give idea as to how to get records in BW.
    Thanks in advance.

    Hi Sundar,
    Thanks for your help. I wen tthrough the two discussions and found the following:
    1. I cannot include the primary/unique keys in the selection as it would make everything distinct. This restricts me from pointing me to the exact record that has changed.
    2. The columns would be dynamic. I want a config kind of solution where i can define the tables, columns on both the sides. And add/remove compare fields in the setup tables.
    Thanks,
    Faruq.

  • Deleting duplicate records

    Hi,
    Can I know is there any way to delete the duplicate recors in the internal table?
    The code i'm using seem not working.Thanks.
    SELECT *
      INTO CORRESPONDING FIELDS
        OF TABLE  i_pa0009
         FROM pa0001 INNER JOIN pa0009
        ON pa0001pernr = pa0009pernr
        WHERE bukrs IN s_ccode AND
         bankn NE ''.
    DELETE ADJACENT DUPLICATES FROM i_pa0009 COMPARING ALL FIELDS .
    or
    How can I move the company code to the i_PA0009 table with all i_PA0009 data?
    SELECT bukrs pernr INTO TABLE i_tmp
      FROM pa0001
      WHERE bukrs IN s_ccode.
      IF NOT i_tmp[] IS INITIAL.
        DELETE ADJACENT DUPLICATES FROM i_comp.
        SELECT * INTO CORRESPONDING FIELDS OF TABLE i_pa0009
        FROM pa0009
        FOR ALL ENTRIES IN i_tmp
        WHERE pernr EQ i_tmp-pernr AND
            bankn NE ''.
    endif.

    Hi,
    Yes, I would like to delete duplicate records in i_PA0009.
    But It seem it not successful to delete all as I saw there's still remain duplicate records during the debugging.
    Below here is the code i tried.
    SELECT *
       INTO CORRESPONDING FIELDS
         OF TABLE  i_p0009
         FROM pa0001 INNER JOIN pa0009
         ON pa0001pernr = pa0009pernr
         WHERE bukrs IN s_ccode AND
         bankn NE space.
      SORT i_p0009 BY pernr.
      DELETE ADJACENT DUPLICATES FROM i_p0009 COMPARING pernr endda begda.
    Second approach.  Could anyone advise on below how i can move the bukrs from i_tmp to the i_PA0009 table with the i_PA0009 data as well.
    SELECT bukrs pernr INTO TABLE i_tmp
    FROM pa0001
    WHERE bukrs IN s_ccode.
    IF NOT i_tmp[] IS INITIAL.
    DELETE ADJACENT DUPLICATES FROM i_comp.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE i_pa0009
    FROM pa0009
    FOR ALL ENTRIES IN i_tmp
    WHERE pernr EQ i_tmp-pernr AND
    bankn NE space.
    endif.
    Edited by: Blue Sky on Feb 27, 2009 11:23 AM

  • Unable to delete double records from internal table

    Hi all,
    The internal table is like this
    begin of ta_itab1 occurs 0,
          mark type c,
          cnt_hedg type c,
          kunnr like vbak-kunnr,
          vbeln like vbak-vbeln,
          posnr like vbap-posnr,
          matnr like vbap-matnr,
          kwmeng like vbap-kwmeng,
          h_kwmeng like vbap-kwmeng,
          spart like vbap-spart,
          werks like vbap-werks,
          component like bom_item_api01-component,
          comp_qty like bom_item_api01-comp_qty,
          comp_qty1 like bom_item_api01-comp_qty,
          base_quan like stko_api02-base_quan,
          comp_unit like bom_item_api01-comp_unit,
          base_unit like bom_item_api01-comp_unit,
          bukrs_vf like vbak-bukrs_vf,
          end of ta_itab1.
    and used the sytax:
    sort ta_itab6 by kunnr vbeln.
    DELETE ADJACENT DUPLICATES FROM ta_itab6 comparing COMP_QTY COMP_QTY1.
    but Im unable to delete duplicate record .
    Thank You.
    anu

    Hi ,
    You need to use the fields in sort statement on whichyiu wnat to perform Delete Adjacent duplicates..
    sort ta_itab6 by kunnr vbeln COMP_QTY COMP_QTY1.
    DELETE ADJACENT DUPLICATES FROM ta_itab6 comparing COMP_QTY COMP_QTY1.

  • Deleting partner records from CRM order.

    Hi Experts ,
    I have a requirement where I need to delete partner record from order. For that I am using the function module 'CRM_ORDER_MAINTAIN' . This is the code that I am using but  I  am  unable  to  delete the record.
    REPORT  ZSDTESTORDER5.
    parameters: guid1 type crmd_orderadm_h-guid.
    data: guid2(32) type c.
    data: ls_new_partners type CRMT_PARTNER_COM.
    data: lt_new_partners type CRMT_PARTNER_COMT.
    data: guid type COMT_PARTNERSET_GUID.
    data: ls_input_fields type CRMT_INPUT_FIELD.
    data: lt_input_fields type CRMT_INPUT_FIELD_TAB.
    data: ls_logical_key type CRMT_LOGICAL_KEY.
    data: ls_input_field_name type CRMT_INPUT_FIELD_NAMES.
    data: IT_OBJECTS_TO_SAVE type CRMT_OBJECT_GUID_TAB.
    data: ET_OBJECTS_NOT_SAVED type CRMT_OBJECT_GUID_TAB.
    data: ET_OBJECTS_NOT_SAVED_WA type CRMT_OBJECT_GUID.
    data: IT_OBJECTS_TO_SAVE_WA type CRMT_OBJECT_GUID.
    data: txt1(42) type c.
    move guid1 to guid.
    CLEAR ls_new_partners.
    guid2 = guid1.
    ls_new_partners-ref_guid = guid.
    ls_new_partners-ref_kind = 'A'. "A
    ls_new_partners-kind_of_entry = 'C'.
    ls_new_partners-ref_partner_handle = '0000'.
    ls_new_partners-partner_fct = '00000004'.
    ls_new_partners-ref_partner_fct = '00000004'.
    ls_new_partners-partner_no  = '9000000112'.
    ls_new_partners-ref_partner_no  = '9000000112'.
    ls_new_partners-display_type = 'BP'.
    ls_new_partners-ref_display_type = 'BP'.
    ls_new_partners-no_type = 'BP'.
    ls_new_partners-MAINPARTNER =''.
    ls_new_partners-REF_HANDLE = '0000000000'.
    INSERT ls_new_partners INTO TABLE lt_new_partners.
    CLEAR ls_input_fields.
    REFRESH ls_input_fields-field_names.
    ls_input_fields-ref_guid  = ls_new_partners-ref_guid.
    ls_input_fields-ref_kind = ls_new_partners-ref_kind. "A
    ls_input_fields-objectname = 'PARTNER'.
    ls_input_fields-ref_handle = '0000000000'.
    "move ls_new_partners to ls_logical_key.
    "concatenate guid2 ls_new_partners-ref_kind ls_new_partners-kind_of_entry ls_new_partners-ref_partner_handle ls_new_partners-partner_fct ls_new_partners-partner_no ls_new_partners-display_type ls_new_partners-no_type into ls_logical_key.
    "concatenate '0000' '00000004' '9000000111' into txt1.
    "write  'BPBP' to txt1+0(28) .
    "txt1 = '0000000000049000000111      BPBP          '.
    ls_input_fields-logical_key =  '0000000000049000000112    BPBP           ' ."  '0000'  ls_logical_key.
    write:/ ls_input_fields-logical_key.
    ls_input_field_name-fieldname = 'PARTNER_FCT'.
    "ls_input_field_name-changeable = 'X'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'NO_TYPE'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'DISPLAY_TYPE'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'PARTNER_NO'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    ls_input_field_name-fieldname = 'KIND_OF_ENTRY'.
    INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    "ENDLOOP.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
      it_partner        = lt_new_partners
    CHANGING
      ct_input_fields   = lt_input_fields
    EXCEPTIONS
      error_occurred    = 1
      document_locked   = 2
      no_change_allowed = 3
      no_authority      = 4
      OTHERS            = 5.
    "CALL FUNCTION 'CRM_ORDER_INITIALIZE'
    EXPORTING
      IT_GUIDS_TO_INIT                 =
      IV_INITIALIZE_WHOLE_BUFFER       =
      IV_INIT_FRAME_LOG                =
      IV_LOG_HANDLE                    =
      IV_KEEP_LOCK                     = FALSE
    EXCEPTIONS
      ERROR_OCCURRED                   = 1
      OTHERS                           = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    commit work.
    IT_OBJECTS_TO_SAVE_WA = guid.
    append IT_OBJECTS_TO_SAVE_WA to   IT_OBJECTS_TO_SAVE.
    CALL FUNCTION 'CRM_ORDER_SAVE'
       EXPORTING
         IT_OBJECTS_TO_SAVE         = IT_OBJECTS_TO_SAVE
       IV_UPDATE_TASK_LOCAL       = FALSE
       IV_SAVE_FRAME_LOG          = FALSE
       IV_NO_BDOC_SEND            = FALSE
      IMPORTING
       ET_SAVED_OBJECTS           = ET_SAVED_OBJECTS
       ET_EXCEPTION               =
        ET_OBJECTS_NOT_SAVED       = ET_OBJECTS_NOT_SAVED
    CHANGING
       CV_LOG_HANDLE              =
    EXCEPTIONS
       DOCUMENT_NOT_SAVED         = 1
       OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    commit work.
    *loop at ET_OBJECTS_NOT_SAVED into ET_OBJECTS_NOT_SAVED_WA.
    write:/ ET_OBJECTS_NOT_SAVED_WA.
    *endloop.
    Through this code I  want  to  delete the  partner  number  '9000000112' for the partner function  '00000004'.
    But  this is not  coming. Please tell me if I  am  missing  out  something . This is  very urgent.
    Thanks & Regards,
    Samrat Dutta

    Hi Samrat Dutta,
              Looks like this FM can not be used to delete partner functions. Generally other parameter structures like appointment etc will have one field called MODE, there we give whether it is creation,change or delete mode. unfortunately for partner parameter structre CRMT_PARTNER_COM does not have MODE field in it to identify whether we are creating,chaging or deleting. i would recommond you try to find out some other FM to delete partners of Order. will let you know if i get come clue on this
    Siva

  • How to delete a record from a form

    Hello!
    I'm trying to delete a record from a table called PETS. The pet name is in a textbox from a data block called DELETE_PET.
    So i wrote in the WHEN_BUTTON_PRESSED_TRIGGER of the Delete button:
    select PETNAME into p_name from pets where PETNAME = :DELETE_PET.PETNAME;
    DELETE from PETS where PETNAME = p_name;
    clear_block(NO_VALIDATE);
    alert_id := find_alert('PET_DELETED');
    choice := Show_ALert(alert_id);
    commit;
    exception
    when NO_DATA_FOUND then
         alert_id := find_alert('PET_NOT_FOUND');
         choice := Show_ALert(alert_id);
         clear_block(NO_VALIDATE);
    rollback;
    end;
    And it's not working!!!!! :( :( :(
    Any help would be greatly appreciated!
    Thank you.

    Hi ,
    Write your trigger as....
    begin
    begin
       select PETNAME into p_name from pets where PETNAME = :DELETE_PET.PETNAME;
      exception
        when no_data_found
          then
            alert_id := find_alert('PET_NOT_FOUND');
            choice := Show_ALert(alert_id);
            clear_block(NO_VALIDATE);
            return;
    end;
    DELETE from PETS where PETNAME = p_name;
    clear_block(NO_VALIDATE);
    alert_id := find_alert('PET_DELETED');
    choice := Show_ALert(alert_id);
    commit;
    end;Question: Does your select statement return a value 'as you expect'...????
    Try to run your form in debug mode , and you may discover the deletion is not taking place.....
    Regards,
    Simon

Maybe you are looking for

  • Rv220w pptp remote connection use two ip address

                       Hello, I am a long time quick vpn user. I recently purchased a new windows 8.1 pro and the quickvpn fails. After many searches It appears this is a know issue and I should look for another way to connect. I choose to use the PPTP o

  • DME Administration in APP

    Hi Gurus, Please help me in configuring the APP in such a way where i can save the DME file, so that it can be uploaded to bank site. I want to understand the configuration and process flow. What kind of payment term and program it uses? Please rever

  • Facetime not working correctly

    I have had numerous issues since upgrading to iOS 6.1.  FaceTime is not working and sometimes my phone doesn't ring to indicate an incoming call.  Is there a problem with the new software upgrade?

  • Send file as attachment via mail

    Dear All, I want to send a report (ALV) as attachment to some mail. I am using SO_NEW_DOCUMENT_SEND_API1. Can you please suggest how can I send mail as attachment. I am able to send ALV report as HTML format. I want to send it as attachment. Thanks a

  • Mail unable to save sent messages on the server

    Dear all, i get this error when sending messages with the IMAP mail server. Mails are not copied on the server. Mail[3277]: Error (null) occurred while trying to append messages to outgoing store. Ignoring and proceeding with delivery... Everything i