cancel
Showing results for 
Search instead for 
Did you mean: 

Std FM/Program generate Unique Numbers

Former Member
0 Kudos

Hi,

Do we have any stnd FM/Program which generates a unique number based on the combinations of the incoming data!

Appreciate your help and <removed_by_moderator>

Edited by: Julius Bussche on Jun 24, 2008 6:52 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

First creat NUMBER RANGE in SNRO tcode,

next use below code:

CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'

EXPORTING

object = w_object

EXCEPTIONS

foreign_lock = 1

object_not_found = 2

system_failure = 3

OTHERS = 4.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01'

object = w_object

IMPORTING

number = zcor_header-cornr

EXCEPTIONS

interval_not_found = 1

number_range_not_intern = 2

object_not_found = 3

quantity_is_0 = 4

quantity_is_not_1 = 5

interval_overflow = 6

buffer_overflow = 7

OTHERS = 8.

CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'

EXPORTING

object = w_object

EXCEPTIONS

object_not_found = 1

OTHERS = 2.

Former Member
0 Kudos

My requirement is, I have a falt file coming in with 5 fields. First field is blank and we have data for the next 4 fields. I have created a table with 5 fields and now need to upload the data from the file by assigning a unique number to the first field, based on each unique combination of the last 4 fields data.

Answers (2)

Answers (2)

former_member181962
Active Contributor
0 Kudos

Hi Venu,

YOu have to create a Number range Object for your Z table key field.

check this link:

http://www.saptechnical.com/Tutorials/ABAP/SNRO/SNRO.htm

Regards,

Ravi kanth talagana

Former Member
0 Kudos

If I create a Number Range Object for my Z Object, can I assing my own value to it instead of fetching it from Number Range interval during loading!

Like for ZABC, i have my interval as 0001-999

But in my loading i wanted to give it as 1200 which is away from the above interval, I mean i dont want to access any Number Range object for some cases.!

Former Member
0 Kudos

Any ideas on this plz!

former_member212653
Active Contributor
0 Kudos

Try FM: AL_LAZY_GET_UNIQUE_NO