‎2007 Jul 16 3:08 PM
Hi,
I need to perform the following selection:
a. Based on Position Number -> select associate Pernr from PA0001
b. based on this Pernr find value of STAT2 in PA0000.
Is there an efficient way of carrying out this selection other than using 2 Select Statements?
Note Pernr field is a primary key in both tables.
‎2007 Jul 16 3:12 PM
select pa0001~<associate pernr> from pa0001
inner join pa0000 on pa0001pernr = pa0000pernr
into table itab
where pa0001~<position number> = <Selection for position number>.
Regards,
Ravi
‎2007 Jul 16 3:13 PM
‎2007 Jul 16 3:14 PM
How about using join statement:
Since PERNR is a key field in both tables;
SELECT P0~STAT2
INTO TABLE <itab>
FROM PA0001 AS P1 INNER JOIN PA0000 AS P0
ON P1PERNR = P0PERNR
WHERE <position number condition>
Regards,
A.Singh