Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

View select problem

sudhakara_reddy4
Participant
0 Kudos
147

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

1 ACCEPTED SOLUTION

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
88

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

4 REPLIES 4

Former Member
0 Kudos
88

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

0 Kudos
88

hi i want to select from view

0 Kudos
88

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

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
89

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