09-01-2007 9:17 AM
what is the Difference between table type and structures . Inwhat scenario we use table type . Any useful infornation is rewarded.
09-01-2007 9:47 AM
09-01-2007 10:26 AM
We use table type when we need to declare an internal table.
types: begin of ty,
.
.
.
End of ty.
types: ty_t type standard table of ty.
data: itab type ty_t
It z a good practice to declare a table type...
09-01-2007 11:00 AM
Hi Suresh...
Take the Example
LVC_T_FCAT : This is a Table type .
Data : IT_Fcat type lvc_t_fcat. "This will create an internal Table.
LVC_S_FCAT : This is a Structure .
Data : WA_Fcat type lvc_s_fcat. "This will create a work area.
Data : IT_Fcat type TABLE OF lvc_s_fcat. "This will create an internal Table.
That means Table Type is a Data type compatible for Declaring internal table.
Structure is a Data type compatible for Declaring Work area.
<b>reward if Helpful.</b>
09-02-2007 5:05 PM
Hi Suresh ,
A table type describes the structure and functional attributes of an internal table in ABAP. In ABAP programs you can reference a table type TTYP defined in the ABAP Dictionary with the command DATA <inttab> TYPE TTYP. An internal table <inttab> is created in the program with the attributes defined for TTYP in the ABAP Dictionary.
An Table type will have any no of records at runtime but structure will have only
one record at runtime.
If helpful points please.
09-02-2007 8:14 PM
Hi Suresh,
Just to add to the above answers, the table types are available only in higher versions of SAP..
Like it is available in mySAP ERP but not in SAP 4.5B
A table type can be called a line type of an internal table.. when we refer this for any work area in our program, it creates an internal table of this line type... and it will be able to hold multiple records..
The limitation is you can not have a header line with such declaration..
If you refer a structure in your declaration, it will create only one record for the same.. But, if you use the structure for table declaration , you can define the table with header line too..
Thanks and Best Regards,
Vikas Bittera.