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
667

Hi,

How to do inner join between MARD and MBEW not using matnr. Please provide me with the code also.

Thanks,

Sriram.

Message was edited by: sriram Ponna

4 REPLIES 4
Read only

Former Member
0 Likes
612

Use view V_SLGH_1 instead.

Rob

Read only

Former Member
0 Likes
612

What fields do you have? What fields do you need? From SAP program SAPMM07S:

SELECT * FROM V_SLGH_1 INTO TABLE YV_SLGH_1       
                       WHERE WERKS EQ XSBSE-WERKS 
                         AND LGORT EQ XSBSE-LGORT 
                         AND MTART IN RMTART      
                         AND BWKEY EQ WERKE-BWKEY.

Rob

Message was edited by: Rob Burbank

Read only

Former Member
0 Likes
612

Hi Sriram,

Both MARD and MBEW are related to materials. I don't se why you would want to eliminate the material number out of the join. It will give you wrong results. Here is an example.


<u>MARD</u>
MATNR    WERKS       LGORT
123      6000        STO1
456      6001        STO2

<u>MBEW</u>
MATNR     BWKEY    ...
123       6001
456       6000

Now, when you join the two tables without using MATNR, using just MARD-WERKS = MBEW-BWKEY, then you will end up selecting the second record for from MBEW for the first record from MARD. This will get complicated if you include storage location.

Why do you want to do it?

Please let us know.

Srinivas

Read only

0 Likes
612

And... what was your solution? I think, posting your conclusion will help the forum.