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

statement declaration

Former Member
0 Likes
606

Hi

Please let me know what is the difference between the below mentioned two declarations:

Types:Begin of A,

no TYPE i,

name TYPE i,

wage TYPE i,

END OF A.

*I want to know the difference between these three statements:

B TYPE A.

B TYPE TABLE OF A

CLASS_DATA: B TYPE TABLE OF A.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
579

hi,

For the first one:

B type A: it will create a work area which will hold only one record at a time similar to the structure defined with TYPES.

B type Table of A : This statement defines an internal table which is similar to the structure that has defined with TYPES.

CLASS-DATA: The statement CLASS-DATA can only be used in the declaration part part of a class or an interface.The statement declares a static attribute which validity is not associated with instances of a class but with the class itself. All instances of the class and its subclasses access the same static attribute.

Thanks,

Sneha

5 REPLIES 5
Read only

former_member585060
Active Contributor
0 Likes
579

B type A ====creates a Work Area of A structure,

B type table of A === creates an internal table without header line of A structure

3rd one its OOps concept off declaring a STATIC ATTRIBUTES.

Edited by: Bala Krishna on Aug 11, 2008 7:56 PM

Read only

0 Likes
579

TYPES used to declare structures.

DATA is actually where memory allocates

Read only

Former Member
0 Likes
579

Hello,

Data: B TYPE A.

Creates a work area with the structure of type A.

Data: B TYPE TABLE OF A.

Creates an internal table w/o header line with the structure of type A.

CLASS_DATA: B TYPE TABLE OF A.

Can be included in a class definition and will create a static attribute valid not only for the instances but for the class. The value can be accessed with class=>b.

Regards

Read only

Former Member
0 Likes
581

hi,

For the first one:

B type A: it will create a work area which will hold only one record at a time similar to the structure defined with TYPES.

B type Table of A : This statement defines an internal table which is similar to the structure that has defined with TYPES.

CLASS-DATA: The statement CLASS-DATA can only be used in the declaration part part of a class or an interface.The statement declares a static attribute which validity is not associated with instances of a class but with the class itself. All instances of the class and its subclasses access the same static attribute.

Thanks,

Sneha

Read only

Former Member
0 Likes
579

Hi,

B TYPE A : work area declaration here we are providing single value only.

B TYPE TABLE OF A : internal table declaration here we r providing multipul values.

CLASS_DATA: B TYPE TABLE OF A.: i dont no Exactly.

Thanks&regards,

Naresh.