cancel
Showing results for 
Search instead for 
Did you mean: 

Unique ID Creation in MII

Former Member
0 Kudos

Hi,

I need to create an unique ID every time when the BLS will be executed because I wish to use this Unique ID within the BLS. Is there any way to create the unique ID (based on some custom specification like PO0002GI, PO0003GR etc) within MII.

Or is there any way to assign dynamic value to Transaction or Local variable.

Thanks in Advance

Chandan

Accepted Solutions (1)

Accepted Solutions (1)

agentry_src
Active Contributor
0 Kudos

Hi Chandan,

In the Link Editor, in the Expression Editor, there is a function called guid. I have not used it, but I think it will fulfill your needs. You may want to combine it with a datetimestamp.

Regards,

Mike

Edited by: Michael Appleby on Aug 31, 2010 8:17 PM

Edited by: Michael Appleby on Aug 31, 2010 8:18 PM

Former Member
0 Kudos

Hi Chandan,

in addition to Mike: on MII 12.0 the guid produces output like this:

affaf770-b59c-11df-b62c-e8310acd40aa

The guid function does not have any input parameters.

Michael

Former Member
0 Kudos

guid function in MII (12.1.8.32) works incorrectly

for example some guid generated in a cycle

  • [INFO] [Tracer_0]a1a54a50-bf62-11e1-a2af-ff92ac111fb0
  • [INFO] [Tracer_0]a1a54a51-bf62-11e1-91b8-ff92ac111fb0
  • [INFO] [Tracer_0]a1a54a52-bf62-11e1-a6e2-ff92ac111fb0
  • [INFO] [Tracer_0]a1a54a53-bf62-11e1-b91b-ff92ac111fb0
  • [INFO] [Tracer_0]a1a54a54-bf62-11e1-bfac-ff92ac111fb0

Java version 6 update 31

agentry_src
Active Contributor
0 Kudos

Hi Oleg,

Not sure I understand.  Those 5 GUIDs are all unique. 

Regards, Mike

Former Member
0 Kudos

Hi

Another possiblity:

if you have installed SAPMEINT or uploaded the the custom action sap.com~xapps~aciton~actions.mii~actions.jar, you will be able to use Get Unique ID.

  • [INFO] [Tracer_0]2069316785.20120626.134903.45283
  • [INFO] [Tracer_0]2069316785.20120626.134903.12422
  • [INFO] [Tracer_0]2069316785.20120626.134903.19058
  • [INFO] [Tracer_0]2069316785.20120626.134903.5848
  • [INFO] [Tracer_0]2069316785.20120626.134903.75950

I used it because it looks more numeric 🙂

regards

Former Member
0 Kudos

Hi, Michael!

Yes, they certainly unique but if to execute sample transaction again that will see that the right part at all guid always identical (ff92ac111fb0). And this considerable decrease quantity the unique ID...

Regards

agentry_src
Active Contributor
0 Kudos

I have also used the datetime as my GUID generator many times, but it is not necessarily unique.  I have never run into problems, so would probably do so again in the future even without SAPMEINT or the custom action jar.  But I usually use it as a file naming convention rather than something which might occur more frequently.

To each his own, I guess.

Regards, Mike

agentry_src
Active Contributor
0 Kudos

Hi Oleg,

I saw that, but it still does not affect the goal of a unique ID.  I suspect that the last part of the guid relates to your particular machine or MII instance and keeps the guid unique from other machine guids.  I tested it on 12.1 and 12.2 systems and they behave the same way.

Regards, Mike

Answers (2)

Answers (2)

former_member196557
Active Contributor
0 Kudos

Wikipedia has a good technical discussion (and references) of how the GUID is generated:

http://en.wikipedia.org/wiki/Globally_Unique_Identifier

The last block of data (6 Hex bytes) is keyed from the computer's network card MAC address as a base. But the GUID is about as unique as you can generate for a single instance.

Regards,

Steve

agentry_src
Active Contributor
0 Kudos

Hi Steve,

Thanks for the info.  I suspected as much (but didn't want to do the research).

Regards, Mike

sidnooradarsh
Contributor
0 Kudos

I am not sure what you trying but I assume you are trying to create some kind of Batch Numbers and may be even looking to send to SAP

I would try these options,

1) Generate unique id's from Javascript and then send to BLS

2) Use SQL to do that job and fetch in BLS

3) Lastly create a separate BLS which generates unique id using some logic and whenever u call, it should return the ID you needed.

If you trying something different please share more details to help you.

Hope this helps!!

Regards,

Adarsh