Skip to Content
author's profile photo Former Member
Former Member

Number range generation

Hi All,

I want to use number range generation (tcode: SNRO) for generating numbers for my custom database primary key purpose.

Can anybody give me clear idea about number generation.

Please help its urgent. .........

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 09:04 AM

    FM NUMBER_GET_NEXT will be useful.

    cheers,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 09:03 AM

    Hi,

    Create a serial number range object in SNRO transaction(give 01 in starting number) and every time you want a new number you can call the <b>NUMBER_GET_NEXT</b> function.

    CALL FUNCTION 'NUMBER_GET_NEXT'

    EXPORTING

    nr_range_nr = '01' (or pass the Variable)

    object = 'ObjectName'

    IMPORTING

    number = number.

    http://www.erpgenie.com/sap/abap/code/abap33.htm

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 09:03 AM

    Hi,

    This can be done by creating a number range object for the domain/dataelement of the field from SNRO/SNUM transaction, and in the program you have to use FM NUMBER_GET_NEXT to get the next available number,

    Rgds,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 09:04 AM

    Hi,

    by using SNRO you will have 3 options coming to u.

    By the 1st option, u can create the new interval range from sya 0... 99999 etc..

    Using second option, u can change the existing number range, incase the existing one gets exhausted by usage.

    By the trhird option, you can delete the existing number range..

    It's upto u you can decicde any number range.. One more point to notice is that you can have External & Internal number rnage assignment.. E.g., in case of MM Module, generally, the PO, RFQS, etc.. are generated by it own (i.e., the no is assigned to it once you save the new PO, RFQ etc...) Or otherwise, incase u assign external number range, the new avaialable number will be taken from the interval and will be provided to the newly created document (E.g., MAterial, PO, RFQ , etc..)

    I hope i am clear.

    Please provide atmost points.

    thanks

    rams

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 09:05 AM

    Hi,

    use SNRO transaction to create number range

    object and use Fm number_get_next to get increment value

    Regards

    amole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 09:07 AM

    check this link for number range creation,getting next no etc.. ways

    http://www.sap-img.com/ge003.htm

    Regards,

    Srikanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 09:10 AM

    Hi Guru,

    U can use this FM-

    CALL FUNCTION 'NUMBER_GET_NEXT'

    EXPORTING

    nr_range_nr = '01'

    object = 'AUFTRAG'

    IMPORTING

    number = number.

    Thanks & Regards,

    Seema.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.