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

persistent objects

Former Member
0 Likes
753

why do we need persistent classes , wats its use ...

5 REPLIES 5
Read only

athavanraja
Active Contributor
0 Likes
729

read this online help

http://help.sap.com/saphelp_nw04/helpdata/en/f5/a36828bc6911d4b2e80050dadfb92b/frameset.htm

and this weblog

/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql

Regards

Raja

Read only

Former Member
0 Likes
729

i hav solved the problem

Read only

Former Member
0 Likes
729

hey swapnil,

this question is haunting me too...

even though i have gone through help.sap and few blogs.. i could not find the answer.

kindly let me know why are persistent objects used.

-manasi

Read only

Former Member
0 Likes
729

In SE24, Transaction we can create classes of different types like Usual ABAP class, persistenct classes,Exception classes.

If we want to work with any database tables like MARA, SPFLI etc... we can create a persistent class and to this we can use tables and fields of those tables inside this class.

When we try to create this type of class- Actor class is automatically generated. Upon activation of this class, if we click on PERSISTENT button It asks for table/struture to be included from there we can select the required fields.

The main advantage of using these classes inorder to reatin the state of an object eventhough the application r program that is used to create this object is closed r lost. It maintains the state of an object beyond the life of an object. Here the instances are stored in permanent medium and we can retirve the instance at any point of time. Here the methods create,delete,get,set etc are automatically created and if we want we can redefine these methods. We can retieve values and work on tables using this classes using these methods . we need not hava to write any slelect queries again. Sometimes when we try to tranfer one object to other, we need to maitnain the state of an object( ie the attributes and thier values) for any communication. In order to maintian this state we go for thses classes.

Encourage me by rewarding the points.

Regards

Chandralekha

Read only

Former Member
0 Likes
729

One more advatnage of using these persistent classes are to avoaid any incosistencies to the database tables. If we are given direct access to databese tables then inconsistencies in data may arise. To restrict this we also go for this type of classes