Compare two tables in SAP
Hello!
I have one table in ERP6.0 system, let's say T082G that is different in DEV and in PRD system after the Upgrade. The difference is the one table has more activated radio buttons than the other one.
How can I compare the two tables and fix the problem?
Which tcode can be applied here?
Thank you very much!
regards
Thom
Hi,
Compare a contents of a table between clients.
and also, The contents of a table between two systems can be checked through the transaction OY19
Regards
Similar Messages
-
BUG? BRIDGE statement to compare two tables
Hello,
I tried to compare two tables in different dbs and remembered a post about Cross Connectin Queries
http://barrymcgillin.blogspot.com/2010/11/cross-connection-queries.html
BRIDGE temparb AS "EB05 01"
(SELECT * FROM arb)
(SELECT * FROM temparb
MINUS
SELECT * FROM arb
UNION ALL
(SELECT * FROM arb
MINUS
SELECT * FROM temparb
);I would expect to get the differences between the table arb in my current schema and the table arb alias temparb in the other db. Yet it seems, that in this case only the table in my current schema is read.
I materialize the BRIDGE table with
BRIDGE temparb AS "EB05 01"
(SELECT * FROM arb)and select the value I know to be only in the remote schema
SELECT id FROM temparb WHERE id = 2562;
SELECT id FROM arb WHERE id = 2562;Both times I get no result. I even tried to use aliases on the table, same result. Tested in 3.0 and 3.1 EA3.
Has anyone tried this before?
Regards
MarcusHi Marcus,
Have you tried it without the double quotes around the connection name?
I have a connection called
system_local
which I run the following command in
drop table testbridge_remote;
drop table testdbrige;
create table testbridge(col1 int);
insert into testbridge values (1);
insert into testbridge values (2);
insert into testbridge values (3);
commit;
I have a connection called
Connection Name With Space
which I run the following in
drop table testdbrige;
create table testbridge(col1 int);
insert into testbridge values (4);
insert into testbridge values (5);
insert into testbridge values (3);
commit;
Then in the system_local connection/worksheet I can run the following statement
BRIDGE testbridge_remote as Connection Name With Space(select * from testbridge)
+(SELECT * FROM testbridge_remote+
MINUS
SELECT * FROM testbridge
+)+
UNION ALL
+(SELECT * FROM testbridge+
MINUS
SELECT * FROM testbridge_remote
+);+
It works ok.
Returning rows in the remote table not in the local table , and rows in the local table not in the remote table .
Regards,
Dermot
SQL Developer Team. -
Compare two tables and log the difference
Hi,
I want to compare two tables and log the difference in new table with the fields as (old value,new value, column name). The column name should be the changes value columnCan you show an example?
SELECT Foo.*, Bar.*
FROM Foo
FULL OUTER JOIN
Bar
ON Foo.c1 = Bar.c1
AND Foo.c2 = Bar.c2
AND Foo.cn = Bar.cn
WHERE Foo.key IS NULL
OR Bar.key IS NULL;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
hi all,
i am using db10g.
my task is to compare two table's data for example
table1 is having
col1 col2 col3
a b c
e f g
table2 is
col4 col5 col6
a e c
e f g
so i have to compare col1 first record and col4 first record.
in otherwords first table first column first item with second table first table first value and so on.
for ex: a= a
b= e
c= c etc
how can i acheive this?
both are database tables.
i cannot use minus function because data types are different for the corresponding column
how can i compare it?
Thanks..
Edited by: user13329002 on Jan 13, 2011 1:09 AMHi,
Try this
select
case
when a.col1 = b.col1 then 'EQUAL' else 'NOT EQUAL' end column1,
case
when a.col2 = b.col2 then 'EQUAL' else 'NOT EQUAL' end column2,
case
when a.col3 = b.col3 then 'EQUAL' else 'NOT EQUAL' end column3
from (select col1,col2,col3,rownum rn from table1) a,
(select col1,col2,col3,rownum rn from table2) b where a.rn = b.rn Try to see how you order the rows of the two tables.
cheers
VT -
how to compare two tables between two systems ?
hi sravan, u can go to t/c OY19 to compare the two tables.
Choose Manual selection
Enter the name of the table that you want to compare
Choose Execute
in the next screen you have to give the description and RFC connection name which will make the link between two clients.
Regards...
Arun.
Reward points if useful. -
Comparing Two tables with 300k records and update one table
Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
Column B has same data in both the tables.
I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
I m trying to do using PLSQL Tables.
Any suggestion?
Thanks.Hi,
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
ef2019c7-080c-4475-9cf4-2cf1b1057a41 wrote:
Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
Column B has same data in both the tables.
I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
I m trying to do using PLSQL Tables.
Any suggestion?
Thanks.
Why are you trying to use PL/SQL tables? If tabl_1 and tabl_2 are regular database tables, it will be much simpler and faster just to use them.
Depending on your requirements, you can do an UPDATE or MERGE, either in SQL or in PL/SQL. -
HI,
How to compare two tables in ODI.I want to extract UNMATCHED data in the two tables without using procedures,views.Hi,
these tables has the exactly same ddl or the comparacion will be based on PK (or UK)? -
How to compare two tables in SSIS?
I am creating an SSIS package that will compare two tables and then insert data in another table.
Which tool shall I use for that? I tried to use "Conditional Split" but it looks like it only takes one table as input and not two.
These are my tables:
TABLE1
ID
Status
TABLE2
ID
Status
TABLE3
ID
STatus
I want to compare STATUS field in both tables. If Status in TABLE1 is "Pending" and in TABLE2 is "Open" then insert this record in TABLE3.You can use MERGE command , Sorry cannot test it right now.
MERGE INTO tbl3
USING (SELECT tbl2.ID, tbl2.status,tbl1.status as st1 FROM tbl1 JOIN tbl2 ON tbl1.ID=tbl2.ID) AS t ON T.ID=tbl3.ID
AND t.status='OPEN' AND t.st1='pending'
WHEN NOT MATCHED
INSERT (status) VALUES (t.status)
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Join between two tables in SAP ( actual sales vs budget sales)
I have one table with actual data sales in SAP .This table has a name CE11000
This table contain amounts about : customers ,Products, Quantity of Sales ,amount of sales ,month witch did the sales and the year.
The other table from SAP has the budget sales . This table is CE21000
This table contain the same fields : customers ,Products, Quantity of Sales ,amount of sales ,month witch did the sales and the year but all this for budget .
In the budget table ( CE21000)there are no records for a particular make if it was not budgeted to make a sale.
Sometimes i have the same problem with the actual data table (CE11000) ...I have not records witch can use to join the results for a report witch take the comparison between actual sales and budget sales.
I would like to remind you that the report should have four "dimensions"
a) year
b) month
c) customer
d) type of product
I try to use left outer join with a customer fields in two tables but i have simultaneously the field with type of product .
I want to see in one year (for example february of 2011) for one customer the type of products (quantity and anmounts) witch buy (ACTUAL) and that to compare with the corresponding data if available
Any help would appreciate
thanksHaggar
Your first query matches on two conditions BOTH being true. If there is a D and no matching E, you'll see the columns from D but none from E.
Your second query takes all Emplyees, and lines up 2 (possibly different) rows from D against each
E columns | D columns (match e.deptid=d.dept_id) | D columns (match ep_id=de_id)
So you may have any mix of:
E | D1 | D2
E | nothing | D2
nothing | D1 | D2
E | D1 | nothing
E | nothing | nothing
nothing | D1 | nothing
nothing | nothing | D2(NB I'm assuming FULL OUTER JOIN is commutative - ie the order is unimportant - but I may be wrong in which case the last row won't occur)
You will get a different number of rows (as well as different columns) in each case.
Try it!
Regards Nigel -
Compare two tables that are in XML format (xml diff)
I have two tables in XML-format and need to list differences in
1. Structure and/or
2. Content
SAP offers CL_SXIVERI_XML_COMPARATOR, but this is too simplistic for the requirement.
Any ideas or suggestions will be appreciated. Thank you!Hi Adrian,
You can convert the data from the XML file to an internal table. Once the data is in the internal table you can easily paly with it
Refer to this Wiki for details: [https://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table].
You can also check Simple Transformations as well.
Cheers,
Suhas -
Dear All,
I have two tables.
I want to compare them as one is having 5 crore records and other is having 12 lack records and table name is P and Q respectively.
I want to know that, how many records not in the table P by comparing table Q.
For that i have created a query like below:-
select distinct a from P where b is null and c not in (select a from Q).Is it correct or i should use something other.
Thanks
Edited by: BluShadow on 05-Dec-2011 11:28
removed unnecessary {noformat}{noformat} tags and put them around just the queryPlease post more details, including some example tables and data, and tell us your database version.
p.s. please only use {noformat}{noformat} tags when you're posting code/data, not for your text. -
Stored Procedure to compare two tables data
Hello,
I want to have a Stored Procedure which will compare data (only a single column) of two tables and delete the row which is not present in the second table.
For eg.,
I have got 2 tables called Table1 and Table2, which have the same column called ID(PK).
The data in Table1 is 1,2,3 and data in Table2 is 1,3. When the stored procedure runs, it has to compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to delete this row from Table1.
Thanks in advance.user11281601 wrote:
Hello,
I want to have a Stored Procedure which will compare data (only a single column) of two tables and delete the row which is not present in the second table.
For eg.,
I have got 2 tables called Table1 and Table2, which have the same column called ID(PK).
The data in Table1 is 1,2,3 and data in Table2 is 1,3. When the stored procedure runs, it has to compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to delete this row from Table1.
Thanks in advance.
delete from table1 where id_column in
(select id_column from table1
minus
select id_column from table2); -
Hi
There are two tables. One at source side and other at target side. The data first goes from source to some intermediate table and then from that intermediate table to the target table.Both the source and the target tables have same set of data.Both are partitioned on same fields Now I want to compare both tables on some fields for every record.
Can any one suggest me that what would be the best approach to do so taking care that both source and target tables have large amount of data approx. 95M rows?However, if you are using a SELECT MINUS (or similar), please consider these
issues:
1. The database does 2 full table scans for each
table. A client can do just one per table.Really?
SQL> select * from a
2 minus
3 select * from b
4 ;
Execution Plan
Plan hash value: 1035326697
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1000 | 26000 | 8 (63)| 00:00:01 |
| 1 | MINUS | | | | | |
| 2 | SORT UNIQUE | | 1000 | 13000 | 4 (25)| 00:00:01 |
| 3 | TABLE ACCESS FULL| A | 1000 | 13000 | 3 (0)| 00:00:01 |
| 4 | SORT UNIQUE | | 1000 | 13000 | 4 (25)| 00:00:01 |
| 5 | TABLE ACCESS FULL| B | 1000 | 13000 | 3 (0)| 00:00:01 |
----------------------------------------------------------------------------Looks like one FTS of each table to me.
2. The SELECT MINUS (and other techniques) doesn't
cover LOBs.LOB's can easily be dealt with by e.g. obtaining the HASH value during the comparison and then comparing HASH values. A client application would only have to do something similar or do a byte by byte or chr by chr comparison.
3. With the database, you have to wait for the end of
the query to see ANY results. A client tool can show
you diffs as it finds them.If I'm comparing the differences between tables, I'm likely to want to obtain the whole set of data anyway and store it rather than 'see' it as it comes out. I also don't want to have to wait whilst all 95 million rows of data from two tables is transported over the network to my client so that it can do a comparison on it in memory (assuming it has the memory to do it and doesn't have to use swap space). Far better that the database server does the comparison at it's end.
;) -
Comparing two tables and picking the records
I have two tables A and B. I have to compare a column ID in both table A and table B A.ID=B.ID And based on the above comparison if the match is found I need to pick the records from table A and if no match then need to pick the records from table B My problem is if I join then I will have table A and table B as one record and will be difficult to separate out. Please let me know how this can be acheived. Thnx.
I have two tables A and B. I have to compare a column ID in both table A and table B A.ID=B.ID And based on the above comparison if the match is found I need to pick the records from table A and if no match then need to pick the records from table B My problem is if I join then I will have table A and table B as one record and will be difficult to separate out. Please let me know how this can be acheived. Thnx.
-
Compares two tables S780 and S720 by material , Print the Difference value
Hi abapers,
Report which compares the two tables S780 and S720 by material
the Statistic currency value of these two tables if show the differences
the report should display only Diffrece value:
The selection should be by
Revenue country, Salesorganisation , month and version
output like this
Material Value S720 / Value S780 / currency difference should be print out.
Regards
RajHi
Use join or for all entries
then move the records into a final table
loop at itab
then get the difference.
modify the itab by transporting the difference.
Regards
Shiva
Maybe you are looking for
-
How can i sync my phone with blank itunes account
Accidentally wiped my itunes a few weeks back (hey ho) so whilst I have nothing to loose I thought I'd take the opportuninty to move my itunes to my laptop. Ive installed itunes onto laptop and know that I need to de-authorise itunes on my PC at some
-
To display text more length more than 1000
Hi, I have Ztable which has a LCHAR field of length 1000. through a program i am populating records in to this table. But i am unable to see the complete text in Se11 or se16 not even in debugger (not showing more than 132 char). Is there a way to se
-
I want to reload OS 10.3 on my ibook
I want to reload OS 10.3 but I have OS 10.4 loaded now how do I do this, the install CD will not boot up I just get a black screen when I try to boot from the 10.3 CDs. I have some software that will only run in 10.3 I need to go back
-
How do I retrieve Notes I lost during iPhone sync?
I synced my iPhone to my Macbook and now all of my OLD notes from my Macbook have been saved over top of the NEW notes that were on my phone. Both my phone and my Macbook mail now have the old versions. Is there any way to retrieve the newer versions
-
Hi strange but true. everyday i select my toolbars to be shown and the next day i need to do the work again. Ehat this problem again with 11.02