‎2009 Nov 19 7:53 AM
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
‎2009 Nov 19 8:24 AM
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.
‎2009 Nov 19 9:36 AM
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
‎2009 Nov 19 12:25 PM
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)
‎2009 Nov 19 8:09 PM
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.
‎2009 Nov 26 12:06 PM