10-20-2008 12:12 PM
Hi All,
SELECT changenr FROM cdhdr CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
WHERE mandant = syst-mandt
AND objectclas = 'MATERIAL'
AND objectid = wa_matl-matnr
AND tcode = 'MM02'.
I have written the select stament as shown above.
In this i have a doubt like adding a field sy-mandt in the where condition will increase the Efficiency of program or not.
regards,
raghu.
10-20-2008 12:15 PM
No it does not. If your program is supposed to select data in the logon client only, then remove the selection on MANDT as well as the CLIENT SPECIFIED addition. MANDT will be added automatically to the SQL statement that hits the database.
Thomas
10-20-2008 12:17 PM
Hi,
If u have any doubt abt the Select go to the ST05 and on the activate Trace.
When ever u written any select statement , it will convert in to the DDL .
ex. Select mantr ersda from mara into table it_mara where matnr in s_matnr.
In this case it has to be converted in to
select matnr ersda from mara into table it_mara where mandt = sy-mandt and matnr in s_matnr.
It is how it will convert ,,,,,
check out the TRACE.
Regards,
Bharani
10-20-2008 12:17 PM
The answers is NO differnece. If you dont mention sy-mandt the database interface would add the login-in client in where clause during database fetch.
10-20-2008 1:26 PM
you should not add the mandt = sys-mandt, because it is automatically added.
It can happen that you get security warning, because client-specifed should not be used.
Client-speified should only be used in exceptions when data of other clients are needed.
Therefore the usage must be allowed. Normally client should not be added. Sometimes it makes sense to add it in the ON-condition of a join.
Siegfried
11-01-2008 9:23 AM
Hello,
there will be no problem in the performance point of view whether you use the SY-MANDT or not. I think you wnat some client specific data that's why you ve used the SY-MANDT.
11-02-2008 6:30 PM
11-05-2008 5:18 AM
hello,
how can you say like this...
can you explain me the reason behind it...
11-05-2008 11:03 AM
11-07-2008 12:13 PM
Hi Raghawendra,
You don't have to use SY-MANDT in where condition as Client handling is done automatically in Open SQL which is used by ABAP .
For CLIENT SPECIFIED: This is used when you have to access data across the clients and this clause should come in from clause just after the Table Name
ex:SELECT * FROM MARA
CLIENT SPECIFIED
INTO WA_MARA
WHERE MANDT = '003'.
Hope this will help you..
02-16-2009 8:36 AM
Hi..
No doubt the efficency would be affected but from business point of view there will many things that need to be checked as in:
If you are viewing data from CDHDR and CDPOS which is client specific then you are not viewing complete data.
These tables give us and document changes made to a particular object in SAP but if anything is cross client like company code(lets assume) then changes to it wont be visible in all the clients..
so there can be some key information you can miss out while working on some of the objects.
else in this case its good to make query cross client.
regards
vishal
02-16-2009 9:28 AM
the automatic client handling is one of the features of SAPs Open SQL language.
Standard SQL would of course not add the client.
In some older releases it can make a difference to add the client for joins, because only one client condition is added and sometimes problems appeared that the database did not know that the client is given for all tables. Was maybe in releases around 4.6 and not all databases, no problem anymore.
Siegfried