Application Development 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: 

Difference between like and type

Former Member
0 Kudos

Hi,

If is often advised to use type instead of like. Please tell the reason .

Points will be rewarded.

Regards

3 REPLIES 3

Former Member
0 Kudos

type is for predefined data type

where as like is for usedefined datatype.

example.

data: a1 type i.

for like

types: a1 type i.

data: a2 like a1.

see here a1 acts like interger datatype and it is a userdefined datatype.

if useful reward with points

Former Member
0 Kudos

Hi,

Please refer to the link below :

Thanks,

Sriram Ponna.

Edited by: Sriram Ponna on Feb 10, 2008 7:47 PM

Edited by: Sriram Ponna on Feb 10, 2008 7:48 PM

Clemenss
Active Contributor
0 Kudos

Hi Ashish,

TYPE is used as a reference to basic type (i.e. c,i,n,..) or data dictionary type (i.e. data elelement, structure, table, table type...).

LIKE is using as reference to an existing data type.

Because in the past (I guess until Release 2 of R/3) there was no TYPE allowed, everything was LIKE and for upward compatibility reasons you can still use it.

Regards,

Clemens