4

Select query between an internal table and 3 joined db tables.

 2 years ago
source link: https://answers.sap.com/questions/13708178/select-query-between-an-internal-table-and-3-joine.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
yesterday

Select query between an internal table and 3 joined db tables.

46 Views

Hello,

Need some help pls! I need to add another column to my internal table which should contain the status of the equipment (TJ02T-ISTAT).

I have the equipment number in my internal table itab1-equnr (type of equi-equnr).

The relationship between the db tables is as follows:

Itab1~equnr eq equi~equnr

equi~objnr eq jest~objnr

jest-stat eq tj02t~istat (status of the equipment that I need to add next to the equimpent number column) .

How do I do the select query in this case?

I've tried something like this, but didn't work out.

Select * from EQUI INNER JOIN 
JEST ON
EQUI-OBJNR EQ JEST-OBJNR
INNER JOIN
TJ02T ON
JEST-STAT EQ TJ02T-ISTAT
FOR ALL ENTRIES IN @itab1
WHERE equnr = @itab1-equnr AND
spras = 'EN'
INTO CORRESPONDING FIELDS OF @WA_itab1.
MODIFY itab1 FROM WA_itab1 TRANSPORTING istat.
ENDSELECT.




About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK