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

Table Statement

Former Member
0 Likes
928

Hi Everybody,

What is the use of Tables statement?. Sometimes without Tables declaration codes are working properly.

Ex:

Tables : mara,

ekko,

ekkp.

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
899

it creates a workarea.

it is something like

data : mara like mara.

regds,

kiran

10 REPLIES 10
Read only

Former Member
0 Likes
900

it creates a workarea.

it is something like

data : mara like mara.

regds,

kiran

Read only

Former Member
0 Likes
899

TABLE statement creates work area for the tables provided.

Read only

Former Member
0 Likes
899

when you are using tables statement in abap it will create a workarea by this name and you can refer your data to store there.

suppose you want

select matnr into mara-matnr from mara where matnr = p_matnr.

here if you are not defining tables : then it will trigger the error because the workarea mara is not present so you cannot refer that work area.

regards

shiba dutta

Read only

p291102
Active Contributor
0 Likes
899

Hi,

Using TABLES declaraion we are just defining the workarea for a particular table

that's all.

Thanks,

Shankar

Read only

Former Member
0 Likes
899

hi,

With the Tables statement

select-options will not throw a syntax error, if the select-options variables

refer to the particular table declared in table statment.

regards,

Santosh Thorat

Read only

Former Member
0 Likes
899

when ever u declare a select -options it asks for table declaration .


tables bkpf.
SELECT-OPTIONS: S_BUDAT FOR BKPF-BUDAT .

but when i declare a parameter it dosent require a tables declaration .

parameters : p_matnr like mara-matnr.

so using tables declaration a work area is created which will be used to capture the data like

select * into mara ...

regards,

vijay.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
899

Hi,

Check this link.It will give you more information on this.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/tables.htm

Read only

Former Member
0 Likes
899

Hi ,

Tables : mara,

Here Tables statement is to define the work area.

Ex1. Select matnr into mara-matnr from mara

where matnr eq '1000'.

Ex2. Data : itab like standard table of mara with header line.

Select * into table itab from mara

where matnr eq '1000'.

Here we need not declare mara with Tables statement .

Regards,

USR

Read only

Former Member
0 Likes
899

hi,

TABLES statement creates an implicit workarea which is the same like the explicit workarea created by DATA statement.

if you are using SELECT-OPTION in selection screen then you have to use TABLE statement to declare the work area of the table for whose field the select-options is declared.

Moreover the work area created by TABLES statement helps to transfer data automatically from the screen to the driver program and vice versa.

But TABLES statement is absolute in OO ABAP.

Read only

Former Member
0 Likes
899

Hi,

The fundamental difference between creating a work area in a classic way and using the tables statement is that, this statement takes care of the transport of data between the program and the screens automatically. If you define a classic work area, then the transport between screen and program has to be manually programmed. The other difference as already answered is the "select-options" where ABAP will ask for tables statement and will not accept the classic work area definition.

Hope this clears your doubt.

Award points if helpful.