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

difference between two type statement.

Former Member
0 Likes
789

What is the difference between these statement ?

TYPES: BEGIN OF mytext,

number TYPE i,

name(10) TYPE c,

END OF mytext.

TYPES mytab TYPE STANDARD TABLE OF mytext WITH DEFAULT KEY.

thanks for your help.

-siva

Edited by: Sivanantham kandan on May 5, 2008 6:23 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
767

Hi Siva,

TYPES: BEGIN OF mytext,

number TYPE i,

name(10) TYPE c,

END OF mytext.

TYPES mytab TYPE STANDARD TABLE OF mytext WITH DEFAULT KEY.

The fiirst one is a structure with two fields namely number and name

The other one is an internal table with the type of the structure and the first field as the key.

Pls reward if useful.

THanks,

Sirisha.

6 REPLIES 6
Read only

Former Member
0 Likes
767

TYPES: BEGIN OF mytext,

number TYPE i,

name(10) TYPE c,

END OF mytext. -


> Declaring an internal table

data : mytab TYPE STANDARD TABLE OF mytext WITH DEFAULT KEY. ---> Creating Data object

Regards

Kannaiah

Read only

Former Member
0 Likes
767

earlier one is used to define customized type... the late one is to use standard data type available...

Read only

Former Member
0 Likes
767

Hi,

In first type statement "A structure is made in which the fields are directly attached to the data element"

In second statement "A table is created of the above defined structure with default key as the first field of the table".

reward if helpful,

kushagra

Read only

Former Member
0 Likes
767

Hi Sivanantham,

TYPES: BEGIN OF mytext,

number TYPE i,

name(10) TYPE c,

END OF mytext.

This defines a structure with two fields.

TYPES mytab TYPE STANDARD TABLE OF mytext WITH DEFAULT KEY.

This creates a table for the above defined structure.

Hope it helps.

Regards

Hemant Khemani

Read only

Former Member
0 Likes
768

Hi Siva,

TYPES: BEGIN OF mytext,

number TYPE i,

name(10) TYPE c,

END OF mytext.

TYPES mytab TYPE STANDARD TABLE OF mytext WITH DEFAULT KEY.

The fiirst one is a structure with two fields namely number and name

The other one is an internal table with the type of the structure and the first field as the key.

Pls reward if useful.

THanks,

Sirisha.

Read only

0 Likes
767

Thank You.

-siva