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

Debugging

Former Member
0 Likes
475
loop at ztable into wa_ztable.
at new kunnr.

<code>

endat.

I get the error VERSION ... ." expected after "ZTABLE".

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
454

Hi,

Is ztable an internal table or database table?

If it is database table, please try this.


data: t_ztable type standard table of ztable with header line.

data: wa_ztable type ztable.

select *
from ztable 
into table t_ztable
where <condition>.

sort t_ztable.

loop at t_ztable into wa_ztable.

 at new kunnr.
   ...
 endat.

endloop.

Regards,

Ferry Lianto

3 REPLIES 3
Read only

Former Member
0 Likes
455

Hi,

Is ztable an internal table or database table?

If it is database table, please try this.


data: t_ztable type standard table of ztable with header line.

data: wa_ztable type ztable.

select *
from ztable 
into table t_ztable
where <condition>.

sort t_ztable.

loop at t_ztable into wa_ztable.

 at new kunnr.
   ...
 endat.

endloop.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
454

that did not work

Read only

amit_khare
Active Contributor
0 Likes
454

You are trying to loop at database table directly instead of internal table.

Check this -

Addition

... VERSION vers

Effect

If the addition VERSION is specified, the database dbtab is not read; instead, the table with a name made up of "T" and the content of vers is read. For vers a data object with a maximum of four characters, of type c must be specified. The content of the row is still assigned to the table work area of dbtab and its type is cast. If the table work area is too short, a runtime error occurs.

Mean your table ZCITORDEROUT is a database table instead of internal table.

Regards,

Amit