Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SE24

Former Member
0 Likes
815

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

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
782

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

4 REPLIES 4
Read only

former_member195698
Active Contributor
0 Likes
782

You declare a work area instead of TABLES statement and use that in your query

data:wa_spoh type spoh.

Read only

Former Member
0 Likes
782

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

Read only

Former Member
0 Likes
782

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.

Read only

matt
Active Contributor
0 Likes
783

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