‎2004 May 12 10:02 PM
I am trying something out with the Prototype design pattern, which involves cloning one object from another. In C++ you have copy constructors and in Java a Clone method that do the basic cloning work. I am fairly sure I don't see an equivalent built-in feature in ABAP Objects. Is anyone aware of a good template or example for writing a cloning method? (Note: some if the interfaces in the ixml library, for example, if_ixml_stream, have a clone method, but I can't find any implementing classes.)
‎2005 Nov 13 5:40 PM
hi.
I've find interface:
IF_OS_CLONE.
The implementation is CL_OS_STATE.
In method "IF_OS_CLONE~CLONE" there's a system call:
SYSTEM-CALL OBJMGR CLONE <instance> TO <clone>.
where instance is instance clonnable and clone is the result.
ABAP Object don't support general class OBECT where you find clone method.
Ciao
‎2005 Nov 13 8:55 PM
There is a buit in feature of CLONE in ABAP Objects. See example of clone methods in UserCompany object in transaction BAPI. You can also see examples of clone methods in Business Object USER
Cheers,
Satya