‎2007 Jan 30 9:14 AM
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.
‎2007 Jan 30 9:16 AM
it creates a workarea.
it is something like
data : mara like mara.
regds,
kiran
‎2007 Jan 30 9:16 AM
it creates a workarea.
it is something like
data : mara like mara.
regds,
kiran
‎2007 Jan 30 9:17 AM
TABLE statement creates work area for the tables provided.
‎2007 Jan 30 9:17 AM
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
‎2007 Jan 30 9:18 AM
Hi,
Using TABLES declaraion we are just defining the workarea for a particular table
that's all.
Thanks,
Shankar
‎2007 Jan 30 9:23 AM
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
‎2007 Jan 30 9:23 AM
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.
‎2007 Jan 30 9:26 AM
Hi,
Check this link.It will give you more information on this.
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/tables.htm
‎2007 Jan 30 9:42 AM
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
‎2007 Jan 30 9:55 AM
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.
‎2007 Jan 30 10:05 AM
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.