Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Inner join

Former Member
0 Likes
983

I need to join MARA and MSEG as inner join on mara-matnr = mseg-matnr.

However matnr is not a key field in mseg.The query is shown below.

from mkpf AS a

inner join mseg as b

on amandt = bmandt

and amblnr = bmblnr

and amjahr = bmjahr

inner join mara as c

on cmatnr = bmatnr

Is this query alright, specially cmatnr = bmatnr. Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
948

Yeah you can filter out even if it not a key field....

Regards,

Jayant..

6 REPLIES 6
Read only

Former Member
0 Likes
948

I think it should work fine...

Regards,

Jayant

Read only

0 Likes
948

Even if matnr is not a key field in MSEG

Read only

Former Member
0 Likes
948

Hi

Its fine

It works.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
948

Hi SV,

Refer this code :

SELECT amatnr amEINS AMTART DMAKTx bwerks clgort

c~labst INTO CORRESPONDING FIELDS OF TABLE IT_MATERIAL

FROM mara AS a

INNER JOIN MAKT AS D on amatnr = dmatnr

inner join marc AS b

ON amatnr = bmatnr

inner join MARD as c

ON BMATNR = CMATNR AND BWERKS = CWERKS

where AMATNR IN S_MATNR and bwerks in s_werks.

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
948

It will work fine ...

for joins, it is not must to be a key field, but recommended...

Read only

Former Member
0 Likes
949

Yeah you can filter out even if it not a key field....

Regards,

Jayant..