08-23-2007 10:59 AM
hi,
i am bulding a class "y4class" using se24 and i have 5 Methods to be used which i have from the example program but can any one guied me waht i need to enter in Attributes tab in SE24.
where can will i need to look for the attributes??
plz help me soon.
mahesh
Message was edited by:
mahesh m
08-23-2007 11:05 AM
Hi Mahesh,
Attributes are the data elements which are avialabe in the class. You can define the attributes wiht Public, Private and Protect and level can be static or instance attribute. Static attribute are available to the class even with our creating obects to it.You can set this with level
<b>Attributes</b>
Attributes are internal data fields within a class that can have any ABAP data type. The state of an object is determined by the contents of its attributes. One kind of attribute is the reference variable. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.
<b>Instance Attributes</b>
The contents of instance attributes define the instance-specific state of an object. You declare them using the DATAstatement.
<b>Static Attributes</b>
The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the CLASS-DATA statement. They are accessible for the entire runtime of the class.
Thanks,
Vinay
08-23-2007 11:08 AM
Hi,
i can not properly understand u....means u don't know how to enter value in attributes for that u have to go in attributes tab and enter the data. Or Click on methods and enter your data in paramenters field/
Rewards points if it is useful.
08-23-2007 11:17 AM
HI, CAN U PLZ TELL ME WAHT IS THE CONTENT WE NEED TO ENTER IN ATTRIBUTES TAB. I HAVE ENTERED METHODS BUT IN ATTRIBUTES TAB WAHT I NEED TO ENTER.
MAHESH
08-23-2007 11:23 AM
Hi,
Attributes are same as the variables which you use in abap program. So you can declare the attributes in class and use them in methods as per your requirement.
Regards,
Azaz.
08-23-2007 11:35 AM
Hi,
Attribute is any data declaration. In real time case if the class is of animal - CAT then you can assign one of the attribute as EYE. And while accessing CAT class , you can assign value through object to the attribute EYE.
obj->cl_cat->eye = 'BLUE'.
So this is the use of Attribute.
Reward if useful!