Skip to Content
-3

Tables statement inside classes methods

Dec 25, 2016 at 02:20 PM

370

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Matthew Billingham
Dec 27, 2016 at 08:18 AM
4

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

Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Dec 25, 2016 at 05:27 PM
4

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).
Share
10 |10000 characters needed characters left characters exceeded
Cleo James Dec 26, 2016 at 03:05 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Post your problem code here (method and table declaration).

0