Start of Content Area

Background documentation Mapping by Instance-GUID  Locate the document in its SAP Library structure

To map database tables and objects using instance GUIDs, you must create special tables that have exactly one primary key field of the type OS_GUID from the ABAP Dictionary. The Persistence Service uses the key field to address the managed objects internally. The persistent class does not have a corresponding key attribute.

The key column of this special table is filled with the instance GUIDs. Each instance GUID is unique within a client. At runtime, the Persistence Service identifies each object of the persistent class using its instance GUID and assigns it to a single line in the database table accordingly.

All the other fields in the database table can then be to value attributes of the persistent class.

Thus the instance GUID is a fixed-length technical key that is externally invisible and that lets you access instances simply, particularly where the objects are closely interlinked.

When you map a persistent object by business key, you can get a reference to it by specifying a semantic key. However, you cannot do this with objects mapped by instance GUID. You must get the reference using a separate method before the object is first accessed in a program and then manage it yourself (in an internal table, for example). You can use Mapping by Instance-GUID and Business Keys to simplify this process.

Mapping solely by instance GUID is best suited to objects that are purely dependent on other objects, since you do not have to access them explicitly in the ABAP program. You can save these objects long-term by saving their object references.

 

 

End of Content Area