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

difference between declations

Former Member
0 Likes
637

Hi all,

what is the difference between the declarions:I'm getting confussion while declaring please clear me:

1.types:itab like mara. To types: itab type mara.

2.types:itab like mara-matnr To types:itab type mara-matnr.

3.types:itab1 type table of mara. To types:itab1 like table of mara.

As we know that:

TYPE : it will allocate memory during execution (object type).

LIKE : it will allocate memory immediately

Type will improve performance.

Thanks,

srii..

5 REPLIES 5
Read only

Former Member
0 Likes
610

hi

we use like key word wen we want to refer to local types/variables

so in types u may use type to declare the variables as u may refer to global types

wen u declare data using data then u may use like to refer to local variables

shiva

Read only

Former Member
0 Likes
610

Hi,

Actually LIKE and TYPE will depend on which object u are assigning..

For Ex:

Data: tab1 type structure1 means tab1 will act as Structure.

Data: tab1 type tabletype means tab1 will act as Internal table.

Regadrs,

Kalp.

Read only

Former Member
0 Likes
610

As per my understanding..TYPE refers to data type and LIKE refers to data object. But SAP allows us to use TYPE and LIKE interchangeably with data type and with data object. Only diff. between these 2 is that from oops point of view only TYPE is allowed not LIKE..other than this I don't think there is any difference of using TYPE or LIKE.

Read only

JoffyJohn
Active Contributor
0 Likes
610

Please refer this link

[Types|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3138358411d1829f0000e829fbfe/content.htm]

Read only

Former Member
0 Likes
610

completed