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

Data Type

Former Member
0 Likes
844

Is DATA a pre-defined data type in ABAP/4. what are its attributes.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
818

so what does the below statement mean virtually.

data: data_ref TYPE REF TO DATA.

7 REPLIES 7
Read only

Former Member
0 Likes
818

Hi,

DATA is used to declare a variable in ABAP.

Check with F1 help.

Rgds,

Prakash

Read only

Former Member
0 Likes
818

Hi,

DATA is a keyword in ABAP/4 used to decalre any variables.

Regards,

HR

Read only

Former Member
0 Likes
818

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

Read only

Sharadha1
Active Contributor
0 Likes
818

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

Read only

Former Member
0 Likes
819

so what does the below statement mean virtually.

data: data_ref TYPE REF TO DATA.

Read only

0 Likes
818

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 ->*

Read only

0 Likes
818

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