I have to read out some data from a database and store it into an internal table.
The internal table is filled from the do_request method of a controller.
After this the internal table shall be passed to a view.
Now my problem is that I don't know how to define an internal table as an attribute
in the model class.
Can you help me?
One thing that you can do is declare an attribute as
I_TABLE TYPE TABLE
and then in the class declare an internal table say <b>gt_tab</b>, exactly of the same type as in the controller.....
Then just pass the table from the controller to I_TABLE, and the do
gt_tab = I_TABLE.
But you will have to use the exact same type, else it will give error stating that <b>Two internal tables are neither compatible nor convertible.</b>
Another way to do this is declare a structure and table type in the data dictionary and then use that table type in attributes......
Hope this helps.
<b><i>Do reward each useful answer..!</i></b>