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

Cloning persistent objects

peter_norris
Explorer
0 Likes
529

Does anyone know if ABAP Persistent Objects support cloning?

I can clone the object using a SYSTEM-CALL (though I'd rather not), however that would still mean breaking the rules to set the object key to a new value.

At the moment the only solution appears to be creating a new persistent or transient object via the agent and manually assigning the attributes.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
496

Hello Peter

Perhaps you will find the solution in the following thread

Regards

Uwe

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
497

Hello Peter

Perhaps you will find the solution in the following thread

Regards

Uwe

Read only

0 Likes
496

Thanks Uwe. I knew about the SYSTEM-CALL but in this case it does not help.

My problem is that the object key of a persistent object does not appear to be easily modified even from within the object. I want to clone the object and then modify the key to avoid insert collisions.

So far as I can see there is no simple way of modifying the business key of a persistent object.

For now I've implemented IF_OS_CLONE~CLONE in a public method of my persistent object, created a new persistent object and manually assigned the attributes. Unfortunately the code will have to be modified whenever a new attribute is added.