‎2007 Dec 08 10:20 AM
Hai,
How i can declare the tables in SE24 transation.
Example
************\
I declared one table
TABLES: SPOH.
It's showing one error.
YOU CAN'T USE A TABLES STATEMENT WITH IN A METHOD.
any one give the solution for that problem
‎2007 Dec 10 8:27 AM
The TABLES statement is not required to SELECT etc. from a table. All it does is create a work area of the name and structure of the table. Since this can create an ambiguity in the code - ( E.g TABLES: mara. When you use MARA in your program, it's sometimes the table, other times it's the structure) - this statement has been disallowed from ABAP Objects, which has more rigourous type checking.
The simplest solution, therefore, is to create a structure in the following way:
DATA: wa_spoh TYPE spoh.matt
‎2007 Dec 08 10:24 AM
You declare a work area instead of TABLES statement and use that in your query
data:wa_spoh type spoh.
‎2007 Dec 10 4:20 AM
Hi Udaya,
<b>I think SPOH not a table</b> , and also we can't use table statement with in method,
As per OOPS concepts we can't declare a table directly,
We can declare throw table type concepts,
<b>data : itab type table of vbak ,
wa type itab.</b>
if u have any doubt reply me,
Regards,
Vijay
‎2007 Dec 10 5:20 AM
Hi,
create the table type for the table spoh in se11 and then refer u customised table to that table type.
plzz reward points if it is helpful.
‎2007 Dec 10 8:27 AM
The TABLES statement is not required to SELECT etc. from a table. All it does is create a work area of the name and structure of the table. Since this can create an ambiguity in the code - ( E.g TABLES: mara. When you use MARA in your program, it's sometimes the table, other times it's the structure) - this statement has been disallowed from ABAP Objects, which has more rigourous type checking.
The simplest solution, therefore, is to create a structure in the following way:
DATA: wa_spoh TYPE spoh.matt