2007 Aug 13 10:23 AM
I am having view name
VBAP_VAPMA
in this view i am having two same field SPART, one from VAPMA,one from VBAP,
how can i write select query to retrieve from second table, both SPART having idfferent values.
when i write
select spart from VBAP_VAPMA,
it is retrieving data from VAPMA , i want from VBAP.
thanks
Sudhakar
2007 Aug 13 10:38 AM
Hi,
Since SPART from VBAP is not in your VIEW FIELDS you will not be able to get the value using a SELECT on this VIEW.
You have to use INNER JOIN on the tables to get the value for VBAP.
If you open the view in SE11 you can see that SPART for VBAP is marked with '-' meaning this has been excluded from the view fields since the same field is there in the other table.
Regards,
Sesh
2007 Aug 13 10:26 AM
SELECT VBAP~SPART
<and some more fields you want to select>
INTO TABLE ITAB
FROM VBAP AS VBAP INNER JOIN VAPMA AS VAPMA
WHERE VBAP-SPART EQ VAPMA-SPART.
Regards,
Pavan
2007 Aug 13 10:31 AM
2007 Aug 13 10:37 AM
Hi Sudhakara,
If you wish to select from the table, you need to do that by giving the table name. From view, it will give only those values which satisfy the join condition. You cannot select individually from the tables using view select query.
Regards,
Neha
2007 Aug 13 10:38 AM
Hi,
Since SPART from VBAP is not in your VIEW FIELDS you will not be able to get the value using a SELECT on this VIEW.
You have to use INNER JOIN on the tables to get the value for VBAP.
If you open the view in SE11 you can see that SPART for VBAP is marked with '-' meaning this has been excluded from the view fields since the same field is there in the other table.
Regards,
Sesh