Duplicate entries in table & email count
hi,,
In my selection screen i have 3 fields-
billing doc--vbeln
customer no--kunnr
email id -
when i give inputs in this selection screen fields and execute it mail is sent and
the inputs given for the fields are stored in a ZTABLE.
my requirement is if user is entering 90073336,66789 and daniel
once it gets stored in the ztable. if once again i am giving the
same input, it doesnot get stored in my ztable.
can i get duplicate entries in my ztable. if yes how?
and if my receiver mail id is daniel
no of times email count should be one.if again daniel then two.
if harry.the one.
thnx..
Hi,
please help me in that counter loop code..how to do this!!
and how to code for duplicate entries.
DATA: ITAB21 TYPE hashed TABLE OF zmailhist WITH UNIQUE key mandt vbeln kunnr,
WA LIKE LINE OF ITAB21.
WA-VBELN = P_VBELN.
INSERT WA INTO TABLE ITAB21.
WA-KUNNR = P_KUNNR.
INSERT WA INTO TABLE ITAB21.
TRANSLATE V_ID TO LOWER CASE.
CONCATENATE V_ID '@cadence.com' INTO CHAR1.
WA-UNAME = CHAR1.
INSERT WA INTO TABLE ITAB21.
WA-VSURA = SY-UZEIT.
INSERT WA INTO TABLE ITAB21.
WA-ERDAT = SY-DATUM.
INSERT WA INTO TABLE ITAB21.
IF SY-SUBRC = 0.
V_VSTAT = '0'.
ELSE.
V_VSTAT = '1'.
ENDIF.
WA-VSTAT = V_VSTAT.
INSERT WA INTO TABLE ITAB21.
WA-NAME1 = I_TAB1-EMAIL.
INSERT WA INTO TABLE ITAB21.
INSERT zmailhist FROM TABLE ITAB21 ACCEPTING DUPLICATE KEYS.
its not picking the duplicate entries..pls help
Similar Messages
-
What are these duplicate entries in table T445M ?
Hi,
In table T445M, there are records for each line in my macro - and they have AR columns blank, and RL columns with zero value. However, those same records are also duplicated - but now with R in AR columns, and 52 in RL columns (i.e. table T445M has double the number of records than the lines in my macro).
So any idea how these duplicate records get created, and what is the meaning of the values in AR & RL columns ?
Also, I see a column "Functional Module Name" - so can someone explain how to use FM in macro ?
Thanks,
- ChetanHi,
please help me in that counter loop code..how to do this!!
and how to code for duplicate entries.
DATA: ITAB21 TYPE hashed TABLE OF zmailhist WITH UNIQUE key mandt vbeln kunnr,
WA LIKE LINE OF ITAB21.
WA-VBELN = P_VBELN.
INSERT WA INTO TABLE ITAB21.
WA-KUNNR = P_KUNNR.
INSERT WA INTO TABLE ITAB21.
TRANSLATE V_ID TO LOWER CASE.
CONCATENATE V_ID '@cadence.com' INTO CHAR1.
WA-UNAME = CHAR1.
INSERT WA INTO TABLE ITAB21.
WA-VSURA = SY-UZEIT.
INSERT WA INTO TABLE ITAB21.
WA-ERDAT = SY-DATUM.
INSERT WA INTO TABLE ITAB21.
IF SY-SUBRC = 0.
V_VSTAT = '0'.
ELSE.
V_VSTAT = '1'.
ENDIF.
WA-VSTAT = V_VSTAT.
INSERT WA INTO TABLE ITAB21.
WA-NAME1 = I_TAB1-EMAIL.
INSERT WA INTO TABLE ITAB21.
INSERT zmailhist FROM TABLE ITAB21 ACCEPTING DUPLICATE KEYS.
its not picking the duplicate entries..pls help -
How to delete duplicate entries in table for the object DNL_CUST_BASIS2
Hi All,
I am trying to download the object DNL_CUST_BASIS2.
In the SMQ2 the status is SYSFAIL.
I checked in the ST22 for dumps.It says about the error while accessing the table T006.
While analysing this,i found some duplicate entries in the related tables of this object.
Can somebody help me how to delete these duplicate entries?
Thanks,
Senthil.Delete them directly from the table using se16:
select the entries in the classic view (not ALV or grid view).
activate the debugger.
press the view button. --> you'll enter in the debugger
press F7
locate the sy-ucomm variable & change it to "DELE".
press F8
delete the entries.
Trick-shots
but it works!
Michael. -
Trick to remove duplicate entries from tables ?
hi.
i have 53tables which are having duplicate entries and names of all 53 tables r listed in top_t table ?
can any1 provide me solution to show and if possible ask for remove of those duplicates entries from each table if required ?
daily i am removing duplicates manually ....its too tedious now !
can any1 help me out ?Well, I suppose if the duplication is such that
SELECT DISTINCT * FROM tablename;gives you the required result, then you could have a procedure that made a copy of the table, deleted/truncated the original, then inserted the distinct values back into it.
In 10g you could even use flashback to avoid the temp copy - but it also means you can't use TRUNCATE so whether it's any more efficient I'm not sure. But just for fun and since it's urgent:
CREATE OR REPLACE PROCEDURE dedupe_table
( p_table_name user_tables.table_name%TYPE )
IS
k_start_timestamp TIMESTAMP := SYSTIMESTAMP;
BEGIN
SAVEPOINT start_of_dedupe;
BEGIN
EXECUTE IMMEDIATE 'DELETE ' || p_table_name;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK TO start_of_dedupe;
RAISE_APPLICATION_ERROR
( -20000
, 'Error deleting ' || UPPER(p_table_name) ||
CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
, TRUE );
END;
BEGIN
EXECUTE IMMEDIATE
'INSERT INTO ' || p_table_name ||
' SELECT DISTINCT * FROM ' || p_table_name || ' AS OF TIMESTAMP :b1'
USING k_start_timestamp;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK TO start_of_dedupe;
RAISE_APPLICATION_ERROR
( -20000
, 'Error repopulating ' || UPPER(p_table_name) ||
CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
, TRUE );
END;
END dedupe_table;
SQL> select * from wr_test;
COL1 C C
1 A B
1 A B
2 C D
2 C D
4 rows selected.
SQL> BEGIN
2 dedupe_table('WR_TEST');
3 END;
4 /
PL/SQL procedure successfully completed.
SQL> select * from wr_test;
COL1 C C
1 A B
2 C D
2 rows selected.I make no claims for robustness, efficiency or human safety.
Edited by: William Robertson on Sep 24, 2009 7:12 PM -
Duplicate entries in Table T5UGJ - Garnishment notice letters printed twice
Hi Experts,
We have a scenario where duplicate entries have been created for an employee in the table T5UGJ. Hence when the notice letters were printed, they printed twice.
Would there be any specific reason or any master data change in IT 0194 / IT195 which would trigger a duplicate entry in this table?
Any information is highly appreciated.
Thanks,
Dipesh.Hi Arti,
Please find my responses below :
1. The employee has two different Creditor garnishments, one dated for June and second for July.
2. The duplicate notice letters are printed for second garnishment
Thanks,
Dipesh -
Remove duplicate entry from table
Hello all,
In my one table
File Stage log (File_Stage_Log_ID int identity(1,1),File ID int ,Quarter_Date nvarchar(50),StageID int )
have done duplicate entry by mistake on similar quarter_date
something like ..
FILE_ID
Quarter
FILE_STAGE_LOG_ID
STAGE_ID
22401
Dec-13
233091
450
22401
Dec-13
244116
420
22401
Mar-14
233095
450
22401
Mar-14
237478
405
22401
Jun-14
237479
405
22401
Jun-14
233099
450
22401
Sep-14
233102
450
22401
Sep-14
237480
405
22401
Dec-14
237481
405
22401
Dec-14
227275
420
there are too many files which have the same duplicacy ..
now , above you can see that dec -13 quarter coming twice for a single file
tell me the way to delete one entry from the table for a files
so that i have output at the end like ...
FILE_ID
Quarter
FILE_STAGE_LOG_ID
STAGE_ID
22401
Dec-13
233091
450
22401
Mar-14
233095
450
22401
Jun-14
237479
405
22401
Sep-14
233102
450
22401
Dec-14
237481
405
Please help me with easiest possible way ..
Dilip Patil..How do you determine which one out of duplicate to be kept? As per output it doesnt follow any pattern
so it may be this
--DELETE t
SELECT *
FROM
SELECT ROW_NUMBER() OVER (PARTITION BY FILE_ID,Quarter_Date ORDER BY FILE_ID) AS Rn,*
FROM FileStageLog
)t
WHERE Rn >1
Run the select above to see records to be removed and once happy uncomment the delete, comment the select * and run the query to do the delete
If it doesnt give expected records, explain on what basis you want to identify records to be deleted
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Eleminating duplicate entries in table
How to remove the duplicate entries from the tables or internal tables.
Thankyou for your time in giving the answers.
Bhaskar.Hi,
For Internal tables use,
DELETE ADJACENT DUPLICATES FROM itab.
If u want to delete the duplicate entries depending on one or 2 columns then u can use
DELETE ADJACENT DUPLICATES FROM itab COMPARING f1 f2.
Rgds,
Prakash -
Duplicate Entries in Table TBO01
Hi All,
i recently have upgrade of ERP 2005. for Info Object 0IOBJSV we
found duplicate entries for "ATY" and "COR".
"ATY" has been solved by implementation of OSS Note # 922685.
We still face problem of duplicate records for "COR".
In R/3 there are two entries "ORD" and "cor". The Extractor (Data
Source: 0IOBJSV_TEXT) pass the data to BW by converting "ORD" to "COR".
That's why we have two entries in BW for "COR" and "cor".
What would be the possible reason for above problem ? and how can i solved this ??
Will appreciate any help.Hello:
We have experienced the same problem. When I look at the table TBO01 contents on the ECC 6 server using SE16, I see one row that have mixed case "Cor" values:
SPRAS OBART OBART_LD TXT10 TXT15 TXT20 TXT60
E J2 Cor Corr.Obj. Correction Obj. Correction Object Real Estate Management - Reserved by RE
And the german one maybe also gets this "Cor" value somehow on the way to BW:
D J2 BER Ber.Objekt Bericht.objekt Berichtigungsobjekt Immobilienverwaltung - Reserved by RE
Message = @5C@ 0IOBJSV : Data record 183 ('0CorD '): Version '0Cor ' is not valid RSDMD 194 @35@
PSA shows =
Request number REQU_45HVMT8E1R8JLXBKBTY3ECQKX
Data packet number 000001
Partition value for 1
data record number 183
Language Key DE
Account Assignment O 0Cor
Medium Description Bericht.objekt
The english side is also messed up =
Request number REQU_45HVMT8E1R8JLXBKBTY3ECQKX
Data packet number 000001
Partition value for 1
Data record number 184
Language Key EN
Account Assignment O 0Cor
Medium Description Correction Obj.
@5C@ Value '0Cor ' for characteristic 0IOBJSV contains invalid characters RRSV 7
@5C@ 0IOBJSV : Data record 184 ('0CorE '): Version '0Cor ' is not valid RSDMD 194 @35@
I wonder if someone can post an OSS note for SAP to investigate
why 0Cor has mixed case values? Did someone who does data entry make
a typographical error?
Thanks,
Chris Mason -
Hi,
I am using a standard function module, BBP_GET_BOBUSERS_F4. However, after the execution, im getting duplicate entries in my table.
Please suggest cause and solution.
Thanks,
Prisford Pereira.Hi,
To remove duplicate entries try the following piece of code-
SORT the internal table entries BY <field name>.
DELETE ADJACENT DUPLICATES FROM internal table COMPARING <field name>. -
Regarding duplicate entries in table control
hi,
i have created one table control in module pool. while entering values into the table control how can we validate the table control if we enter duplicate values.ie in the first line i entered 200 500 400
again inthe second line i
entered 200 500 400.
validation should tabke place and error msg should be populated. pls help...
i have used the below code.
LOOP AT IT_TC2.
CHAIN.
FIELD:ZTC_ATMP-BUKRS,
ZTC_ATMP-LEGACCNO,
ZTC_ATMP-ZZDESKCODE,
ZTC_ATMP-SAKNR.
MODULE READ_TABLE_CONTROL.
MODULE check_duplicates ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
but here module check_duplicates is not triggering why? any idea..Hi,
you can try like this...
LOOP AT IT_TC2.
CHAIN.
FIELD ZTC_ATMP-BUKRS module CHK1.
FIELD ZTC_ATMP-LEGACCNO module CHK1.
FIELD ZTC_ATMP-ZZDESKCODE module CHK1.
FIELD ZTC_ATMP-SAKNR module CHK1.
MODULE READ_TABLE_CONTROL.
ENDCHAIN.
ENDLOOP.
Now write the validations for the corresopnding Fields in there Respective Modules.... for example Validation for ZTC_ATMP-BUKRS filed in module CHK1 and so on..
Reward if helpful.
Regards,
Syed -
Finding Duplicate Entries in a table
I have a table with the following fields in Oracle 10g.
TABLE_1
account_no | tracking_id | trans_amount
Each account_no can have multiple tracking Id's.
How do i query out the duplicate entries of account_no where tracking lies between 1 and 1000 ?
Many thanks in advance for your help,
novice.Hi,
Whenever you have a question, it helps to post a little sample data, and the results you want from that data.
You may think you're explaining clearly, but it won't be nearly as clear to someone who isn't familiar with your tables, your data, and your requirements. Sanjay and I apparantly have different ideas about what you requested, and perhaps neither is what you really want. It would be much harder for us to make mistakes and give you bad advice if you posted the data and results.
Here's my guess:
WITH got_cnt AS
SELECT table_1.*
, COUNT (*) OVER (PARTITION BY account_no)
FROM table_1
WHERE tracking_id BETWEEN 1
AND 1000
SELECT account_no, tracking_id, trans_amount
FROM got_cnt
WHERE cnt > 1
;If there are two rows with the same account_no, and both rows have tracking_id in the given range, then both rows will be displayed. -
Counting the duplicate entries without looping itab.
Hi ,
I want to count the duplicate entries in itab without looping
the itab.
can any one help me....If you just want to know the number of duplicate entries:
DATA:
zlt_itab1 TYPE ....
zlt_itab2 LIKE itab1,
zlv_lines TYPE i,
*-Copy table
zlt_itab2 = zlt_itab1
*-Sort on field to count duplicates:
SORT zlt_itab2 BY <field for counting duplicates>
*-Total number of lines:
zlv_lines = LINES( zlt_itab2).
*-Remove duplicates:
DELETE ADJACENT DUPLICATES FROM zlt_itab2.
*-Calculate number of duplicates:
zlv_lines = zlv_lines - LINES(zlt_itab1).
Regards,
John. -
Duplicate entry in AS2 EDIINT MIC table
Hi,
While sending a AS2 message to a partner, got an error saying -
Unable to create the entry in the AS2 EDIINT MIC table. This could be caused by duplicate AS2-From, AS2-To and MessageID combinations being written to the table.
MSDN says that I need to delete the duplicate entry. As this happened in Test environment, I did the same and everything fine.
But, in Production, I don't want to delete anything.
So, can somebody help me on understanding the importance of MIC table i.e how it works and when/how duplicate transactions can happen in this table?
Thanks and Regards,
SugataHi,
As the error message reads the problem is due to a deadlock situation.
http://stackoverflow.com/questions/5389261/sql-transaction-was-deadlocked
http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2012/05/16/transaction-process-id-was-deadlocked-on-resources-with-another-process-and-has-been-chosen-as-the-deadlock-victim-rerun-the-transaction.aspx
Check with the above articles in which deadlock can be identifed and removed.
Regards, Vivin.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Middleware Settings - Duplicate entries in the Table TCURC
Hi Experts,
I am doing middleware settings for integrating SAP CRM 5.0 with SAP R/3 4.7.
Before replicating the customizing objects, i found duplicate entries for ISO Codes in the table TCURC (Field name-ISOCD).
Following are those entries
MANDT WAERS ISOCD ALTWR GDATU XPRIMARY LTEXT KTEXT
949 CFP XPF 953 00.00.0000 French Franc (Pacific Islands) Fr. Frank (Pac)
949 CNY CNY 156 00.00.0000 X Chinese Renminbi Renminbi
949 DEM DEM 280 00.00.0000 X German Mark German Mark
949 DEM3 DEM 280 00.00.0000 (Internal) German Mark (3 dec.places) (Int.) DEM 3 DP
949 RMB CNY 156 00.00.0000 Chinese Yuan Renminbi Yuan Renminbi
949 USD USD 840 00.00.0000 X United States Dollar US Dollar
949 USDN USD 840 00.00.0000 (Internal) United States Dollar (5 Dec.) US Dollar
949 XPF XPF 953 00.00.0000 X CFP Franc Franc
Duplicate entries are in the third column.
Please kindly let me know what is the impact and what should i do now.
Points will be rewarded for the helpful answers.
Thanks in advance
Nadh.RHi Murali,
Thanks for your reply.
But i didnt find anything related to the issue in that note.
Do you have any other solution.
Thanks
Nadh. -
Hi everyone
I am a little confused by a situtation I have come across in one of our bespoke tables. I was under the impression that all fields in a table that are marked as Key form a Primary Key and therefore it is <b>impossible</b> to create records where these key fields contain duplciate data. However, I have found a bespoke table that is used for logging exception messages that appears to hold records with duplicates in the Key fields. Has anyone else come across this or have any idea how it might be happening? When creating a table is possible to specify a non-unique key in the same way you might for an internal table?! If it is relevant, the table is updated from a program that locks and unlocks the table before and afer the insert takes place and can be caused by both batch and manual changes.
Thanks
AndyThanks Roopesh
I understood the [ACCEPTING DUPLICATE KEYS] flag to mean that a a 'bulk' insert would not fail if a duplicate entry was identified but instead would set subrc to 4, skip the record in question and continue with subsequent records. If this is the case it still should not actually create duplciate entries - surely in doing so referential integrity is being violated...
Here is the section of code that performs the insert if that helps at all:
*lock table and insert processing log details
CALL FUNCTION 'ENQUEUE_EZLG_T024E'
EXPORTING
MODE_ZLG_T024 = 'E'
MANDT = SY-MANDT
EMPLOYER_REG_NO = zlg_t024-EMPLOYER_REG_NO
GRANT_CLAIM_NO = zlg_t024-GRANT_CLAIM_NO
ITEM = zlg_t024-ITEM
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
insert zlg_t024.
* unlock table.
CALL FUNCTION 'DEQUEUE_EZLG_T024E'
EXPORTING
MODE_ZLG_T024 = 'E'
MANDT = SY-MANDT
EMPLOYER_REG_NO = zlg_t024-EMPLOYER_REG_NO
GRANT_CLAIM_NO = zlg_t024-GRANT_CLAIM_NO
ITEM = zlg_t024-ITEM
Kind regards
Andy
Maybe you are looking for
-
Adobe Creative Cloud bleibt weiß!
Guten tag, Ich habe seit 2 Wochen ein Problem mit der Adobe Creative Cloud. Nach normalen benutzen bleibt die Creative Cloud auf einmal bei nächsten start immer weiß (siehe bild). Ich habe sie schon neu installiert mit CCleaner alles probiert aber es
-
Due to total restore on my macbook 10.6.8 I have lost imovie. Trying to download it but can only find updates, any suggestions I would be very grateful.
-
CFDirectory and renaming files
I need to rename all the files in a folder. Do I use cfdirectory to list the files and then use cffile to rename them? If so how would I go about and do this? Anthony
-
After installing Mountain Lion, mac won't let me type password to log in.
I installed mountain lion about 6 days ago and whenever i startup my computer it is really slow. Then when i go to type in my password nothing will type and i cant use the trackpad either. To be able to log in, I have to sleep my imac and then retry
-
MDM integration without Solution Manager
Hi All, I hope we can have MDM implementation without solution manager. (Please correct me if I am wrong.) Can anybody explain me the concerns if I don't have solution manager in my MDM implementation framework. Customising Steps to integrate all the