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

Types and data

Former Member
0 Likes
605

What is the difference between Types and data declarations

Thanks

Durga Prasad

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
581

Hi Durga Prasad,

Types is actually used to create a user-defined type of data type and Type is used to refer existing data type.

Data Declarations is used to refer a variable or constant using a data type.

Hope this helps.

Please reward if useful.

Thanks,

Srinivasa

4 REPLIES 4
Read only

Former Member
0 Likes
581

data declarations is when you declare your data types.

Read only

Former Member
0 Likes
582

Hi Durga Prasad,

Types is actually used to create a user-defined type of data type and Type is used to refer existing data type.

Data Declarations is used to refer a variable or constant using a data type.

Hope this helps.

Please reward if useful.

Thanks,

Srinivasa

Read only

ferry_lianto
Active Contributor
0 Likes
581

Hi,

TYPES just gives you the prototype and will not assign any memory for the data. Whereas DATA will assign memory for the variables. Using TYPES you can create user defined data types.

For example:


TYPES: T1(10) TYPE c.

DATA: S1 TYPE T1.

S1 = 'ABCDEFG'.

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. However S1 is occupies 10 bytes of memory.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
581

Hi,

The functionality is almost same for Types and Data.

Types is used to declare a variable of predefined data type which is declared in data dictionary.

Like is used to refer to the data which has been already defined. For example, in implementing enhancements, u will be need to do some customization to the exising code. so you will declared using like statment.

example: data: ls_likp like xlikp.

Regards,

Niyaz