Application Development 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: 

Persistance class

Former Member
0 Kudos

Hi

what is the significance of persistance class in ABAP ?

How does it differ from other class ?

Regards

Subin.S

5 REPLIES 5

GrahamRobbo
Active Contributor
0 Kudos

Hi Sub,

Persistence classes are used to manage "persistent data". Persistent data is the only kind of data in the system that is permanent. In other words data that is stored in the database.

The purpose of persistent objects is to abstract the physical data representation (i.e. database tables, rows, columns).

Lots of stuff in SAP Help. Look up "Persistent Objects". Also some good examples in a few SDN Blogs.

Cheers

Graham

Former Member
0 Kudos

Persistence is the storing of a message to a database (in AFW) so that it is restartable. Asynch messages are persisted, synch are not.

Reward points if useful..............

Regards

Minal

0 Kudos

Hi Minal

Your explanation might or might not be correct however it is not very meaningful I'm sure to most of the readers on this forum.

I think my explanation whilst not so technical is a bit easier to understand - especially if one doesn't have a lot of familiarity with "Objects" and "classes".

Cheers

Jimbo

GrahamRobbo
Active Contributor
0 Kudos

Former Member
0 Kudos

For a simple explanation.

Take a Sales order. This contains all sorts of information such as quantities of materials, the materials themselves, prices, delivery schedules, special handling conditions / delivery instructions, customer. contact people etc etc. Other associated data is also often required such as has the order been invoiced, has it been paid, has the payment gone to AR (in FI) and been booked etc etc.

In "Classical" SAP all this data is stored in several tables which require quite a lot of programming to retrieve a "complete" sales order.

Now if we treat a "Sales Order" as a single object all the information we need can be stored in a "Sales Order" object.

In "Normal" SAP when you want to access this SALES ORDER you instantiate it by giving it a key - the Sales order number.

A special method called "Constructor" will build the sales order based on all the data in various tables which might involve considerable complex programming and retrieval of data from various different SAP modules.

Your application program just has to retrieve the sales order --all the programming has been done in the class. All the data is returned to your application program as "attributes" which you can reference directly.

Now if we take this one step further we could actually save the data in the sales order object so that the next time it's retrieved we don't have to go through complex programming to build the object.

By saving this data we then refer to the object as a "persistent" object.

The persistence service manages the link between our object and the SAP tables.

Unfortunately a traditional Relational data base system like SAP which is built up on relations in two dimensional tables isn't very efficient in handling data saved as Objects so the persistence service is like another layer of system software which helps to manage the actual SAP database retrievals or updates.

In the future OBJECT orientated databases will make the whole idea of persistent objects very much more useful and there are currently some "Hybrid" type database systems which combine the advantages of the current RDBMS systems (easy SQL ad hoc queries, Programming language independence etc.) with ODBMS systems.

A very common OBJECT orientated database system which as an individual you can freely download and try out is the db4o system.

http://www.db4o.com/?src=ODBMS-download

Cheers

Jimbo