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

code error

Former Member
0 Likes
779

friends, hope u r well and doing good at yr places.

this is jain as bw consultant not having much knowledge of abap progrtamming. could you please suggest me , i am getting a error from following prog.

Report Ztest.

data: ztest1 type standard table of pa0001

inital size 0.

data: ztest type pa0001.

Select * into corresponding fields of ztest1

from pa0001.

loop at ztest1 into ztest.

write:/ ztest.

endloop.

The error is - .you can not use ther syntax write

7uline ztest.

please advice me.

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
748

Here is the corrected code.



data: ztest1 type standard table of pa0001.
data: ztest type pa0001.

select * into corresponding fields of table ztest1
from pa0001.

  loop at ztest1 into ztest.
    write:/ ztest.
  endloop.

Regards,

Rich Heilman

Read only

0 Likes
748

There are two mistakes

1. You need to use table keyword

2. A space is needed in write statement.

- Sanjay

Read only

Former Member
0 Likes
748

data: ztest1 type standard table of pa0001.

data: ztest type pa0001.

Select * into corresponding fields of table ztest1

from pa0001.

loop at ztest1 into ztest.

write:/ ztest-pernr.

*--here you write all the fields separately, instead of just ZTEST.

endloop.

Message was edited by: Srikanth Kidambi

Read only

Former Member
0 Likes
748

hi jain,

data: ztest1 type standard table of pa0001 initial size 0.

data: ztest type pa0001.

Select * into corresponding fields of table ztest1

from pa0001.

loop at ztest1 into ztest.

write:/ ztest-pernr.

endloop.

Read only

Former Member
0 Likes
748

Akshay,

You need to write each individual field of ZTEST.

ex.. write : / ztest-a, ztest-b.

Regards

Anurag

Read only

Former Member
0 Likes
748

Hi,

data: ztest1 type standard table of pa0001

inital size 0 with header line.

Select * into corresponding fields of table ztest1

from pa0001.

loop at ztest1.

write:/ ztest1-pernr.

endloop.

regards,

keerthi.

Read only

Former Member
0 Likes
748

Hi

you need to include keyword 'table'.

otherwise it will consider ztest1 as workarea.

check the following code.

data: ztest1 type standard table of pa0001 INITIAL SIZE 0.

data: ztest type pa0001.

Select * into corresponding fields of TABLE ztest1 from pa0001.

loop at ztest1 into ztest.

write:/ ztest.

ENDLOOP.

Reward points if helpful.

Regards,

Swathi.