Skip to Content
-1

Correct Select in ABAP

Jun 20, 2017 at 09:16 AM

102

avatar image

Hi,

i have a problem regarding a select statement in ABAP. I need to pick all equipments from table EQUI who have an related measuring point (IMPTT. link between tables is equi-objnr and imptt-mpobj).

I thought of an inner join, but this is not the right way. There are 170 entries in equi but only the last two have measuring points. Each one has for. So mir output of itab has 8 entries.

select equi~equnr equi~objnr imptt~mpobj
  into CORRESPONDING FIELDS OF table itab
  from equi inner JOIN imptt ON  equi~objnr = imptt~mpobj.

Has anybody a suggestion for me how to pick the equipments correctly?

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Horst Keller
Jun 20, 2017 at 09:44 AM
2

Use a subquery in the WHERE condition, WHERE EXISTS?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks a lot. Was the right hint.

My correct working select query now looks like:

select * from equi into CORRESPONDING FIELDS OF table itab
  where objnr in (
  select imptt~mpobj
  from imptt inner JOIN equi ON ( equi~objnr = imptt~mpobj )
  ).
0