what is the difference table type and structure?
Answers were Sorted based on User's Feedback
Answer / apun
A table type has some database attached to it, whereas the
structure is only a definition with NO DATABASE attached to
it.
Is This Answer Correct ? | 47 Yes | 19 No |
Answer / srikanth@bigtec
Difference between structure and table type is
Table type
The table type specifies how you can access individual table
rows via ABAP.
Generally all internal tables are treated as table types.
There are different types of table types like
standard,sorted and hashed.
Internal tables are used only during program execution i.e
data flows into internal table only during program execution.
Data manipulations in internal table during debugging will
not effect database.No memory is allocated for table types
like internal table.
structure
Structure contains data only when it is inserted in database
table using append or include.
We change the data in structure which will effect Database.
Memory is allocated to structure only when it is included in
table using append or include.
Is This Answer Correct ? | 20 Yes | 6 No |
Answer / sandipan banerjea
first we should know what a structure is.it is a SINGLE row.
let us consider few examples:
1) DATA struc_xyz TYPE sflight.
here, we are declaring a structure variable by the name
"struc_xyz" which can hold the values for the same fields
which are present in "sflight".
if the fields present in "sflight" are say
"carrid","connid","fldate", then the structure variable
"struc_xyz" can hold the values for the above mentioned fields.
but suppose from "sflight" we want only "carrid", and
"connid", why should we use the whole of "sflight"?its a
performance issue.
2) TYPES:BEGIN OF abc,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
END OF abc.
DATA struc_xyz TYPE abc.
here, "struc_xyz" is the structure variable and "abc" is a
local structure type which we have created using the keyword
TYPES.
now,let us move on to TABLE TYPE.
what does the word "TABLE" in "TABLE TYPE" suggest?!
the run time table variable which is nothing but the
internal table, is to be dealt with now.
3) TYPES gty_flights TYPE STANDARD TABLE OF sflight.
DATA itab_gty_flights TYPE gty_flights.
here, "gty_flights" is the local table type.THE TYPE OF AN
INTERNAL TABLE IS CALLED AS "TABLE TYPE".
"itab_gty_flights" is the internal table.
a common begineer's error is :
DATA itab_gty_flights TYPE STANDARD TABLE OF gty_flights.
in such a case, "itab_gty_flights" will be declared as an
internal table whose rows are themselves internal tables!!!
NOTE: i have used the keyword TYPES in examples 2 and 3.
they have declared a local structure type and a local table
type respectively.
you can declare both the types globally.refer the next two
examples below and compare with examples 2 and 3.i hope, you
will notice the differences!!
4)
DATA: BEGIN OF struc_xyz,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
END OF struc_xyz.
5)
DATA itab_gty_flights TYPE STANDARD TABLE OF sflight.
************THANK YOU***********************************
Is This Answer Correct ? | 12 Yes | 2 No |
Answer / i.srikanth
Structures (structured types)
Structured types describe the structure and functions of any
structured data objects, that is of data structures with
components of any type.
A component can be a field with an elementary type or can
itself be a structure. A table can also be used as a
component in a structure.
A database table always has a structure and is therefore
implicitly a structured type. However, the fields of a
database table can only have an elementary type.
Table types
Table types describe the structure and functions of internal
tables in the ABAP program. Their rows can have any row
type. Table types with elementary row type therefore can be
defined just the same as multi-dimensional table types
(table types with a table type as row type) or table types
using structures with table-like components.
In a simple words,
Structure is just a flat structure but Table type is an
internal table.
Sample code how to use them to create internal table:
* Create Internal table from a structure:
DATA: IT_DATA TYPE STANDART TABLE OF Structure.
* Create Internal table from a table type:
DATA: IT_DATA TYPE table_type.
Is This Answer Correct ? | 9 Yes | 4 No |
Answer / yallamandaiah nandigam
1. Table can store the data physically but a structure dose not store.
2. Table can have primary key but a structure dose not have.
3. Table can have the technical attribute but a structure dose not have.
structure doesn't contain technical attributes.
structure doesn't contain primary key.
structure doesn't stores underline database level.
Is This Answer Correct ? | 8 Yes | 4 No |
Answer / ashok
1. Table can store the data physically but a structure dose not store.
2. Table can have primary key but a structure dose not have.
3. Table can have the technical attribute but a structure dose not have.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nag
structure means line type i.e work area of internal table
Table Type means Row type i.e body of internal table.
Is This Answer Correct ? | 9 Yes | 16 No |
Answer / uday
Stucture is line type which means body of internal table.
table type is row type which means workarea of IT.
Is This Answer Correct ? | 18 Yes | 44 No |
hi friends, In smart form how can we convert the decimal to whole no. for ex. i have date like 5.456. now i want convert to whole no. after point value more then 5 means the no should come 6. below 5 means its come 5. any body can help me with code. its urgent. Thanks.
What is the difference between open sql & native sql ?
1.what aer the text modules. 2.what is function module in report. 3.what is the land scape in u r projwct.
program name for displaying colors , and program name for displaying symbols in list ?
What are the components in technical setting while creating a table
Can I write COMMIT and ROLLBACK in user-exit?
what is the table to find change pointer status?
You are running a report. It is taking long time for execution. What steps will you do to reduce the execution time.
For particular transaction you want to upload the data using any of bdc method...if the transaction contains any of pop window functionaliy and having radio button in the window..Any one of the radio button must be selected then only the next data can be inserted how will you handle this scenario in your program
What is an interactive report? What is the obvious difference of such report compared with classical type reports?
What are the dis-advantages of logical databases? : abap hr
How to transfer data which is coming from are report as output to another report