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

fetching data from view???

Former Member
0 Likes
1,439

how to fetch dat from view?

i am writing

select single a b c from view_name into wa_xyz .

then it is showing some error...

plz help me

7 REPLIES 7
Read only

Former Member
0 Likes
1,036

use

data : begin of wa_stru,

a,

b,

c,

end of wa_stru.

select a b c into wa_stru

from view

where cond.

this for structure.

data : it_stru type standard table of wa_stru.

select a b c into table it_stru

from view

where cond.

it is same as we use tables.

Edited by: sarbpreet multani on Jul 8, 2009 5:24 PM

Read only

Former Member
0 Likes
1,036

Hi ,

what is the error you are getting.

Thanks,

Rajeshwar

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,036

what error.

Possible solutions - guessing

declare

tables:<view_name>.

or

select single a b c from view_name into (wa_xyz-a, wa_xyz-b,wa_xyz-c).

Read only

Former Member
0 Likes
1,036

Hi,

Please let me know the error.

SELECT SINGLE * FROM view name INTO WA_area WHERE condition.

Regards,

Aditya

Read only

Former Member
0 Likes
1,036

Hi,

Try using


select single a b c 
       from view_name 
       into corresponding fields of wa_xyz .

.

Hope this helps.

Regards,

Dhasarathy.

Read only

Former Member
0 Likes
1,036

HI,

Try this and compare with your scenario.

eg:

Tables: caufv. " Caufv is a database view

data: itab like caufv occurs 0 with header line.

select * from caufv into table itab.

In your case if you are selcting the required fields from the table please check the order of the fields being fetched with that of the internal table.

Regards,

Satish

Read only

Former Member
0 Likes
1,036

Hi puja!

you cannot use select statement to retrieve data from view.

use the FM - VIEW_GET_DATA.

Store the values into internal table and then do your process.

Regards,

Sakthi.