Skip to Content
avatar image
-1
Former Member

Correct Select in ABAP

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 20, 2017 at 09:44 AM

    Use a subquery in the WHERE condition, WHERE EXISTS?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 )
        ).