Newsletter            Wir rufen zurück            Impressum

How to clone ABAP OO objects

If you build new ABAP OO developments, be it for HCM or other modules, as often as we do, you’ll know this issue: you want to simulate something during development and therefore need a temporary copy of a particular object.

Depending on the complexity of this object, this can be quite a bit of effort to create. However, we found using an „inofficial trick“ from SAP saves us a lot of time: the statement „SYSTEM-CALL OBJMGR CLONE me TO result“ creates such an object (in the same way „CREATE OBJECT“ would create a new object from scratch) and copies all attributes from me to result. Brilliant, isn’t it?

Note, that this command is not officially supported, but meant for internal use by SAP only. However, it can come in very handy during development, if you quickly need to verify your solution approach.

Antwort schreiben