‎2006 Nov 28 6:43 AM
‎2006 Nov 28 6:50 AM
Hi,
You can create strutres using types statement and then make the data declarations to refer them.
For eg.
types : begin of ty,
matnr type mara-matnr,
end of ty.
data itab type standard table of ty.
Here ty is the structure and itab is the internal table refering the structure.
‎2006 Nov 28 6:50 AM
Hi,
You can create strutres using types statement and then make the data declarations to refer them.
For eg.
types : begin of ty,
matnr type mara-matnr,
end of ty.
data itab type standard table of ty.
Here ty is the structure and itab is the internal table refering the structure.
‎2006 Nov 28 6:51 AM
Hi Sanjeev,
TYPES statement define the structure of your memory space without allocation of memory, DATA statements allocate the memory at runtime.
Regards,
Chetan.
PS:Reward points if this is helpful.
‎2006 Nov 28 6:52 AM
hi sanjeev,
check these threads...
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm
http://searchsap.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid21_gci1213769,00.html
hope this helps,
do reward if it helps,
priya.
‎2006 Nov 28 6:54 AM
hi,
in simple words.
using type we are creating structre.
it will not hold any memory area.
but when we use data-> it can refer only a datafield that hold a memory area.
rgds
Anver
‎2006 Nov 28 6:55 AM
hi,
i am putting it in simple words
TYPES:
The types statement creates a new type
eg:
TYPE type1
The new type is defined by its type type1.
type1 may be one of the predefined types (C, N, F, etc) or
a type that you have defined yourself using TYPES,
or a type defined in the ABAPDictionary.
DATA:
if u want to create variables which will store values in your program, u use the data statement
eg:
DATA data1.
Creates an internal field data1 in the program with default length
you can declare a variable of a specific type
DATA d1 type i
Field d1 is created with type I, and can then be used in the program. In particular, you can assign numeric values to the field and use it to perform calculations
Hope this will be helpful
and u can mark points if u want to
Regds,
Vs
‎2006 Nov 28 6:56 AM
Hi,
1>TYPES statement defines the structure without allocation of memory, DATA statements allocate the memory at runtime.
2>create a structure by using types statement and refer it by using the DATA statement.
3>In order to avoid the internal table declaration without header line ,we are declaring a structure by types statemnet and declaring an internal table with reference to the structure.
regards,
Nagaraj
‎2006 Nov 28 6:58 AM
Hi
TYPES just gives you the prototype and will not assign any memory for the datas. But where as DATA will assign memory for the variables. Using TYPES you can create user defined data types.
Here is the example
TYPES: t1(10) TYPE c.
DATA: s1 TYPE t1.
s1 = 'asdfjkl'.
WRITE: s1.
Here "t1" is just an user defined data type of string length 10 and does not occupy any memory since it is a prototype
but s1 is occupies 10 bytes of memory.
‎2006 Nov 28 7:12 AM