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
943

Hi Experts,

I want to inner join two tables.

From Ekpo : matnr, TXZ01.

From Mbew : STPRS

i don't how to do that.

Please send some suggestions on this issue.

Thanks,

Points Assured.

1 ACCEPTED SOLUTION
Read only

former_member386202
Active Contributor
0 Likes
850

Hi,

Better to use FOR ALL ENTRIES it will be performance wise good

select matnr txzo1

from EKPO

into table it_ekpo

where condition.

if not it_ekpo[] is initial.

select stprs

from mbew

into tbale it_mbew

for all entries in it_ekpo

where matnr eq it_ekpo-matnr.

endif.

Regards,

Prashant

6 REPLIES 6
Read only

former_member195698
Active Contributor
0 Likes
850

join EKPO MBEW on MATNR and BWTAR

select ekpoebeln ekpoposnr

ekpomatnr ekpoTXZ01 mbew~STPRS

into table tb_ekpo_mbew

from EKPO join MBEW

on EKPOmantr = MBEWmatnr

and EKPOBWTAR = MBEWBWTAR

where (your where condition)

Regards,

Abhishek

Read only

former_member386202
Active Contributor
0 Likes
851

Hi,

Better to use FOR ALL ENTRIES it will be performance wise good

select matnr txzo1

from EKPO

into table it_ekpo

where condition.

if not it_ekpo[] is initial.

select stprs

from mbew

into tbale it_mbew

for all entries in it_ekpo

where matnr eq it_ekpo-matnr.

endif.

Regards,

Prashant

Read only

0 Likes
850

Hi,

I tried with your code,

But it shows dump like,

The data that was read could not be written to the specified target field during a SELECT access. Either the conversion is not supported for the type of the target field, or the target field is too short to accept the value, or the data is not in the appropriateformat for the target field.

Thanks.

Read only

0 Likes
850

Jasmine,

Can you paste internal table declaration here?

Regards,

Satish

Read only

0 Likes
850

Hi Sathish,

I cleared that error and I used Prasanth code. But now it displays standars price only. Its not displaying the Matnr and Description.

My code is,

select matnr TXZ01

from EKPO into corresponding fields of table rep_search .

if not rep_search is initial.

select stprs from mbew into corresponding fields of table rep_search for all entries in rep_search.

where matnr eq rep_search-matnr .

endif.

Thanks.

Read only

0 Likes
850

select matnr TXZ01

from EKPO into corresponding fields of table rep_search .

if not rep_search is initial.

select mbewmatnr mbewstprs makt~maktx from mbew

join MAKTX on maktmatnr= mbewmatnr and makt~spras = sy-langu into corresponding fields of table rep_search for all entries in rep_search.

where matnr eq rep_search-matnr .

endif.

Message was edited by:

Jacek Slowikowski

Message was edited by:

Jacek Slowikowski