‎2009 Apr 03 4:37 PM
Hai Friends,
Is it right to use CLIENT SPECIFIED in inner join. if possible explain me with an example.
I am comparing only RSEG-LFBNR with the reference key in MSEG.
Thanks
‎2009 Apr 06 9:04 AM
It is possible, but not always necessary .... I remember doing it once to tweak a little extra performance out of a complex join but I wouldn't normally bother. Below is a bit of sample code with a MANDT in the join ... I ran ST05 SQL trace across it and the "explain" for both prepares was the same... you'd have to try it with your particular select to see if it makes any difference on your system / database.
Jonathan
report zlocal_jc_client_join.
types:
begin of gtys_data,
bname type usr01-bname,
class type usr02-class,
end of gtys_data.
start-of-selection.
perform select_with_client.
perform select_without_client.
*&--------------------------------------------------------------------*
*& Form select_with_client
*&--------------------------------------------------------------------*
form select_with_client.
data:
lt_data type table of gtys_data.
select
usr01~bname
usr02~class
into corresponding fields of table lt_data
from usr01 as usr01
inner join usr02 as usr02
on usr02~mandt = usr01~mandt
and usr02~bname = usr01~bname
client specified
where usr01~mandt = sy-mandt
and usr01~bname like 'A%'.
endform. "select_with_client
*&--------------------------------------------------------------------*
*& Form select_without_client
*&--------------------------------------------------------------------*
form select_without_client.
data:
lt_data type table of gtys_data.
select
usr01~bname
usr02~class
into corresponding fields of table lt_data
from usr01 as usr01
inner join usr02 as usr02
on usr02~bname = usr01~bname
where usr01~bname like 'A%'.
endform. "select_without_client
‎2009 Apr 03 4:43 PM
Hi,
It all depends on the your requirement, if you use this statement the you need to pass the MANDT ffield in the Where clause of select statement.
If you not provide the MANDT field in case you use the CLIENT SPECIFIED then data is fetched from the Buffer.
‎2009 Apr 04 9:08 AM
Client Specified is used when you required to access data of different clients:
Additions:
1 ) If you use MANDT FIELD in the where clause the given clients data is fetched.
2) If no MANDT FIELD is specified Data from all the clients is fetched.If you specifi MANDT without CLIENT SPECIFIED addition current clients data is fetched.So if you need to fetched data from other clients in your Join use CLIENT SPECIFIED.
Regards,
Gurpreet
‎2009 Apr 05 8:18 AM
Hi,
If you want to edit data from other clients explicitly, use the SQL command with the addition
CLIENT SPECIFIED and enter the number of the client in which the SQL operation is to be
carried out in the WHERE clause of the command.
Regards,
Nitin.
‎2009 Apr 06 8:05 AM
Hi,
You can use the CLIENT SPECIFIED Key word in the select statement to access data from multiple clients.
But you have to take care of the performance and also security options into consideration. As accessing multiple client from other clients is not recomended.
Hope this helps.
Thanks,
Samantak.
‎2009 Apr 06 9:04 AM
It is possible, but not always necessary .... I remember doing it once to tweak a little extra performance out of a complex join but I wouldn't normally bother. Below is a bit of sample code with a MANDT in the join ... I ran ST05 SQL trace across it and the "explain" for both prepares was the same... you'd have to try it with your particular select to see if it makes any difference on your system / database.
Jonathan
report zlocal_jc_client_join.
types:
begin of gtys_data,
bname type usr01-bname,
class type usr02-class,
end of gtys_data.
start-of-selection.
perform select_with_client.
perform select_without_client.
*&--------------------------------------------------------------------*
*& Form select_with_client
*&--------------------------------------------------------------------*
form select_with_client.
data:
lt_data type table of gtys_data.
select
usr01~bname
usr02~class
into corresponding fields of table lt_data
from usr01 as usr01
inner join usr02 as usr02
on usr02~mandt = usr01~mandt
and usr02~bname = usr01~bname
client specified
where usr01~mandt = sy-mandt
and usr01~bname like 'A%'.
endform. "select_with_client
*&--------------------------------------------------------------------*
*& Form select_without_client
*&--------------------------------------------------------------------*
form select_without_client.
data:
lt_data type table of gtys_data.
select
usr01~bname
usr02~class
into corresponding fields of table lt_data
from usr01 as usr01
inner join usr02 as usr02
on usr02~bname = usr01~bname
where usr01~bname like 'A%'.
endform. "select_without_client