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

STRUCTURE

Former Member
0 Likes
775

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

5 REPLIES 5
Read only

Former Member
0 Likes
749

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

Read only

Former Member
0 Likes
749

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

Read only

0 Likes
749

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

Read only

Former Member
0 Likes
749

Types are using for creating structure. strecture can be used more than one program.

Read only

Former Member
0 Likes
749

a