Skip to Content
author's profile photo Former Member
Former Member

Class Attribute as Any Table

Hi Fellows,

I got a short OO question.

Is it possible to create a class attribute that would be a table untyped,

and the value assigned to it dynamically during program execution?

When I try to type the attribute as TABLE I am getting error:

Type or field "TABLE" is generic. No table line has been specified.

I would like to use this attribute as kind of bridge between my class (that is accepting import attribute of type TABLE) and it's event handler method declared as one of class methods -

- After handling doubleclick or rows selected -

I would like to pass records chosen back to the main class and outside it later on.

This is why I would like to use the class attibute of type TABLE (any).

Would appreciate your comments on that 😊



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 12, 2013 at 05:52 AM

    You can't have a generic table type attribute. You can have a data reference. In your calling programming you can use

    method->do_stuff_involving_table( mytab ).

    Where do_stuff_involving_table has one input parameter of i_tab type ANY TABLE. Within the method, you can use:

    GET REFERENCE OF i_tab INTO me->r_the_current_table. Where r_the_current_table is of type REF TO DATA.

    Then, in the event method, the input parameter is i_ref TYPE REF TO DATA.


    ASSIGN i_ref->* to <tab>.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 12, 2013 at 05:55 AM


    I think generic table declarations are not possible in classes.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.