I want to generate a random `UUID`

like in `Java`

with `UUID.randomUUID()`

.

I came up with the function `GUID_GENERATE`

and used it like this

```
DO 5 TIMES.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = ev_guid_16
ev_guid_22 = ev_guid_22
ev_guid_32 = ev_guid_32.
WRITE: /, ev_guid_16, ev_guid_22, ev_guid_32.
ENDDO.
```

The result of this program is always the same `GUID`

. I need a new random one at every request.

I want to use it as a primary key in database table. This key will be transmitted via a Web Service to a Java application and user there as identifier, too.

Do you have any ideas how I can generate random `UUID/GUID`

in `ABAP`

?

Are you absolutely sure the created `GUID`

is always the same? Because this shouldn't be happening. Note that the difference between them can be just one character when you generate them inside a fast loop.

First of all you are using a function module that is obsolete. The comment at the beginning of the source code states that.

```
*"----------------------------------------------------------------------
* NOW this function has been replaced, see note 935047 "BINK215094
* 28.6.2006 The function module has been switched to the new UUID methods
* which exist in the class cl_system_uuid
* - due to compatibility reasons we catch the exceptions
* - sy-subrc not touched manually
* (sy-subrc was set in case of an error when calling the former
* 'RFCControl' kernel-call, but it wasn't evaluated and finally
* overwritten when leaving this function)
*"----------------------------------------------------------------------
```

Please use class `CL_SYSTEM_UUID`

and the following methods:

```
IF_SYSTEM_UUID_STATIC~CREATE_UUID_X16
IF_SYSTEM_UUID_STATIC~CREATE_UUID_C22
IF_SYSTEM_UUID_STATIC~CREATE_UUID_C26
IF_SYSTEM_UUID_STATIC~CREATE_UUID_C32
```

Similar Questions

I'm development a survey system where a teacher can login onto the system and then create his own survey. When he (the teacher) finishes the survey, I need to generate a public url for his survey, the

I have to create a test for homework using Selenium IDE and create a scenario to generate a random number. I'm struggling with what I need to type and what field to type in. What should I type in?: Co

In my android app I need to generate random numbers, My app will be running on many android devices in LAN and using random numbers to communicate with each other, I want to generate such a random an

I am trying to generate a random number based on accuracy of a player. If his accuracy is more, his cost should be more. For ex, if accuracy >= 0.9, cost = 0.7 else if accuracy >= 0.8, cost =

I want to generate automatic random numbers in a blank field while saving it in django. EDIT The random numbers must be unique.

Has anyone got examples and/or experience of generating SAP ABAP or SAPScript form code from XML that came from an external application? This would help: creation of SAP-based applications in a data-

