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

TYPE and LIKE

Former Member
0 Likes
560

what is the difference between the key words 'TYPE' and 'LIKE', In wht scenarios we can we use them, and in what r the scenarios we cant use these.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
540

hi,

TYPE addition:

With TYPE addition, you can refer either to local data types of the

same ABAP program or on global data types of the Dictionaries.

Local types mask global types that have the same names. When typing

the interface parameters or field symbols, a reference is also

possible to generic types ANY, ANY TABLE,INDEX TABLE, TABLE or

STANDARD TABLE, SORTED TABLE and HASHED TABLE.

LIKE addition:

With the LIKE addition, you can refer to all visible data objects

at the ABAP program's positon in question. Only the declaration of

the data object must be known. In this case it is totally

irrelevant whether the data object already exists physically in

memory during the LIKE reference. Local data objects mask global

data objects that have the same name.

Sri

what is the difference between the key words 'TYPE' and 'LIKE', In wht scenarios we can we use them, and in what r the scenarios we cant use these.

2 REPLIES 2
Read only

former_member194669
Active Contributor
0 Likes
540

Hi,

Check this Link

Read only

Former Member
0 Likes
541

hi,

TYPE addition:

With TYPE addition, you can refer either to local data types of the

same ABAP program or on global data types of the Dictionaries.

Local types mask global types that have the same names. When typing

the interface parameters or field symbols, a reference is also

possible to generic types ANY, ANY TABLE,INDEX TABLE, TABLE or

STANDARD TABLE, SORTED TABLE and HASHED TABLE.

LIKE addition:

With the LIKE addition, you can refer to all visible data objects

at the ABAP program's positon in question. Only the declaration of

the data object must be known. In this case it is totally

irrelevant whether the data object already exists physically in

memory during the LIKE reference. Local data objects mask global

data objects that have the same name.

Sri