Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function to generate a random ID

Former Member
0 Likes
1,012

Hello all,

Do we have any inbuilt function in SAP to generate a random alphanumeric ID?

The requirement is such that there is an import parameter "Sales Rep ID" which is optional. So if the user is not providing the ID, then we have to randomly generate it ourselves. Hence I am looking for a FM which does that job.

Regards,

Abhishek

3 REPLIES 3
Read only

Former Member
0 Likes
740

look at the function modules in F052, rthere yiou can generate random value for any data type.

RANDOM_AMOUNT

RANDOM_C

RANDOM_C_BY_SET

RANDOM_F8

RANDOM_I2

RANDOM_I4

RANDOM_INITIALIZE

RANDOM_P

RANDOM_TABLE_ENTRY

Read only

0 Likes
740

Thanks a Lot!!1

I will check out these FM's. Right now only issue will be to match the global data types (in case of enterprise service) to the data types of FM's

Read only

0 Likes
740

You can as well use FM : GUID_CREATE.

Hope this helps .