<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Generate GUID, range? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098416#M1972531</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;We are migrating a custom solution to one system to a new s4 system. (lot of programs and tables...)&lt;/P&gt;
  &lt;P&gt;They want to keep the old data of our custom tables in the new system, theese tables have a GUID as key field. &lt;BR /&gt;We generate this GUID in our programs with FM CMS_API_GENERAL_GUID_CREATE (inside this FM the class cl_system_uuid is used)&lt;/P&gt;
  &lt;P&gt;My question is; what happens when we copy all the data from the old system to the new one, with thousands of GUID generated and we try to create a new one? Could be a conflict? Could a GUID be generated with the same value as an old one?&lt;/P&gt;
  &lt;P&gt;Is there any range we can initialize to start the generation of the GUID from the last one created in the old system? &lt;/P&gt;
  &lt;P&gt;Class cl_system_uuid use some KERNEL MODULEs, don't know exactly how it works. &lt;/P&gt;
  &lt;P&gt;Any advice? &lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 13:06:02 GMT</pubDate>
    <dc:creator>RicardoRomero_1</dc:creator>
    <dc:date>2019-11-21T13:06:02Z</dc:date>
    <item>
      <title>Generate GUID, range?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098416#M1972531</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;We are migrating a custom solution to one system to a new s4 system. (lot of programs and tables...)&lt;/P&gt;
  &lt;P&gt;They want to keep the old data of our custom tables in the new system, theese tables have a GUID as key field. &lt;BR /&gt;We generate this GUID in our programs with FM CMS_API_GENERAL_GUID_CREATE (inside this FM the class cl_system_uuid is used)&lt;/P&gt;
  &lt;P&gt;My question is; what happens when we copy all the data from the old system to the new one, with thousands of GUID generated and we try to create a new one? Could be a conflict? Could a GUID be generated with the same value as an old one?&lt;/P&gt;
  &lt;P&gt;Is there any range we can initialize to start the generation of the GUID from the last one created in the old system? &lt;/P&gt;
  &lt;P&gt;Class cl_system_uuid use some KERNEL MODULEs, don't know exactly how it works. &lt;/P&gt;
  &lt;P&gt;Any advice? &lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 13:06:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098416#M1972531</guid>
      <dc:creator>RicardoRomero_1</dc:creator>
      <dc:date>2019-11-21T13:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Generate GUID, range?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098417#M1972532</link>
      <description>&lt;P&gt;May be you can directly use the class - CL_SYSTEM_UUID and methods - CONVERT_UUID* to generate your unique ID using the input key (You can pass time time stamp).&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 14:45:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098417#M1972532</guid>
      <dc:creator>srikanthnalluri</dc:creator>
      <dc:date>2019-11-21T14:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Generate GUID, range?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098418#M1972533</link>
      <description>&lt;P&gt;Hi Ricardo, &lt;/P&gt;&lt;P&gt;if you would face duplicate ids, then the developer of the CL_SYSTEM_UUID had done a bad job. Per definition a &lt;A href="https://en.wikipedia.org/wiki/Universally_unique_identifier"&gt;UUID (Universally unique identifier)&lt;/A&gt; has to be real unique. Since UUID generators usually not only use the time as a component, but also the MAC address (besides some other calculations) and I guess you switched the hardware for your new system, you should never, ever see a conflict with your old ids.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 14:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098418#M1972533</guid>
      <dc:creator>r_herrmann</dc:creator>
      <dc:date>2019-11-21T14:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Generate GUID, range?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098419#M1972534</link>
      <description>&lt;P&gt;Thank you, thats all I need to know !&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 15:08:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098419#M1972534</guid>
      <dc:creator>RicardoRomero_1</dc:creator>
      <dc:date>2019-11-21T15:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Generate GUID, range?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098420#M1972535</link>
      <description>&lt;P&gt; @&lt;A href="https://answers.sap.com/users/1432/ricardoromeromata.html"&gt;Ricardo Romero Mata&lt;/A&gt; As the name suggests, Universal Unique Identifier, it has to be obviously unique when generated by the KERNEL methods.&lt;/P&gt;&lt;P&gt;One interesting which I noticed is, function module 'GUID_CREATE' is marked as Obsolete by SAP, I would advise better use CL_SYSTEM_UUID and it methods and catch exceptions like an example below ( as per Class documentation ).&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1748527-tmg.png" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: l_uuid_x16 TYPE sysuuid_x16.
DATA: system_uuid TYPE REF TO if_system_uuid.
DATA: oref        TYPE REF TO cx_uuid_error.


system_uuid = cl_uuid_factory=&amp;gt;create_system_uuid( ).


TRY.
    l_uuid_x16 = system_uuid-&amp;gt;create_uuid_x16( ). " create uuid_x16


  CATCH cx_uuid_error INTO oref.                  " catch error
    DATA: s1 TYPE string.
    s1 = oref-&amp;gt;get_text( ).
ENDTRY.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Nov 2019 15:18:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098420#M1972535</guid>
      <dc:creator>ThangaPrakash</dc:creator>
      <dc:date>2019-11-21T15:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Generate GUID, range?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098421#M1972536</link>
      <description>&lt;P&gt;Thanks, we'll consider to change the FM. There are a lot of programs in our old solution that use this FM.... Anyway, inside this obsolete FM the class cl_system_uuid is being used in our system. (not in others systems as i can see... )&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 08:46:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generate-guid-range/m-p/12098421#M1972536</guid>
      <dc:creator>RicardoRomero_1</dc:creator>
      <dc:date>2019-11-22T08:46:05Z</dc:date>
    </item>
  </channel>
</rss>

