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 classs

rafael_menezes
Explorer
0 Likes
1,013

Hi,

Could anyone send a snippet with a "how-to-use" example of the method IF_OS_CA_PERSISTENCY~GET_PERSISTENT_BY_OID??

Regards,

Rafael Menezes

1 ACCEPTED SOLUTION
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
931

Hi Raf,

there are lots of blogs and other help on this. Just do a search in SDN for them.

I like this blog from Thomas. /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql

Cheers

Graham

6 REPLIES 6
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
932

Hi Raf,

there are lots of blogs and other help on this. Just do a search in SDN for them.

I like this blog from Thomas. /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql

Cheers

Graham

Read only

0 Likes
931

Hello Graham. Thanks for your help. But this is the way I know how to use persistent class. I'd like to see an example using Instance-GUID like in

[Mapping by Instance-GUID and Business Key|http://help.sap.com/saphelp_nw04s/helpdata/en/b1/82309cd26611d4b2e90050dadfb92b/frameset.htm]

I've browsed tons of documents here in SDN and couldn't find any with a practical example.

I mean, like SAP Help, they mention the Instance-GUID way, but don't show an example.

Regards,

Rafael Menezes

Read only

0 Likes
931

Hello Graham. Thanks for your help. But this is the way I know how to use persistent class. I'd like to see an example using Instance-GUID like in

Mapping by Instance-GUID and Business Key

I've browsed tons of documents here in SDN and couldn't find any with a practical example.

I mean, like SAP Help, they mention the Instance-GUID way, but don't show an example.

Regards,

Rafael Menezes

Hi,

I know it's quite a time, but it might help someone else. I am just looking into this technique but I think it's like this.

First of all, if you want to use OID, you have to create a field in a Transparent Table which is of a type OS_GUID. You can see this guide for details: [Mapping by Instance-GUID|http://help.sap.com/saphelp_nw04s/helpdata/en/b1/82309fd26611d4b2e90050dadfb92b/frameset.htm]

I think you have probably read that.

After that, you will see, that the method IF_OS_CA_PERSISTENCY~GET_PERSISTENT_BY_OID gets automatically implemented. And by calling this method, you can get your Persistent Object after supplying this method with an OID parameter.

Example of use:

I would use it for example when I would want to remember data currently being edited by a certain user and display the same conent next time the user runs a transaction. To achieve this I would create a table with a user name as a key field and OID as a second field. And this way I would remember Persistent Object's OID for each user .

Read only

Former Member
0 Likes
931

Hi Rafael,

The interface method GET_PERSISTENT_BY_OID might not be having any implementations in the versioning of SAP.

Better check some function modules GETGUID* and write your own implementation with help of these findings.

There are number of functions for GETGUID*.

Hope you find outthe function module.

Regds,

Gaurav

Read only

Former Member
0 Likes
931

Can any one explain about persistent class.

I want definition .

And functionality

Read only

0 Likes
931

Can any one explain about persistent class.

I want definition .

And functionality

There is a nice explanation here:

[Concepts Used in Persistence|http://help.sap.com/saphelp_nw04s/helpdata/en/f5/a3682ebc6911d4b2e80050dadfb92b/frameset.htm]

Simply put, Persistent Objects are objects which don't disappear after a program ends. Technically, Persistent Object is connected to a Transparent Table and all its data (attributes) are saved there and can be loaded later on.

Try SE80 and create a Persistent Object for yourself.