Skip to Content
-3

Tables statement inside classes methods

Dear All,

I am building a method in a class. I am using a select statement where I extract data from table1 into itab2 for all entries in itab1.

It is giving error, "table1" is not defined in the ABAP Dictionary as a table, projection view, or database view. But when I try to use tables : table1, it again refuses to accept that statement inside the method. Any workaround?

Regards,

Cleo

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 27, 2016 at 08:18 AM

    The TABLES statement is obsolete and should not be used. ALWAYS use a seperately defined work area.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 25, 2016 at 05:27 PM

    You should read the documentation -> first sentence: "This statement is not allowed in classes" (cf http://help.sap.com/abapdocu_702/en/?url=ABAPTABLES.htm)

    To declare a variable, use DATA (cf http://help.sap.com/abapdocu_702/en/?url=ABAPDATA.htm).
    Add comment
    10|10000 characters needed characters exceeded

  • Dec 26, 2016 at 03:05 PM

    I made a structure and using that to extract data and used that in a FM.

    Add comment
    10|10000 characters needed characters exceeded