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

Local table types Usage?

Former Member
0 Likes
3,388

Hi,

While going through the Advanced ABAP document, I found that we can declare a line type using the TYPES statement and using this line type we can declare a local table type.

TYPES:

BEGIN OF gty_ekbe, "Data from EKBE.

matnr TYPE ekbe-matnr,

werks TYPE ekbe-werks,

bwart TYPE ekbe-bwart, "Movement type

bpwes TYPE ekbe-bpwes, "Blocked stock

END OF gty_ekbe.

TYPES: gtty_ekbe TYPE STANDARD TABLE OF gty_ekbe

WITH NON-UNIQUE KEY matnr werks.

DATA:

gt_ekbe_s TYPE STANDARD TABLE OF gty_ekbe

WITH NON-UNIQUE KEY matnr werks,

gt_ekbe_tty TYPE gtty_ekbe.

My Query:

What is the significance of this..? I can declare a internal table using the Line type, then what extra we are achieving by declaring a local table type?

Please provide your opinions.

Regards

s@k

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
2,259

The local table type can be used in subroutines when passing data using the USING or CHANGING parameter. The same holds true when you are using local classes and call a method. Then as your type you can using TYPE gtty_ekbe.

Read only

0 Likes
2,259

If you are asking about TYPES statement then, it has lot of advantages.

Say, you can declare a type of your own, and it can be used in creating table type and line types, its generic and easy to use as when u need to change a structure of same type of object which are many times declared.

venkat

Read only

Former Member
0 Likes
2,259

line type refers to the structure of an internal table whereas row type is the actual part that contains the data and it refers to the table body.creating internal table using line type and row type concept is for reusability purpose.Line type and Row type are defined at DDIC LEVEL.

LINE TYPE CAN HOLD ONE RECORD. (WORK AREA)

ROW TYPE CAN HOLD MULTIPLE RECORDS. (BODY)

Read only

0 Likes
2,259

Hi Friend ,

Please see the below sap help links for the details of both Line type & table type

Line Type:

[http://help.sap.com/saphelp_nw04/helpdata/en/30/4fbac72e5f11d5b694006094192fe3/frameset.htm]

Table Type:

[http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm]

Regards.

Read only

Former Member
0 Likes
2,259

Hi,

Thanks a lot to everyone...:)

Regards

s@k