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

Constant Table in class

0 Likes
1,229

Hi,

If I have a constant of a tyble type, how can I fill this with values at design time?

Kind regards

Ole

4 REPLIES 4
Read only

Former Member
0 Likes
826

You can probably fill it up in the constructor method of the class.

wa_itab-column1 = 'xxx'.

append wa_itab to itab.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

0 Likes
826

I'm afraid no. Constants cannot be changed. Even not it the class constructor.

It even does not seem to be possible to create a constant table. A table and a constant are mutually exclusive, for a constant needs an initial value, and a table must not have an initial value.

Well...

It seems as I would have to leave this attribute changeable and then access it in the class constructor. Unless nobody has a better solution...

Read only

0 Likes
826

Instead, define your table with a data statement, make it a private attribute, and create a method to modify it.

Regards,

Rich Heilman

Read only

0 Likes
826

Yep, That's what I had in mind as well. Thank you