‎2006 Jul 20 10:34 AM
Is DATA a pre-defined data type in ABAP/4. what are its attributes.
‎2006 Jul 20 10:46 AM
so what does the below statement mean virtually.
data: data_ref TYPE REF TO DATA.
‎2006 Jul 20 10:37 AM
Hi,
DATA is used to declare a variable in ABAP.
Check with F1 help.
Rgds,
Prakash
‎2006 Jul 20 10:39 AM
Hi,
DATA is a keyword in ABAP/4 used to decalre any variables.
Regards,
HR
‎2006 Jul 20 10:41 AM
DATA is not a predefined data type in ABAP. It is a keyword used to define variables.
For eg
DATA: text type C, number type i.
The table below shows the predefined ABAP types.
Type Description
b 1 byte integer (internal)
c Text field
cursor Database cursor
d Date field
f Floating point number
i 4 byte integer
n Numeric text
p Packed number
string Text string
s 2 byte integer (internal)
t Time field
x Byte field
xstring Byte string
-Kiran
‎2006 Jul 20 10:42 AM
Hi vinutha,
Data is not a predefined data type..but it is a predefined type. It is used to declare a variable of any data type.The declared data object(varible) is visible within the current context as of this position.
You can use DATA Statement in two ways
DATA: spfli_wa1 TYPE spfli,
spfli_wa2 LIKE spfli_wa1.
Hope this helps u.
Regards,
Sharadha
‎2006 Jul 20 10:46 AM
so what does the below statement mean virtually.
data: data_ref TYPE REF TO DATA.
‎2006 Jul 20 10:51 AM
Hi,
any object will be defined as as generic reference variable:
DATA: numref TYPE REF TO DATA,
number TYPE I VALUE 123.
FIELD-SYMBOLS: <fs> TYPE ANY.
GET REFERENCE OF number INTO numref.
ASSIGN numref->* TO <fs>.
such generic reference variable can contain references to data objects of any type. In that example a reference to data object NUMBER will be created and then the data object will be assigned to <FS> with the dereference operator ->*
‎2006 Jul 20 10:56 AM
Using the REF TO addition, you declare a reference variable ref. The specification after REF TO specifies the static type of the reference variables. The static type limits the set of objects to which ref can point.
Example
In this example, an object reference oref and two data references dref1 and dref2 are declared.
CLASS c1 DEFINITION.
PUBLIC SECTION.
DATA a1 TYPE i VALUE 1.
ENDCLASS.
DATA: oref TYPE REF TO c1,
dref1 LIKE REF TO oref,
dref2 TYPE REF TO i.
Hope you are clear now..
Reward points if u find this helpful..
Regards,
Sharadha