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

Regarding Line type , table type

spandana_babu
Participant
0 Likes
2,038

hi

Experts..

let me know the use of table type, line type..........

hw can i declare & use in the programs....

Thanks &Regards,.

Spanadana..

3 REPLIES 3
Read only

Former Member
0 Likes
1,483

Hi,

Line type is nothing but workarea of internal table and

table type is body of internal table.

In other words we can say that line type is a structure.

We create this line type in ABAP Dictionary.

SE11->data type - give name and choose create.

then select structure in next popup and press enter. There you can add fields and finally activate it.

We can create Table type also in ABAP Dictionary.

SE11->data type - give name and choose create

Then select table type in next popup and press enter. There you can add fields and finally activate it.

We can call these line type and table types in a program using keyword TABLES.

Please reward points if helpful.

Read only

Former Member
0 Likes
1,483

Hi Spandana ,

Table types

Like all local data types in programs , you define internal tables using the TYPES statement. If you do not refer to an existing table type using the TYPE or LIKE addition, you can use the TYPES statement to construct a new local internal table in your program.

TYPES type TYPE|LIKE tabkind OF linetype

.

After TYPE or LIKE, there is no reference to an existing data type. Instead, the type constructor occurs:

tabkind OF linetype

The type constructor defines the table type tabkind, the line type linetype, and the key key of the internal table type.

You can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition.

Line Type

For the line type linetype, you can specify:

· Any data type if you are using the TYPE addition. This can be a predefined ABAP type, a local type in the program, or a data type from the ABAP Dictionary. If you specify any of the generic elementary types c, n, p and x , any attributes that you fail to specify (field length, number of decimal places) are automatically filled with the default values. You cannot specify any other generic types.

· Any data object recognized within the program at that point if you are using the LIKE addition. The line type adopts the fully-specified data type of the data object to which you refer. Except for within classes, you can still use the LIKE addition to refer to database tables and structures in the ABAP Dictionary (for compatibility reasons).

All of the lines in the internal table have the fully-specified technical attributes of the specified data type.

Reward points if useful.

Thanks ,

Surya Pydikondala.