Creating SAP QUERY - question about tables in buisness transactions.
Hello.
I am pretty new to SAP.
I want to create a query, as i so far have successfully done by creating a join in transaction SQVI.
I am useing several tables;
CRMD_ORDERADM_H
CRMD_ORDERADM_I
CRMD_ORDER_INDEX
I have two questions.
1: I try to join CRMD_ORDER_INDEX-PARTNER_NO with BUT000-PARTNER, but it won't do the trick. After a join like this i would like to join BUT000 with ADRC . Can someone explain how i could do this?
2: I want join CRMD_ORDERADM_I with all the partners for the specific Item. (sold-to-party, shipping-party and so on). Can anyone tell me which table(s) i can find this in, and what fields to join.
I will appreciate any answer to this
Hi,
For the second question, enter your transaction number ( Object ID ) into <b>CRMD_ORDERADM_H</b> table. Pass the guid to table <b>CRMD_LINK.</b>
Take set guid from CRMD_LINK and pass it to <b>CRMD_PARTNER</b>.
You will get all the partners in that transaction
regards,
Prashant
<b>Kindly Reward the points if helpful !</b>
Similar Messages
-
How to find the program name of the created sap query ?
how to find the program name of the created sap query ?
Hi avinash,
Try in this way..
Go to SE16 and then go to table TSTC.
in that give program name as <b>*followed by your query name</b>
(for example *TESTQUERY)
and run , that will give progname======queryname.
this way you can find program name.
vijay -
How to create sap query with "or" relationship
dear experts,
I need a report to display the employee whoese WSR is
changed in the month for infotype 0007.
that is ,we want to search with selection
begda OR endda between 2008-01-01 and 2008-01-31.
how to create sap query with "or" relationship?hi use like this,
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = p_pernr
infty = '0007'
BEGDA = p_date1
ENDDA = p_date2
TABLES
infty_tab = itab .
hi use this by passing the pernr to fm and giving the dates low and high in the p_date1 and p_date2.
loop at itab where condition.
endloop.
may it helps u,
regards,
venkat. -
how to create sap query if any one has the documentation pls foward to this mail id [email protected]
thanks
avinashcheck these links...
http://www.sap-basis-abap.com/sapquery.htm
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
http://help.sap.com/saphelp_nw04/helpdata/en/25/8f4dd72b0f9f4fa6712fcf2f65f505/frameset.htm -
HI experts, Im about to create a Sap query using SQVI tcode. I want to have listing of certain master data created in customizing(SPRO) like the catalogs and list of code groups and task codes in Service Notification. What is the best data source or the table should I use to capture this data? Or is this possible? If not, can you give me some ways how to have listing report for those information.
Hi,
Have you checked with t-code QS42 ?
Tables - QPGR, TQ15.
Regards,
Vivek -
Question about Tables: Urgent
Hi, I'm trying to create a table inside BW. The objective is to create this table so that an Oracle Administrator can "Push" or "drop" data into this table in BW. I'm currently using 2004s, so I am having quite a hard time.... What are the sequence of steps required in creating this table with the end goal of activating it so that it can be "seen" and used... How do I activate the table? Do I need to generate a datasource for this? If I do, what are the sequence of steps that I need to do for this? Much thanks....
- Beleaguered B.I.Philips:
A. Assuming that I have successfully created a table in B.I. 7, how will I check to
ensure that the table that I just created exists in the system? What are the
sequence of steps to doing this check? Will the administrator on the Oracle
side (see original question) be able to "see" this table?
When you activate the table, go to transaction Se16 and put your tablename and press f8, if the table is not active, you will get a mesage. This is a initial check.
When you create a transparant table in SAP, SAP creates automatically created a table in the database underlying. Thats why it is called transparent table.
YES. youur administrator can see the table with a SQL statement desc TABLE in the database layer.
B. Assuming that I successfully created a DataSource, how can i check to ensure
that the DataSource is indeed active and is in the System? What are the
sequence of steps to achieving this?
The last step in creating data source is to save / generate. Once generated, you can see the data source in RSA3. Run RSA3 and give the data source name and press f8, you will see the result.,
C. Is there a particular methodology or standard as to how I should create a table?
Can you point me out to a documentation or link to a "HOW TO" in creating
tables? Where exactly in the BI 7 system are the tables store.
To create a table you need something called developer key which is a long string of numbers. Check with your basis administrators and they will generate the key for you.
Once you have this, decide the structure of your table and we will take it from there.
Ravi Thothadri -
Creating SELECT query between 3 tables
Hi there,
Im trying to create a SELECT query between 3 tables and it is driving me round the bend.
I have 3 tables connected together which are:
MODUL
modulid
modulname
modulevel
STUDENT
studentid
surname
inits
s e x
phone
email
logon
STUDREGOCCUR
modulid
acyear
semester
occletter
studentid
result
I want to select the fields surname, inits, studentid from the STUDENT table, modulname from the MODUL table and result from my STUDREGOCCUR table that is NOT NULL.
I have tried SELECT STUDENT.STUDENTID, STUDENT.INITS, STUDENT.SURNAME, MODUL.MODULNAME, STUDREGOCCUR.RESULT WHERE STUDREGOCCUR.RESULT IS NOT NULL;
I have also tried many other ways and done research hwich hasnt really helped me unfortunately.
Im quite new to SELECT queries and im not sure where im going wrong, i would greatly appreciate if someone could help me solve my problem.
Thanks for the help :)
Edited by: user633643 on 06-Dec-2008 08:09If you want data from multiple tables you would need to perform a join. The general form would be:
select t1.cola, t2.col2, t3.col.x
from table_a a, table_b b, table_c c
where a.key = b.key
and b.key = c.key
or perhaps c relates back directly to a so it is a.key = c.key where key can be any column whose value is equilivent in what it represents to the value it is being compared to, that is, student_number = student_number or the columns regardless of name are both building numbers, room numbers, etc ....
This is not your exact solution but it should help.
HTH -- Mark D Powell -- -
Creating sql query using 3 tables
There is database (supposed to be relational but it is not) and
I cannot change the tables and it is very difficult to create SQL query.
Please, help!
First table T1
a1 char 20
time timestamp
a2 char 7 (the same as t2.a2 when is trimmed)
a3 number 5,0
a4 number 8,4
a5 number 7,3
Second table T2
a2 char 15
b1 number 1,0
b2 char 1,0
b3 char 4
a3 number 5,0
Third table T3
b3 char 4
c1 char 4
c2 number 7,3
c3 number 8,4
So, I need to create query (is it possible at all!?) from those 3 tables (a1, a2, b1,b2,b3, a4, a5, c2,c3
where time is within interval (from, to), a3 in interval (1,2,3,4), t2.b3=t3.b3, t1.a2=t2.a2
group by or sorted by a1, then, a2.
Any suggestion is welcome!
Thanks!
By the way, I will use this query in Crystal Reports.As I already mentioned, I received another conditions for the query, and when I create a new one, I
First table T1
a1 number 5,0
a2 char 7 (the same as t2.a2 when is trimmed)
a3 number 8,4
a4 number 7,3
a_time timestamp
Second table T2
a2 char 15
b1 number 1,0
b2 char 1,0
b3 char 4
b4 char 4
Third table T3
c1 char 4
c2 number 7,3
c3 number 8,4
b3 char 4
where if c1='MIN' c2, c3 return min values,
and if c1='MAX' c2,c3 return max values
SQL query:
select t1.a1, t1.a2, t2.b1, t2.b2, t2.b3, t1.a3, t1.a4, t3.c1,
t3.c2, t3.c3, t2.b4
from t1, t2, t3
where (TRIM(t1.a2)=TRIM(t2.a2)
and t1.a1=19
and ((to_char(t1.a_time, 'YYYY-MM-DD') >= '2006-03-15')
and (to_char(t1.a_time, 'YYYY-MM-DD') <= '2006-03-16')))
and t3.b3=t2.b3)
order by t1.a_time
Result set:
a1, a2, b1, b2, b3, a3, a4, c1('MAX'), c2', c3', b4
a1, a2, b1, b2, b3, a3, a4, c1('MIN'), c2", c3", b4
So when I executed SQL query it returns 2 rows for the same a2.
I want to get 1 row for each a2 together with c3 (c4) min and c3 (c4) max values.
How to name columns for c2 min and c2 max (the same for c3) in order to retreive 1 row per a2 value, something like this:
a1, a2, b1, b2, b3, a3, a4, c2min, c2max, c3min, c3max, b4
Thanks -
Question about table compression
I administer several 10g databases, and have been asked to compress tables in several tablespaces. I am unfamiliar with using compression. I have read some Oracle documentation on the ALTER TABLE... MOVE COMPRESSION command, but still have several questions. Can anyone recommend a good white paper, or other documentation on how best to compress tables with existing data? Thank you in advance for your guidance!
Basically, I have questions about how to select which tables will benefit from compression. I also read somewhere that, once a table has been compressed, new updates to the compressed data will not be compressed and so I will need to re-compress the tables periodically.
I also needed to know if the ALTER TABLE statement will compress the existing data or just future inserted data. Through further research I found that by using the MOVE clause, it will compress the existing data. I will also need to rebuild the indexes once the ALTER TABLE statement is complete.
Thank you for your help and encouragement! -
Question about table DR$FND_LOBS_CTX$I
All,
I have questions about this table 'DR$FND_LOBS_CTX$I'
1. What's the purpose of this table?
2. Can we purge this table? How?
3. Is there any harmful if purge this table?
Thanks,
JackieI have questions about this table 'DR$FND_LOBS_CTX$I'
1. What's the purpose of this table?There is no description about this table in MOS or eTRM -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=DR$FND_LOBS_CTX$I&c_owner=APPLSYS&c_type=TABLE
You may also check the code in $FND_TOP/sql/aflobbld.sql
2. Can we purge this table? How?
3. Is there any harmful if purge this table?Please see these docs/links.
FND_LOBS_CTX Is Having Huge Size, How To Reduce The Size Of The Index [ID 396803.1]
http://oracle-apps-dba.blogspot.com/2008/07/how-to-enable-fndhelp-search-by.html
If you could not find complete answers to your questions, I would suggest you log a SR.
Thanks,
Hussein -
Hi All,
Is there any Oracle defined table/place from where we can know the details about Tables that have been locked in the current session?
Thank you.Hi ,
To know which all objects are locked, you can use the below query :-
COLUMN owner FORMAT A20
COLUMN username FORMAT A20
COLUMN object_owner FORMAT A20
COLUMN object_name FORMAT A30
COLUMN locked_mode FORMAT A15
SELECT b.session_id AS sid,
NVL(b.oracle_username, '(oracle)') AS username,
a.owner AS object_owner,
a.object_name,
Decode(b.locked_mode, 0, 'None',
1, 'Null (NULL)',
2, 'Row-S (SS)',
3, 'Row-X (SX)',
4, 'Share (S)',
5, 'S/Row-X (SSX)',
6, 'Exclusive (X)',
b.locked_mode) locked_mode,
b.os_user_name
FROM dba_objects a,
v$locked_object b
WHERE a.object_id = b.object_id
ORDER BY 1, 2, 3, 4;Anand -
Simple question about table structure and HR in BW
i need to following data from HR:
current FTE, employee number, cost place
i dont think the current FTE is stored per employee. Therefor is would need a list that contains:
mutation start date, mutation end date, FTE, employee, cost place
i think cost place is a custom field.
my question : what tables names and field names do i need?
Thanks in advancedHi,
For Head Count you can use 0HR_PA_0 datasource and the other Employee details like start date and end date you can get them from employee master data and FTE can be calculated from the Emloyee Master Data and Head count data.
Hope this helps...
Thanks, -
Question about table logs in SAP
Hello,
What table's do the transaction codes ST03 and STAD retrieve log history files from?
Are these tables automatically logged by SAP, such as table CHDHR, or does table logging specifically have to be turned on for these table's?
Help is greatly appreciated on this. Thanks in advance,
AdamoST03 tables I believe are SAP Workload Tables. You can search SE16 for:
SAPWL*
rgds,
Babak -
Best practices for creating and querying a history table?
Suppose I have a table of name-value pairs, and I want to keep track of changes to them so that I can query the value of any pair at any point in time.
A direct approach would be to use a schema like this:
CREATE TABLE NAME_VALUE_HISTORY (
NAME VARCHAR2(...),
VALUE VARCHAR2(...),
MODIFIED DATE
);When a name-value pair is updated, a new row is added to this table with the date of the change.
To determine the value associated with a name at a particular point in time, one uses a query like:
SELECT * FROM NAME_VALUE_HISTORY
WHERE NAME = :name
AND MODIFIED IN (SELECT MAX(MODIFIED)
FROM NAME_VALUE_HISTORY
WHERE NAME = :name AND MODIFIED <= :time)My question is: is there a better way to accomplish this? What indexes/hints would you recommend?
What about a two-table approach like this one? http://pratchev.blogspot.com/2007/05/keeping-history-data-in-sql-server.html
Edited by: user10936714 on Aug 9, 2012 8:35 AMuser10936714 wrote:
There is one advantage... recording the change of a value is just one insert, and it is also atomic without the use of transactions.At the risk of being dumb, why is that an advantage? Oracle always and everywhere uses transactions so it's not like you're avoiding some overhead by not using transactions.
If, for instance, the performance of reading the value of a name at a point in time is not important, then you can get by with just using one table - the history table.If you're not overly concerned with the performance implications of having the current data and the history data in the same table, rather than rolling your own solution, I'd be strongly tempted to use Workspace Manager to let Oracle keep track of the changes.
You can create a table, enable versioning, and do whatever DML operations you'd like
SQL> create table address(
2 address_id number primary key,
3 address varchar2(100)
4 );
Table created.
SQL> exec dbms_wm.enableVersioning( 'ADDRESS', 'VIEW_WO_OVERWRITE' );
PL/SQL procedure successfully completed.
SQL> insert into address values( 1, 'First Address' );
1 row created.
SQL> commit;
Commit complete.
SQL> update address
2 set address = 'Second Address'
3 where address_id = 1;
1 row updated.
SQL> commit;
Commit complete.Then you can either query the history view
SQL> ed
Wrote file afiedt.buf
1 select address_id, address, wm_createtime
2* from address_hist
SQL> /
ADDRESS_ID ADDRESS WM_CREATETIME
1 First Address 09-AUG-12 01.48.58.566000 PM -04:00
1 Second Address 09-AUG-12 01.49.17.259000 PM -04:00Or, even cooler, you can go back to an arbitrary point in time, run a query, and see the historical information. I can go back to a point between the time that I committed the first change and the second change, query the ADDRESS view, and see the old data. This is invaluable if you want to take existing queries and/or reports and run them as of certain dates in the past when you're trying to debug a problem.
SQL> select *
2 from address;
ADDRESS_ID ADDRESS
1 First AddressYou can also do things like set savepoints which are basically named points in time that you can go back to. That lets you do things like create a savepoint for the data as soon as month-end processing is completed so you can easily go back to "July Month End" without needing to figure out exactly what time that occurred. And you can have multiple workspaces so different users can be working on completely different sets of changes simultaneously without interfering with each other. This was actually why Workspace Manager was originally created-- to allow users manipulating spatial data to have extremely long-running transactions that could span days or months-- and to be able to switch back and forth between the current live data and the data in each of these long-running scenarios.
Justin -
Question about table partitioning...
Hello, all. I'm using SQL 2012 Enterprise. I have 8 very large tables (the largest two having 227M and 118M records, and the others between 11M-44M records). For performance reasons, I'm considering partitioning the tables across multiple
files/filegroups. For my largest table (227M records), the data is spread across years 2011, 2012, and 2013 with 2013 having 104M records. So naturally I'm considering partitioning on a Date column. My question is should I go with four partitions
(2011, 2012, 2013 and 2014 for new data) and still end up with a very large aggregation of data on the 2013 partition (104M) or should I further breakdown the 2013 partition into months now having 12 partitions for 2013 alone, and then I'm OK with all
of 2011 and 2012 on their own partitions. Again, this is for one table. I'd still like to partition the other 7 large tables. In the end, I could end up with many, many partitions and hence many, many filegroups. I'm interested in how
others partition MULTIPLE large tables. Can you share partition functions/schemes across tables?
Any thoughts, your own personal experiences, etc would be greatly appreciated. Also, can someone recommend a good book, article, blog, etc on partitioning large databases.
Thanks much in advance.
RozIf you query against more than one partition I have doubts you will gain performance...
-- Create partition functions
CREATE PARTITION FUNCTION PF1(INT) AS RANGE RIGHT FOR VALUES (1, 2, 3);
CREATE PARTITION FUNCTION PF2(INT) AS RANGE RIGHT FOR VALUES (1, 2);
-- Create filegroups
ALTER DATABASE testdb ADD FILEGROUP FG7;
ALTER DATABASE testdb ADD FILEGROUP FG6;
ALTER DATABASE testdb ADD FILEGROUP FG5;
ALTER DATABASE testdb ADD FILEGROUP FG4;
ALTER DATABASE testdb ADD FILEGROUP FG3;
ALTER DATABASE testdb ADD FILEGROUP FG2;
ALTER DATABASE testdb ADD FILEGROUP FG1;
-- Create partition schemes
CREATE PARTITION SCHEME PS1 AS PARTITION PF1
TO (FG1, FG2, FG3, FG4);
CREATE PARTITION SCHEME PS2 AS PARTITION PF2
TO (FG5, FG6, FG7);
CREATE VIEW [dbo].[partition_info]
AS
SELECT
DB_NAME() AS 'DatabaseName'
,OBJECT_NAME(p.OBJECT_ID) AS 'TableName'
,p.index_id AS 'IndexId'
,CASE
WHEN p.index_id = 0 THEN 'HEAP'
ELSE i.name
END AS 'IndexName'
,p.partition_number AS 'PartitionNumber'
,prv_left.value AS 'LowerBoundary'
,prv_right.value AS 'UpperBoundary'
,ps.name as PartitionScheme
,pf.name as PartitionFunction
,CASE
WHEN fg.name IS NULL THEN ds.name
ELSE fg.name
END AS 'FileGroupName'
,CAST(p.used_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'UsedPages_MB'
,CAST(p.in_row_data_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'DataPages_MB'
,CAST(p.reserved_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'ReservedPages_MB'
,CASE
WHEN p.index_id IN (0,1) THEN p.row_count
ELSE 0
END AS 'RowCount'
,CASE
WHEN p.index_id IN (0,1) THEN 'data'
ELSE 'index'
END 'Type'
FROM sys.dm_db_partition_stats p
INNER JOIN sys.indexes i
ON i.OBJECT_ID = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN sys.data_spaces ds
ON ds.data_space_id = i.data_space_id
LEFT OUTER JOIN sys.partition_schemes ps
ON ps.data_space_id = i.data_space_id
LEFT OUTER JOIN sys.partition_functions pf
ON ps.function_id = pf.function_id
LEFT OUTER JOIN sys.destination_data_spaces dds
ON dds.partition_scheme_id = ps.data_space_id
AND dds.destination_id = p.partition_number
LEFT OUTER JOIN sys.filegroups fg
ON fg.data_space_id = dds.data_space_id
LEFT OUTER JOIN sys.partition_range_values prv_right
ON prv_right.function_id = ps.function_id
AND prv_right.boundary_id = p.partition_number
LEFT OUTER JOIN sys.partition_range_values prv_left
ON prv_left.function_id = ps.function_id
AND prv_left.boundary_id = p.partition_number - 1
WHERE
OBJECTPROPERTY(p.OBJECT_ID, 'ISMSSHipped') = 0
AND p.index_id IN (0,1)
GO
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
Maybe you are looking for
-
Essbase server does no appear in Shared Services
Hi All, I've installed and set an EPM 11.1.2.2 environment under Win 2008 server with Oracle 11g database. I've installed and configurated Essbase Server, EAS, Essbase Stdudio, APS and EIS. But when I open up shared services the Analytic Server does
-
What should you use a second SSD for?
Hi I have a few SSD drives and want to maximise the speed my Mac boots up but also in the apps I use. One of the drives is a Scratch Disk I use for FCPX. Should I keep my iTunes Library, Apps, Mail and Photos on a separate SSD to my boot drive to ma
-
Export----Ok on Solaris,but no good On Win2000
I execute the command , exp lottery/lottery@pgdb file=FC_YJBF_200307081020.dmp log=FC_YJBF_200307081020.log tables="(FC_Lottery_INFO)" query=\"WHERE \( Bet_Type , Issue_ID \) IN \(SELECT Bet_Type , Issue_ID FROM FC_CYCLE_INFO WHERE Status='1001'\)\"
-
Easy filesharing setup for local network
Hi folks, I'm currently trying to enable easy filesharing for my local network. Yesterday I installed Ubuntu 9.10 on a Laptop and it just worked. But I can't get filesharing to work under Arch (Chakra 64bit Beta 4) witch kde4. Samba is installed, the
-
Macbook crashing completely...help!
So this is a video of what recently happened to my Macbook C2D 2,1: https://www.youtube.com/watch?v=wel2JQ9UozU&feature=youtu.be I think I tried to click on something while the macbook was still ´waking up´ out of sleep (takes very long sometimes) or