‎2008 Dec 02 6:06 AM
hi ppl,
Isit mandatory to declare a class component for a class-data.
‎2008 Dec 02 1:06 PM
Hi Priyank,
Uwe wrote:
If your class contains only attributes which make sense in the context of a specific instance then you do not need any static attributes.
However, if you want to provide "generic" data which are independent of a given instance but useful to all instances then it makes sense to have static attributes.
What Uwe wrote is absolutely correct !
Have a look at [ABAP Objects - Creating your First Local Class - Defining Components|https://wiki.sdn.sap.com/wiki/display/Snippets/ABAPObjects-CreatingyourFirstLocalClass-DefiningComponents], It explain how to Define Instance and Static component in a Class.
Regards,
Marcelo Ramos
‎2008 Dec 02 12:38 PM
Hello Priyank
If your class contains only attributes which make sense in the context of a specific instance then you do not need any static attributes.
However, if you want to provide "generic" data which are independent of a given instance but useful to all instances then it makes sense to have static attributes.
Regards
Uwe
‎2008 Dec 02 1:06 PM
Hi Priyank,
Uwe wrote:
If your class contains only attributes which make sense in the context of a specific instance then you do not need any static attributes.
However, if you want to provide "generic" data which are independent of a given instance but useful to all instances then it makes sense to have static attributes.
What Uwe wrote is absolutely correct !
Have a look at [ABAP Objects - Creating your First Local Class - Defining Components|https://wiki.sdn.sap.com/wiki/display/Snippets/ABAPObjects-CreatingyourFirstLocalClass-DefiningComponents], It explain how to Define Instance and Static component in a Class.
Regards,
Marcelo Ramos
‎2008 Dec 02 3:57 PM
Hi Priyank dev,
It is not mandatory to use calss-data in declaring a class.This class-data is coming into picture
when you want to declare static data(instance free data).
Normally, we are using data as instance wise in class context.If you want to use data instance free that is available to all the instances.
if you have any doubts , raise your questions.
Thank you,
Prasad GVK.
‎2008 Dec 03 4:45 AM
hi thank u all..its a very vital information for me.thanks a lot.