Application Development and Automation 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: 
Read only

View select problem

sudhakar196
Participant
0 Likes
645

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
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
586

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
Read only

Former Member
0 Likes
586

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

Read only

0 Likes
586

hi i want to select from view

Read only

0 Likes
586

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

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
587

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