Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abap Programming : Using Like and Type

Status
Not open for further replies.

melly

MIS
Nov 26, 2002
1
SG
In the book it says using "type" is more specific than using "Like" ,
but when using either, aren't they the same.

Also, in the context of work Area structure, how are they relevant? Thanks.
 
Hi melly,
Basically the effect of LIKE and TYPE is the same. The rule is when referring to a data dictionary object, use type; when referring to data storage already allocated, use like. If you need 2 identical itabs, define the first one using types (pointing to table fields defined in the dictionary), and define the second itab by one statement: Data: itab2 like itab1. To meet the SAP guideline, take an older ABAP program and mass replace all the LIKEs with TYPE. Typically only a couple of statements will need to remain as LIKEs. TYPE becomes more important when implmenting ABAP classes (OOP).
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top