03-26-2008 9:09 AM
What is the difference between
TYPES:begin of ty_bseg,
bukrs type bseg-bukrs,
belnr type bseg-belnr,
gjahr type bseg-gjahr,
end of ty_bseg.
AND
DATA:begin of it_bseg,
bukrs type bseg-bukrs,
belnr type bseg-belnr,
gjahr type bseg-gjahr,
end of it_bseg.
With regards
Vijay
03-26-2008 9:32 AM
hi,
The difference between TYPES and DATA is that in using TYPES we only define the data type and no object is created thus no memory is allocated to it. While using DATA statement , object is created thus allocating memory to it.
in your eg. the structure which u have written with TYPES is just a data type and u have to create a data object of type structure using DATA statement.
eg.
DATA: obj1 type struct_type
where as in DATA statement in ur eg , u dont need to declare data object as it is already defined
plz reward if found useful
mayank
Edited by: Mayank Agarwal on Mar 26, 2008 10:33 AM
03-26-2008 9:33 AM
Hi Vijay,
Types will help u to create a structure(the term stucture in r/3 refers to only DDIC object containing colllection of field)
while Data will help u to create field string..........
(term field string applies to a collection of fields defined in an abap program)
cheers
Mohinder Singh Chauhan
Edited by: Mohinder Singh Chauhan on Mar 26, 2008 10:33 AM
03-26-2008 9:38 AM
hi,
this is not the case using TYPE statement u can declare structure as well as tables it depends on how one declares in DATA statement.
DATA : obj1 TYPE ty_bseg " this is a structure
DATA : obj2 TYPE TABLE OF ty_bseg " this is a internal table
mayank
Edited by: Mayank Agarwal on Mar 26, 2008 10:39 AM
03-26-2008 9:36 AM
Types are using for creating structure. strecture can be used more than one program.
03-26-2008 10:01 AM