2007 May 16 5:55 AM
2007 May 16 6:18 AM
Hi kotireddy,
type is used for declaring built-in variables like integer,float..
for eg if u r creating a internal table itab it should be like another table itab2..
then syntax is
data itab1 like itab2 occurs 0 with headre line...
2007 May 16 5:57 AM
Hi,
type we can use to refer system defined or user defined data types and data dictionary objects..
like we will use in case of refering data dictionary objects only.
rgds,
bharat,
2007 May 16 5:58 AM
type is to declare variables using other data types defined in the dictionary or in ur program(using the TYPES keyword).
like is to declare variables using all declared variables
Hope this will solve ur problem..
<b><u>Dont forget to reward all the useful replies</u></b>
Sudheer
2007 May 16 6:06 AM
DATA x TYPE zzzzzz
Here zzzzzz is either :
1. A standard ABAP type ( i,c,d,p,n etc)
2. A data element,domain,structure,table type in data dictionary.
DATA y LIKE wwwww.
Here wwwww is another variable/constant that is previoulsy declared/avaiable in your report.
eg : DATA ucomm LIKE sy-ucomm.
2007 May 16 6:13 AM
hi koti reddy,
look at this,,
*This is type definition do not hold any data its just a structure..
types : begin of itab,
f1 type c,
f2 type c,
end of itab.
Now you can use <b>TYPE</b> not <b>LIKE</b> for this because this is just a structure.defining an internal table/ <b>DATA OBJECT</b>
data : it_itab <b>TYPE</b> STANDARD TABLE OF itab. "you are using type to structures
Now another table
data ITAB2 <b>LIKE</b> it_itab. "you can use <b>LIKE</b> to data Objects
you can 't do like this
data itab2 like itab. "this is wrong
rewards if understood
regards,
nazeer
2007 May 16 6:13 AM
Hi,
Diff bn TYPE N LIKE.
Go through the link.
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm
TYPE - Type is used to tell the system what is the type of data object(variable) you want to create .
LIKE: If there is already a data object declared and you want to declare a similar data object you can just refer to the previous data object using like.
Check this thread.
https://forums.sdn.sap.com/click.jspa?searchID=711746&messageID=2270752
https://forums.sdn.sap.com/click.jspa?searchID=711746&messageID=512214
Regards,
Priyanka.
2007 May 16 6:15 AM
hi,
type is generally used for declaring variables, parameters for existing data types in abap
for ex: to declare a inter value and character variable of length 10 is as,
data: i1 type i,
c1(10) type c.
like generally refers to existing data objects in abap.
for ex:
data: matnr like mara-matnr,
vbeln like vbap-vbeln.
creating variables matnr, vbeln from existing fields of tables mara, vbap.
when user creates a user defiend structure for work areas, internal tables we generally use type keyword as
types: begin of itab,
.........
.........
........
end of itab.
data: itab1 type itab occurs 0 [with header line]
.............
if helpful reward some points.
with regards,
suresh babu aluri.
2007 May 16 6:18 AM
Hi kotireddy,
type is used for declaring built-in variables like integer,float..
for eg if u r creating a internal table itab it should be like another table itab2..
then syntax is
data itab1 like itab2 occurs 0 with headre line...
2007 May 16 6:19 AM
Hi kotireddy,
type is used for declaring built-in variables like integer,float..
for eg if u r creating a internal table itab it should be like another table itab2..
then syntax is
data itab1 like itab2 occurs 0 with headre line...
Reward if it's useful..
Reg'
Zeemaaaaa...
2007 May 16 6:24 AM
Hi,
TYPE is used to refer a data type in the ABAP dictionay i.e., a predefined data type whereas LIKE is used to refer to the data type of a local data object in the program.
Reward if useful.
Regards
Sayee
2007 May 18 10:48 AM
U need to <b><u>award points for all the useful replies</u></b>, and also u nees to <b><u>mark it as Answered if ur problem is solved</u></b>.
Regards
Sudheer