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: 

how to retreive data from view

Former Member
0 Kudos
139

hi,

i have created a view with 8 fields. including reference unit for netwr field.

REPORT ZVIEWTEST.

data: begin of itab occurs 0,

kunnr type kunnr,

name1 type name1,

ort01 type ort01,

land1 type land1,

vbeln type vbeln,

erdat type erdat,

netwr type netwr,

end of itab.

select * from zview001 into table itab.

loop at itab.

write: / itab-kunnr,

itab-name1.

endloop.

when i am executing this program i am getting syntax error.

"the type of the database table and work area(or internal table)"itab" are not unicode convertible."

what does it mean?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
121

Hi Prashanth,

Declare the internal table with the type of View.

Data : itab type table of zview001.

or write select query as

select * from zview001 into corresponding fields of itab.

Also you can uncheck the Unicode checks active (checkbox) in the program attributes.

{When you check that unicode checkbox, you should use an internal table without a header line. Instead you should declare a work area)

Hope it helps...

Lokesh Aggarwal

Please reward appropriate points

Message was edited by: Lokesh Aggarwal

6 REPLIES 6

Former Member
0 Kudos
121

Create itab like...

DATA itab LIKE TABLE OF zview001 WITH HEADER LINE.

Former Member
0 Kudos
121

U said u created the View with 8 fields But your

itab has only 7 fields. check your itab.

Former Member
0 Kudos
121

Hi prashanth,

1. DATA dictionary is integrated

into ABAP workbench.

2. U are not utilising it.

3. There is no need to declare

ITAB separately.

4. Just declare it as :

DATA : ITAB LIKE TABLE OF zview001 WITH HEADER LINE.

regards,

amit m.

Former Member
0 Kudos
121

ok i got it.

but what is that error which i got?

why it is coming like that?

Former Member
0 Kudos
121

the data element type used for the fields in the innerjoin conditions in the zview001 may not be the same..

check it...

Former Member
0 Kudos
122

Hi Prashanth,

Declare the internal table with the type of View.

Data : itab type table of zview001.

or write select query as

select * from zview001 into corresponding fields of itab.

Also you can uncheck the Unicode checks active (checkbox) in the program attributes.

{When you check that unicode checkbox, you should use an internal table without a header line. Instead you should declare a work area)

Hope it helps...

Lokesh Aggarwal

Please reward appropriate points

Message was edited by: Lokesh Aggarwal