i got a code to generate random number. public string Get8Digits() { var bytes = new byte[4]; var rng = RandomNumberGenerator.Create(); rng.GetBytes(bytes); uint random = BitConverter.ToUInt32(bytes,

I was wondering if it's possible to generate random tuples with a code like: take 4 $ randomRs ((0,0),(70,100)) $ mkStdGen x :: [(Double,Double)] when I try this one I get the error: No instance for

How to generate a matrix with more rows than columns, with a number of rows being a % of number of columns, like, 10 columns 500 rows, 20 columns 1000 rows etc...

Please take a look at this link: Random entry from dictionary That example is C#, however, my question is how to generate a random entry from the dictionary in php? Does php have an inbuilt function f

I want to generate random frequencies (i.e. frequencies have to equal to 1) to simulate gene frequencies in a population using R. My solution is: freq<- function(x,y) #random frequency generator, n

So I have the following method for generating random colours that I use in my application: public final Color generateRandomColour() { return Color.getHSBColor(new Random().nextFloat(), new Random().n

What parallel algorithms could I use to generate random permutations from a given set? Especially proposals or links to papers suitable for CUDA would be helpful. A sequential version of this would be

What is the best way to generate random numbers?

I need to generate a uniformly random point within a circle of radius R. I realize that by just picking a uniformly random angle in the interval [0 ... 2π), and uniformly random radius in the interval

When I try to use the Windows SetTimer function, it generate a IDEvent for the timer even if I have specified one! This: SetTimer(0,999,10000,@timerproc); In: procedure timerproc(hwnd: HWND; uMsg: U

I have searched a lot about this issue, but I got nothing. I used str_shuffle() to get a random string. It works fine on my laptop, But on my android device did not. It generate a random string, but w

How to generate a random Md5 hash value in C#?

I need to generate a 32 bit random int but depending of some arguments. The idea is generate a unique ID for each message to send through a own P2P network. To generate it, I would like as arguments:

I've got something here but i can't get it working how i like: def nested_loops(): import random option1 = random.randint(1,3) option2 = random.randint(1,3) option3 = random.randint(1,3) The bit abov

I have a set of N questions, each one categorized as one of R subjects. I'm trying to generate some random permutation of the questions for a quiz. How would I generate a random permutation of the set

I want to use this method to fetch a random entity of core data: randomQuote = [managedObjectContext objectWithID:randomID]; But I don't know how to set a random ID, which is an instance of NSManaged

I'm trying to port some Java code, which requires arithmetic and logical bit shifts, to ABAP. As far as I know, ABAP only supports the bitwise NOT, AND, OR and XOR operations. Does anyone know another

I am new in JAVA and I think I have searched all the questions without finding one similar to my question. I want to generate random numbers that would give back 4 fixed numbers using Math.random(). T

I was given task to generate random 80 byte keys and i have decided following strateges in my computer sizeof(char)=1 so i have created array of english alphabetical letters char *p= ; char a[0..26

I would like to generate a random IP adress.

Some random number generation, was wondering if I could use a loop to generate all these numbers, instead of writing all the integers out. Is there an even better way than that? could I just leave it,

I want to generate a matrix with fixed sparsity and random indexes and value. In order to simplify the problem, take array for example: generate a arr[10] with just 3 location with non-zero value. If

In PostgreSQL, how to generate random unique integer number for column, return which not exits in table column?

How to generate random chars ? Random numbers like this: : public static int random() { Random generator = new Random(); int x = generator.nextInt(10000); return x; } I need to draw something like:

This question already has an answer here: Generating random integers in a range with Java 31 answers I would like to know how to generate a random number between two given values. I am able to

always when I try to generate a random number with Int = arc4random % MAXNUM the length of the number is as long as the MAXNUM number length -1. So if I set arc4random % 1000000 the number is between

I want to generate two different random numbers which has 15 digits. How can I do that Thanks

How can I generate a random hex color with ruby?

I am trying to generate 36 length random number that doest have 0, 1 or 6 number in it. What I did is something like that declare @random char(36) set @random = newid() set @random = replace(replace(r

I'm trying to generate a random number that must have a fixed length of exactly 6 digits. I don't know if javascript Math.floor((Math.random()*1000000)+1); would ever create a number less than 6 dig

I'm trying to generate a random date of birth for People in my database. In a java program, can some one help me?

I am working on a project in which people have asked me to generate random String of 3000 bytes. Is it possible to do? I am confuse how we can generate random string of 3000 bytes? I know of something

i need your help and please give me some advice.from programming pearls i have studded that to generate random 30 bit integer we should write like this RAND_MAX*rand()+rand() but what could i do for

I want to generate an array with n random numbers (i.e. n calls to Math.random()). I don't care about whether they are unique or not. Currently I'm using a loop: let numbers = []; for (let i = 0; i &l

I need to generate 8 random integers, but they need to be unique, aka not repeated. For example, I want 8 numbers within the range 1 to 8. I've seen arc4random but I'm not sure how to make them unique

I would like to implement Abap Unit tests into my ABAP programs. My first report is a classic form ABAP--no OO classes, etc. Is this even possible? Is ABAP UNIT meant explicitly test OO classes? Or,

I want to generate random numbers within the range 1 to 4, 4 including. Here is my code: int num = r.nextInt(4) + 1; //r is instance of Random. However, I am running the above code in a loop and don'

Is there a way to generate a data set with normally distributed random values in R without using a loop? Each entry would represent an independent random variable with a normal distribution.

The usual method to generate a uniform random number 0..n using coin flips is to build a rng for the smallest power of two greater than n in the obvious way, then whenever this algorithm generates a n

Is it possible in Microsoft SQL Server generate random int value from Min to Max (3-9 example, 15-99 e.t.c) I know, i can generate from 0 to Max, but how to increase Min border? This query generate ra

I need to generate random numbers representing user activities using chi square distribution in (boost) tr1 c++. Any example or help on how would I start? I tried the following code: int main (){ std

I want make big test with hadoop, I will have big cluster (about 50 Tb), and I want generate data for tests. First of all I want test hive perfomance, and generate structured data (CSV). Could anybody

I would like to generate a random floating point number between 2 values. What is the best way to do this in C#?

Are there any built-in libraries in Python or Numpy to generate random numbers based on various common distributions, such as: Normal Poisson Exponential Bernoulli And various others? Are there any