Client independent select querie
Can i fetch data from two clients in a report? Can u provide the code for that or if it is not possible please give me the correct procedure to fetch the data in step by step.
thanx in advance
Shiba
Hi Rajesh ,
Your explanation for first query is not acceptable.
Eg :
Your company have 2 clients 101 ,102
You are working in Client 101.
If you write following query in client 101.
<b>select * from mara</b>
This query will bring only data from the client 101.
This will not bring data from client 102.
You must specify client number , it is needed .
Thanks & Regards
Renjith Kumar
Similar Messages
-
Which are client independent and dependent objects in SAP ABAP
which are client independent and dependent objects in SAP ABAP
Hello Jagrut
A special kind of objects are client-<u>dependent </u>repository objects. These objects have to be treated specially in the way that they have to be imported into their specific target client. In contrast, client-independent repository objects can be imported into any client.
The following list shows the client-dependent repository objects:
LIMU FSEL Field Selection
LIMU VARI Report Program System Variant
R3TR COC1 CO: Cost Centers
R3TR COC2 CO: Activity Types
R3TR FORM SAPscript form
R3TR LODS HRDSYS: Logical information object client-dep. table E SYST
R3TR PCYS HR: Transport standard personnel calculation rules
R3TR PHDS HRDSYS: physical information object client-dep. table E SYST
R3TR SBNL Logical Information Object for BDS
R3TR SBNP Logical Information Object for BDS
R3TR SBNR BDS: Relationship Between Information Objects
R3TR SBPL Logical Information Object for BDS: Bid Invitation
R3TR SBPP Physical Information Object for BDS
R3TR SBPR BDS: Relationship Between Information Objects
R3TR SBRL Logical Information Object for BDS
R3TR SBRP Physical Information Object
R3TR SBRR BDS: Relationship Between Information Objects
R3TR SBSL Logical Information Object for BDS
R3TR SBSP Physical Information Object
R3TR SBSR BDS: Relationship Between Information Objects
R3TR SBTL Logical Information Object for BDS
R3TR SBTP Physical Information Object
R3TR SBTR BDS: Relationship Between Information Objects
R3TR SBWL Logical information object for BDS
R3TR SBWP Logical information object for BDS
R3TR SBWR BDS: Relationship between information objects
R3TR SRHL SRM: Hierarchical Lists
R3TR SRLD Language-Dependent Client-Specific Retrieval Index Objekt
R3TR STYL SAPscript Style
Regards
Uwe -
Hello,
I have a following situation.
We have two clients in development server. Table TAB1 has client as primary key so we have say 100 records in client 1 & 200 records in client 2.
I would like to remove client field & make table TAB1 as client independent.
What will happen with data when I will adjust the database table, if i select KEEP data option?
How many records TAB1 will have ?
300 records (100 + 200)
OR
100 + delta between 100 & 200
Any help would be appriciated
Regards,
Sunil Joyoushi Sunil,
you have to run Database Uitlity (SE14) and it will clean up your data acc. to the new table key. This means, if there is any duplication between the two clients, the duplicate entries will be deleted automtically (i. e. reduced to one entry).
Just give it a try!
hope this helps
ec -
High CPU load on Oracle when executing SELECT queries on TT
Hello. I have cache grid: 2 TT instances + Oracle with global dynamic async write cache group on single table with 1million entries. Each cache grid instance is located on its own host. I start performance test executing only SELECT queries on TT instances. At this time I see that Oracle process starts extensively consuming CPU time. According to documentation (if I get it right) all db reads are executed between TT instances. What is Oracle doing when I perform select from TT? In case we scale horizontally by adding TT instances won't Oracle become a bottleneck?
-bash-3.2$ ttVersion
TimesTen Release 11.2.1.8.0 (64 bit Linux/x86_64) (tt1121:53388) 2011-02-02T02:20:46Z
Instance admin: amironenko
Instance home directory: /opt/TimesTen/tt1121
World accessible
Daemon home directory: /opt/TimesTen/tt1121/info
PL/SQL enabled.
I create cache group as:
REATE DYNAMIC ASYNCHRONOUS WRITETHROUGH GLOBAL CACHE GROUP ttGroup
FROM tengri.sub (
id integer not null primary key,
msisdn varchar(32) not null,
name varchar (64),
balance integer,
short_num varchar (32),
address varchar (512),
type integer not null,
is_locked integer not null,
charging_profile_id integer,
cos_id integer,
currency_id integer,
language_id integer
create unique index idx_sub_msisdn on sub ( msisdn );
I perform SELECT query as the following:
if (readPs == null) {
String sqlQuery = "SELECT id, msisdn, name, balance, short_num, address, type, is_locked, " +
"charging_profile_id, cos_id, currency_id, language_id FROM sub WHERE msisdn = ?";
readPs = con.prepareStatement(sqlQuery, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
readPs.setString(1, key);
ResultSet rs = readPs.executeQuery();
1million entries were provisioned via TT so I assume it's already there. I have 2 clients. Each one is connected to local TT instance. They read data from the same range so I assume there is a lot of data movement between TT instances. No specific value was set for PassThrough.
I'll provide "ttIsql 'monitor'" information as soon as possible, can't perform it right now, sorry.
Thanks! -
I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
Please let me know mitigation for this blockage issue.
Should I use begin transaction and commit transaction statements/ shared lock statements.
please replyHi,
run same query at the same time? -
Executing Multiple Select Queries in a Single attempt
HI,
I executed two select queries in a single statement execute. It is executing without any error. Hence there must be two resultset objects within that single statement.
What the problem is that I m able to fetch the first resultset and its data, But I execute stmt.getMoreResults() to move to the next resultset, it returns false, which means there is no more results. I want to know what is the problem ?? (Record exist in the database for both queries)
And How can I rertieve both the resultsets. ??
Plz help me asap.
For ur convenience I m posting the Java code also which I m trying.
sql.delete(0, sql.length());
sql.append("select FIRST_NAME , MIDDLE_NAME , LAST_NAME from USER_MASTER where USER_ID=4;");
sql.append("select producttransaction_id, product_type from product_transaction where transaction_id=102 order by product_type desc");
Statement stmt = con.createStatement();
stmt.execute(sql.toString());
int resultsetcount =1;
ArrayList arrlist = new ArrayList();
rs = stmt.getResultSet();
if(rs !=null)
if(rs.next())
.........// logic here working properly
//Now when I move to next resultset using the below statement
//it returns false indicating that there r no more results.
// Why this is so ?????
boolean moreresultsets = stmt.getMoreResults();
System.out.println("MoreResultsets::"+moreresultsets);
if(moreresultsets)
rs = stmt.getResultSet();
if(rs!=null)
while(rs.next())
//...Logic.......
rs.close();
ThanksI've never seen this used the way you are using it. In my experience the only way to do this would be to execute a single SQL statement that returns multiple result sets - you are trying to append two SQL statements.
You could define an in-line procedure wrapping your two select statements, or you could define a stored procedure to do the same thing. Then (either way) use CallableStatement to execute the call to the procedure. -
Client dependent and client independent in ALE
I am going through pdf learning of an ALE scenario,i couldnot get wat is meant by client Independent and client dependent.
How can i conclude
Create message type (WE81){color:green} Client independent {color}
To create a new message type, follow these next few steps:
u2022 Enter transaction WE81 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Create logical message type)
u2022 Choose Create logical message type by double clicking on it
u2022 Click on change icon to enter change mode
u2022 Click on New entries to add a new type
u2022 Enter the required message type, in our case it is ZINVRV and an appropriate description
u2022 Save and exit.
Your message type has now been created. The next step will be to link it to the IDoc.
2.2.1. Link message to IDoc type (WE82 & BD69) {color:green} Client independent {color}
To link the message type to the IDoc type follow these next few steps:
u2022 Enter transaction WE82 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> EDI: Message Types and Assignment to IDoc Types)
u2022 Click on change icon to enter change mode
u2022 Click on New entries to create the link
u2022 Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
u2022 Save and exit
u2022 Enter transaction BD69 (ALE -> Extensions -> IDoc types -> Maintain message type for intermed. Structure -> Assign message type to IDoc for ALE)
u2022 Click on change icon to enter change mode
u2022 Click on New entries to create the link
u2022 Enter the message type ZINVRV and the BasicIDoc type as ZINVRV01
u2022 Save and exit
Your IDoc is now linked to your message type. We still need to link object types and add the message to the model before we can use the message.
2.2.2. Maintain object type for message type (BD59) Client independent
The ALE objects are used to create links between IDocs and applications objects, to control the serialisation, to filter messages in the customer model and to use listings.
For our own message type and IDoc you must maintain object types for the links.
If you want to check the serialisation for the message type, then you must maintain object types for the serialisation. If no serialisation object has been maintained for a given message type, then the serialisation will not be checked for this message type.
To add an object type to our message type, follow these next few steps:
u2022 Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance -> Maintain object types)
DOC NAME: ALE_SCENARIO_DEVELOPMENT_PROCEDURE
Version 1 Page 6 of 16
ALE Scenario Development Guide
u2022 Type in your message type ZINVRV and press enter
u2022 Click on New entries
u2022 Enter your object type, LIFNR (We need to use the vendor as a filter object), the segment name where LIFNR resides, Z1INVRV, a number 1 for the sequence followed by the actual field name LIFNR
u2022 Save and exit.
You have now created an object that weu2019ll use as a filter object in the customer model to direct the flow of messages to the various logical systems based on the vendors in the filter of the message type ZINVRV.
We now need to add our new message type to the distribution model.
2.3. Configuring the Distribution Model
This task is performed on your ALE reference client.
2.3.1. Manual Configuration (BD64) {color:green} Client dependent {color}
To manually configure the customer distribution model, read the ALE configuration procedure, and follow these steps:
u2022 Perform the Maintain customer distribution model directly function. (ALE -> Distribution customer model -> Maintain customer distribution model directly)
u2022 Specify the customer model you want to maintain and the logical system that is to be the sender of the messages OR create a new model. (Create model ALE with logical system ALELS1C400)
u2022 Choose the receiving systems to which the sending system must forward message type ZINVRV to.
u2022 For each receiving logical system allocate the message type necessary for communication to the receiving systems as per ALE configuration procedure.
u2022 Create filter objects (in our case LIFNR as the object type with the associated vendor number, 0000018001 with leading zeros, in the object area) for the message types.
u2022 Save the entries.
Refer my query within color:green
Edited by: aditya sharma on Jul 14, 2010 12:57 PM
Edited by: aditya sharma on Jul 14, 2010 1:01 PMA client is an independent business unit within an R/3 System, Data in the R/3 are classified as cleint-Dependent and client-independent.
Client-independent data such as ABAP Programs, R/3 repository objects throught the entire system. Other data is client-dependent. meaning, it can be viewed from one client. Cleint-dependent data includes customizing application and user data.
Eg.
Scripts are client dependent, means the changes done to SAP scripts in particular client will not be reflected in other client.
Smartforms are client independent, means changes done in one client will be reflected in all the clients.
Server : ECC6
Client : 100 , 200 , 300 , 400
Now suppose you have developed report in DV server client 100.
Then you will be able to see that in all clients.
Hence this is called as client independent. You can change anywhere and changes will be reflected to all ...
Now suppose you have developed a script in DV client 100.
You will not be able to see that in client 200 or 300 or 400 unless ytou copy that from client since it is client dependent. -
Multiple select queries for JDBC sender
I am working on JDBc to IDOC scenario.
I need to process two select queries in PI where output of 1st query becomes the input of second.
Now i need to map the output of second to IDOC through XSL mapping also i need to use BPM to process(without using the stored procedure) the scenario.
In my JDBC communication channel i have option for only one select query and second query should fetch the data through BPM.
In BPM i have used the following sequence mentioned below:
Start --> Receive step ( receives all the header lines) --> Transformation (to split the header messages to single message) --> Block Start( To processEachRecord) --> Send Syn (to map the request message i,e. output of first query with Response i,e. structure of the second query) --> Send Asyn (to send the output of second query to XSLT mapping) -->Block End --> stop
Output of XSLT mapping is the input for IDOC
Now i need to understand how to process the second query?>> I need to process two select queries in PI where output of 1st query becomes the input of second
Use SQL Nested Queries.
Example:
SELECT Model FROM Product WHERE ManufacturerID IN (SELECT ManufacturerID FROM Manufacturer
WHERE Manufacturer = 'Dell')
Here first table is Manufacturer .. we do select query in manufacturer to return data and pass it to the first table Product.
>> Now i need to understand how to process the second query?
You dont need at all. In your sender jdbc channel, write sql statement nested query and you will get only output of the second table. you map the second table output to the idoc.
Note: Dont know why do you need BPM for this case..
Jdbc sender adapter help links
http://help.sap.com/saphelp_srm40/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
Check this thread for update statement in jdbc cc
Re: sender jdbc adapter -
I know that the JDBC sender adapter can handle joins, but can it handle more sophisticated SELECT queries such as subselects, group by, rownum, etc. In other words, are there any limitations in the SELECT query?
Thanks in advance.Hi Bevan,
The only limitation with XI30-JDBC Sender Adapter is with Oracle Stored Procedure/Functions, as Oracle SP Query returns a cursor, and not a resultset.
Thanks
Prasad -
Hi All,
I have a program to be performance tuned. There are select queries on VBAP and BSEG which are taking time.
The where condition includes maximum primary keys. But when I checked the data its fetching is very large.
I have performance tuned another code and replaced the selects with FMs but now for VBAP and BSEG I am not
getting suitable FMs . Also some which I got are taking more time then the selects.
Kindly suggest something.
Thanks
Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting - post locked
Edited by: Rob Burbank on Mar 18, 2010 3:07 PMHi,
If you are giving All the fields of the table in the Second Query and trying to use CORRESPONDING FIELDS then second query will take more time, since here FILED names will be compared which is an extra operation if you use * instead it will just to BYTE copy which is faster.
If you are giving only some fields of the table in the Second query then second query takes less time than First query.
This is beacuse the amount of data that is transferred from Database server to Application server will be less in the second case if all fields of the table are not mentioned.
Regards,
Sesh -
SELECT QUERIES IN ABAP.....
Can you give some idea about writing efficient select queries in ABAP?
Hi kishan,
i can give you some hint from one document, please reward point.
The hit list is the set of rows determined by the WHERE clause. In other words, it is the set of table rows that the database system must take into account to respond to the query. Dont confuse the hit list with the solution set, which is the set of rows (not necessarily from the table the query deals with) the database system returns to the program. Notice that in many cases the querys hit list and the solution set are different.
What is the reason behind this rule? A smaller hit list saves disk I/Os by the database system and often reduces network load. Both of these factors have a strong influence on your programs runtime performance.
How can you use ABAP to limit a hit list? First, use a WHERE clause whenever possible. Second, always try to describe the full search condition (not just part of it) within a single WHERE clause. ABAP provides a variety of arithmetical and logical operators to do this. Compared with your application program, the database server is usually the better place to evaluate search conditions.
Let me give you an example: Run a query against the flight table to produce a list of all flight dates for Lufthansa flight 0300 in 1998. Air carrier and air connection are known and can easily be used within the WHERE clause of the SELECT statement. The relevant year is also given, but at first glance it is difficult to build an appropriate search condition. Faced with this situation, you could be tempted to use the ABAP CHECK statement.
CHECK evaluates the subsequent logical expression. If it is true, the processing continues with the next statement. CHECK with a negative outcome terminates the current SELECT-ENDSELECT loop to start with the next row of the solution set, if there is one. Considering that fldateis a type D(YYYYMMDD) column of the sflighttable, a correct fragment of an ABAP program could look like this:
SELECT fldate
FROM sflight INTO xdate
WHERE carrid = 'LH'
AND connid = '0300'.
CHECK xdate = '1998'.
WRITE: / xdate.
ENDSELECT.
With ABAP in general, CHECK does the job of pattern matching in character variables. But in the WHERE clause of a SELECT statement, pattern matching also can be done easily by applying the LIKE operator. Within the search pattern, two characters have a particular meaning: _ stands for any one character and % stands for any character string. With this in mind, a better solution would be:
SELECT fldate
FROM sflight INTO xdate
WHERE carrid ='LH'
AND connid ='0300'
AND fldate LIKE '1998%'.
WRITE: / xdate.
ENDSELECT. -
Dynamic select / function module for select queries
Hello experts,
Is there any function module to build dynamic select queries and also to build standard select queries .
Thanks,
krishnakumarWhat are you meaning by 'to build' ???
BR, JAcek
Message was edited by: Jacek Slowikowski -
Union among multiple select queries with full outer join
Hello everyone,
I have 3 different select queries (used FULL Outer Join) which work fine. Now I want to add Union to the results among them and pick the selected columns from each query in the final result. while doing so, I am getting an error as "right parenthesis missing". I am quite sure, it is not the real cause. I guess might be issue with the query structure.
select j.pod, j.hostname, portal.hostname,saasc.hostname,a3s.hostname from -- * from
Select J.Pod,J.Hostname, P.Pod Portal_Pod,P.Hostname Portal_Hostname
From Total_Pod J
full outer join Portal_Tmp P On (J.Pod = P.Pod And J.Hostname = P.Hostname) as portal
Union
Select J.Pod,J.Hostname, s.Pod saasc_Pod,s.Hostname saasc_Hostname
From Total_Pod J
full outer join Saasc_Tmp S On (J.Pod = s.Pod And J.Hostname = s.Hostname) as saasc
Union
Select J.Pod,J.Hostname, a.Pod a3s_Pod,a.Hostname a3s_Hostname
From Total_Pod J
Full Outer Join A3s_Tmp A On (J.Pod = A.Pod And J.Hostname = A.Hostname) as a3s
)p.s: select * from (INNER QUERY); also does not work.
Any help appreciated.
Thanks in advance.With T as
(Select J.Pod,J.Hostname, P.Pod Portal_Pod,P.Hostname Portal_Hostname
From Total_Pod J
full outer join Portal_Tmp P On (J.Pod = P.Pod And J.Hostname = P.Hostname) ),
U as
(Select J.Pod,J.Hostname, s.Pod saasc_Pod,s.Hostname saasc_Hostname
From Total_Pod J
full outer join Saasc_Tmp S On (J.Pod = s.Pod And J.Hostname = s.Hostname) ),
V as
(Select J.Pod,J.Hostname, a.Pod a3s_Pod,a.Hostname a3s_Hostname
From Total_Pod J
Full Outer Join A3s_Tmp A On (J.Pod = A.Pod And J.Hostname = A.Hostname) )
Select T.Pod,T.Hostname,nvl(T.Portal_Hostname,'Not Available') portal,nvl(U.Saasc_Hostname,'Not Available') saasc,NVL(V.A3s_Hostname,'Not Available') a3s From T,U,V
Where T.Pod = U.Pod
And U.Pod = V.Pod
And T.Hostname = U.Hostname
And U.Hostname = V.Hostname -
Dear Friends,
I have written the below select queries to get the shipment details for a given date range.
select vbeln lddat
into table itab
from likp
where lddat in l_r_date2 .
if not it_ldt[] is initial.
select fknum fkpos rebel
into table jtab
from vfkn
for all entries in itab
where
rebel = itab-vbeln.
endif.
First query is giving 82000 entries and second query is giving approx 60000 from the table VFKN( total entries in this table are 8 lakhs).
Here the problem is second select query(for all entries select query) is taking a time of 3 to 4 hours.
So please suggest me how can i reduce the time.
Thanks and RegardsHi,
Use FREE or PACKAGE size.
Some steps that might make FOR ALL ENTRIES more efficient:
Removing duplicates from the driver table Sorting the driver table
If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
FOR ALL ENTRIES IN i_tab
WHERE mykey >= i_tab-low and
mykey <= i_tab-high.
Regards
Krishna -
Want to use ldb selection screen with select queries
I want to use ldb selection screen with select queries since ldb having performance issue .How can I use the fields of the dynamic selection of LDB in the select queries
Hi,
Check the code snippet below: Here 'XXXX' is the table for your select query.
DATA L_DS_CLAUSES TYPE RSDS_WHERE.
MOVE 'XXXX' TO L_DS_CLAUSES-TABLENAME.
READ TABLE DYN_SEL-CLAUSES WITH KEY L_DS_CLAUSES-TABLENAME
INTO L_DS_CLAUSES.
SELECT * FROM XXXX
WHERE field1 IN ...
AND field2 ....
AND (L_DS_CLAUSES-WHERE_TAB).
PUT XXXX.
ENDSELECT.
You can also try using the FM 'RS_REFRESH_FROM_DYNAMICAL_SEL' passing SY-CPROG in curr_report and 'M' for mode to get the dynamic selection screen values.
Regards,
Munesh.
Maybe you are looking for
-
I am new to Flex web applications and I am doing research to see if functionality contained in an existing web application can be replicated in a Flex web app. We currently have a JSP / Struts based web application that creates a data entry web view
-
Is it possible to search my iPhoto library by file format (JPEG, psd, tiff,etc)?
-
Return order (RE) changed to non-billing relevance
Hi experts, I would like to change order type RE to non-billing relevance. When I make such changes, and go to VA01 to create RE order, I get "Missing Profitability Segment" in my incompletion log. I find that it is from incompletion procedure 20
-
Searching in text by contact name
Before iOS6, I could search by contact name within the text messages area and it would sift through my long list of text messages to bring up the contact name that I had texted with. Now it appears that Apple is not allowing the contact name to be i
-
Odbc drive has returned an error (SQLExecDirectW). State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27004] Unresolved table: "Paint". (HY000) Please could you help me with this?