Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CLIENT SPECIFIED in inner join

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question