1. Generally, if you consider SAP SD, any transaction is uniquely identified in database using Transaction Number or Document Number. Whereas, in SAP CRM this uniquness is identified by GUID.
2. GUID(Globally/Generally Unique Identifier) is a unique field generated by SAP which is a alpha numeric that acts as a primary key to the database table.
3. In CRM, GUID's are either 16 bit, 22 bit or 32 bit character format.
4. With GUID, we would prevent issues with number range conflicts and allow for easier access to CRM tables.
In the above CRMD_ORDERADM_H, there are two objects with the same object id, but what differentiates both the objects is the GUID.
5. GUID's are created using the function module - GUID_CREATE.
Thanks & Regards,
GUID for all Business Transactions is set in table CRMD_LINK. CRM_ORDER_READ is a function module which can be used to get the details of any business transaction based on Header GUID or Item GUID or both.
GUID means Global Unique Identifier. You use a GUID when you need to identify an object/component with a unique id. GUID is a unique key for any object in CRM. In CRM, they are either 16 bit, 22 bit or 32 bit of char and hexadecimal in nature, 2 types of GUIDs Header & item. For header, there will be a unique GUID and for each item-line, there will be another unique GUID.
GUIDs are created using the Function Module “GUID_CREATE” in SAP CRM. From the ‘Export’ parameters, you will know that there are only three types of GUIDs.
A small gift: function modules to data exchange in 16 bit, 32 bit and 22 bit exchange – “GUID_CONVERT”.
One more use of GUID is persistence services and hiding the database accesses. Different business objects of different types may share the same key format and hence may have the same business key although they are of different types and are stored in different tables as the above reply shows. But when we deal with them as ABAP Objects we need to uniquely identify one business object; we can do that using GUID.
When any object is to be transferred to other system it’s the GUID that is used, as there are no replicas and easy to distinguish.
E.g. Consider a Company ‘A’ has 2 departments-Sales1 and Sales2, and in that there are sub departments-products and finance. Now each product and finance of both sales1 and sales2 will have employees with same object_id. So to avoid the dilemma crm creates a GUID for each employee which differentiates each of them.
A Transaction is uniquely idenfied in the database using a Transaction Number / Document Number. In SAP CRM this uniqueness is not driven by the document number, but by SAP GUID. An SAP GUID is a unique field generated by SAP which will essentially guarantee a big unique alpha-numeric numer that can act as a primary key for the database tables.
As you can see from the basic ORDER table – CRMD_ORDERADM_H, there are two leads with the same Lead Number of #476, but what differentiates the table rows is the GUID. GUIDs are created using the FM – GUID_CREATE.
What intrigues the folks from the core SAP ECC system is that over there there is no concept of GUID, whereas in SAP CRM this becomes the primary key. This was necessitated by a number of problems – Mostly related to the fact that CRM is generally not a master data system and also the fact that CRM is essentially built to interact with mobile clients as well which are not necessarily connected to the server. Let’s consider the following scenarios.
1. A mobile order (say Txn Type – ZTA) was taken by a field rep on his laptop and the laptop generated an order # 1234. This number was generated without consulting the Server and might not reflect the current number range scenarios for the Txn type ZTA. Now what happens when the fields sales rep connects to the server at the end of his day and tries to sync the data ? If the Order # was the only primary key, obviously you are in trouble – especially since its the primary field. So SAP CRM came up with the concept of GUID which uniquely identifes the transaction in the system no matter what.
2. Also, it is not always the case that all transactions need to be created in SAP CRM. For example, regular sales orders can be created in SAP SD whereas Service Orders, leads and opportunities could be created in SAP CRM. Since data needs to be synchronized between the two systems – this could lead to potential issues. Although there are mitigatory mechanisms for situations like this ( Like creating leading systems, making number ranges external in receiving system etc ) SAP has to plan for its own contingencies and GUID is the key for it.