Skip to Content
author's profile photo Former Member
Former Member

Help on Join

Hi,

Need to join 3 tables EQUI,STAT,ZCS_SOLTYPE.

The required fields in the tables are

EQUI - <b>equnr,zzengn,zzrefeng,eqtyp,objnr</b>

STAT - <b>objnr</b>

ZCS_SOLTYPE - <b>zzengn,zzcrmgroup</b>

My structure table is like this

<b>BEGIN OF s_equi,

equnr TYPE equnr,

zzengn TYPE zzengn,

zzrefeng TYPE zzrefeng,

eqtyp TYPE eqtyp,

objnr TYPE J_OBJNR,

stat type stat,

zzcrmgroup type zzcrmgroup,

END OF s_equi,</b>

and the internal table is

<b>i_equi TYPE STANDARD TABLE OF s_equi,</b>

Can anyone help me out in writing the join for these these tables.

Regards,

Ram

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 05:11 AM

    Hi Ram,

    Please try the following join:

    <b> SELECT aequnr xzzengn azzrefeng aeqtyp

    dobjnr xzzcrmgroup

    INTO TABLE i_equi

    FROM equi AS a

    INNER JOIN stat AS d ON dobjnr = aobjnr

    INNER JOIN ZCS_SOLTYPE AS x ON xzzengn = azzengn

    WHERE <cond>.</b>

    Hope this helps. Please reward points if you find this useful.

    Regards,

    Chetan.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 05:12 AM

    SELECT EQUIEQUNR EQUIzzengn EQUI~zzrefeng

    EQUIeqtyp EQUIobjnr

    STAT~OBJNR

    ETYP~zzengn

    ETYP~zzcrmgroup

    INTO table i_final

    FROM ( stat

    INNER JOIN equi

    ON equiobjnr = statobjnr

    INNER JOIN ZCS_SOLTYPE

    ON ZCS_SOLTYPEzzengn = Equizzengn)

    WHERE EQUI~EQUNR IN S-screen.

    Try with this. If it works pls. don't forget to give points to me.

    Murali

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2006 at 06:32 AM

    hi

    good

    i am bit confused with your query, go through this definitaion of INNER JOIN and do accordingly

    When multiple SAP tables are logically joined, it is always advisable to use inner join to read the data from them. This certainly reduces the load on the network.

    Let us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates.

    Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join.

    Select aairln alnnam bfligh bcntry into table int_airdet

    From zairln as a inner join zflight as b on aairln = bairln.

    In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.

    thanks

    mrutyun^

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.