ABAP log

January 23, 2007

Random or globally unique number/string generation in ABAP.

Filed under: ABAP, SAP — abaplog @ 8:15 pm

I never had a need to work with random numbers, but this is being asked periodically on  SAP-related forums. Functions RANDOM_C and RANDOM_I4 will return a random number. If you need a unique string (for example, to use in a table key), use the function GUID_CREATE. I used this one when I wanted to have a unique key for a log table that is being filled by many instances of my ABAP program running in parallel and I did not want to use the SAP’s number ranges feature.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: