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 type

Former Member
0 Likes
710

Hi Experts,

I am new to abap, I am having confusion regarding line type, table type, and structure declaration.

Will reward usefull inputs.

Thanks.

V.K.

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
688

Hi,

Line type :

Before the 4.7 release in SAP if we want to define an internal table we have to write the defination using the occurs statement and we need to define all the fields using INCLUDE STRUCTURE or indidually all the fields ine by one.

From 4.7 release of R/3 SAP introduced the Line type concept and it's part of the ABAP OOPS concept. for internal table defination we don't need to use the occur statements. Instead INCLUDE structure we need to create a Line type for that structure in Se11 and then we can define the internal table like :

DATA : ITAB TYPE TABLE OF <LINE_TYPE>.

Only thing is this table will be a table without header. So for internal table processing we need to define a work area structure of type line of line type . EX:

DATA: WA_ITAB TYPE <LINE_TYPE>.

Table type:

1) In SE11 in Data Type Enter your Table type's name.

2) Click Create; Choose Table Type

The maintenance screen for Table types appears.

3) In Row Type , you can specify : a Data type/Data element/Structure

4) You can change:

The access mode as desired on the Access category.

Define the Key of the table type on the Key tab page.

5) Save and Activate the table type.

Declaration : itab type <table_type>.

Structure:

data : begin of itab occurs 0.

include <structure>.

data : end of itab.

Regards

Sandeep Reddy

5 REPLIES 5
Read only

Former Member
0 Likes
688

Hi

This is confusion very one has at the start. Earlier days we used to use occurs statement which includes all ur types in one statement. But it occupies lots of system memory. So SAP has recommeded to use types. It works like:

First u define a structure- a structure is not but a definition. It does'nt occupy any memory. This u can global declare from se11 or inside the program using types statement.

table types: its a table definitoin again not linked to any memory component. when u say itab type table of struct. it takes the same format of structure which can expand at runtime.

line type: its like a work area wherein the header data is stored we define as: witab type struct.

Hope it will help u.

Thiru

Read only

Former Member
0 Likes
689

Hi,

Line type :

Before the 4.7 release in SAP if we want to define an internal table we have to write the defination using the occurs statement and we need to define all the fields using INCLUDE STRUCTURE or indidually all the fields ine by one.

From 4.7 release of R/3 SAP introduced the Line type concept and it's part of the ABAP OOPS concept. for internal table defination we don't need to use the occur statements. Instead INCLUDE structure we need to create a Line type for that structure in Se11 and then we can define the internal table like :

DATA : ITAB TYPE TABLE OF <LINE_TYPE>.

Only thing is this table will be a table without header. So for internal table processing we need to define a work area structure of type line of line type . EX:

DATA: WA_ITAB TYPE <LINE_TYPE>.

Table type:

1) In SE11 in Data Type Enter your Table type's name.

2) Click Create; Choose Table Type

The maintenance screen for Table types appears.

3) In Row Type , you can specify : a Data type/Data element/Structure

4) You can change:

The access mode as desired on the Access category.

Define the Key of the table type on the Key tab page.

5) Save and Activate the table type.

Declaration : itab type <table_type>.

Structure:

data : begin of itab occurs 0.

include <structure>.

data : end of itab.

Regards

Sandeep Reddy

Read only

Former Member
0 Likes
688

Hello,

Please, read this: .

Regards,

Read only

0 Likes
688

Hi,

Awesome I did not know this site will work like this your inputs were very help full.

What I infered from your inputs is that we should not use occurs 0 in our coding, instead we can go either by declaring types statement in our code or by defining the structure in SE11.

Am I on the way ?

let me know, if I got you wrong.

Thanks and Regards,

V.K.

Read only

Former Member
0 Likes
688

Ya Vikram...you r exactly rite.

you should not use OCCURS.

Wat evr I posted, if that helped you.....reward points.

Regards

Sandeep reddy