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

number generation

Former Member
0 Likes
599

hi,

i need sequence numbers for a field. there r two ways i can do this...

create an object in SNRO and use

CALL FUNCTION 'NUMBER_GET_NEXT'

or

creat a custom table where i maintain the current number and the next number.

which is a better approach ? does any have adv/disadv over the other ?

thks

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
571

The first is the best way to do it, why? Becasue that is how SAP does it. Most every genreated number in R/3 uses the number range object approach. It supports buffering, and locking automatically so you don't have to worry about this in your custom table. Use the number range object and the function.

Regards,

Rich Heilman

The first is the best way to do it, why? Becasue that is how SAP does it. Most every genreated number in R/3 uses the number range object approach. It supports buffering, and locking automatically so you don't have to worry about this in your custom table. Use the number range object and the function.

Regards,

Rich Heilman

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
573

The first is the best way to do it, why? Becasue that is how SAP does it. Most every genreated number in R/3 uses the number range object approach. It supports buffering, and locking automatically so you don't have to worry about this in your custom table. Use the number range object and the function.

Regards,

Rich Heilman

Read only

Sm1tje
Active Contributor
0 Likes
571

Just use the standard way SAP Provides using SNRO. Advantage is the fact that you don't have to create custom development objects and SAP provides all the standard functionality like number range buffering, different ranges to be maintained, standard FM like (NUMBER_GET_NEXT).

Read only

Former Member
0 Likes
571

create an object in SNRO and use

CALL FUNCTION 'NUMBER_GET_NEXT'

is used by standard programs.

so when ever you want to update new number you need to call the Function using the Object created in SNRO.

creat a custom table where i maintain the current number and the next number.

But for Normal Table appraoch is exactly the same as SNRO and NUMBER_GET_NEXT function behaves. so you are replicating the whole process.

instead you can reuse the Standard Functionality