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

SNRO Number Range creation

Hi,

I need to generate number range automatically starting from AR00000000 to AR99999999. I tried using SNRO, but char values are not accepted..Please help..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 21, 2012 at 08:32 AM

    Hello Sooraj,

    Try creating FM , which can give you the number .

    internally you can append the chars (AR etc,,).. which you want to keep as part of number.

    Thanks

    ~Raj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 21, 2012 at 08:38 AM

    Hi

    It's not possible with an alphanumeric range: it has to be numeric only.

    So just as Raj says, you can create a numeric range and then you can insert AR

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 21, 2012 at 09:19 AM

    Thanks Raju..I will try that...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 21, 2012 at 12:58 PM

    hi Sooraj,

    try to use the below FM to get the number range

    DATA: w_range TYPE inri-nrrangenr VALUE '01',

    w_serial_no TYPE nriv-nrlevel.

    DATA: return TYPE inri-returncode.

    CALL FUNCTION 'NUMBER_GET_NEXT'

    EXPORTING

    nr_range_nr = w_range

    object = 'SBUSPID'

    IMPORTING

    number = w_serial_no

    returncode = return.

    IF sy-subrc EQ 0.

    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    ** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    i hope this helps,

    thank you,

    kata.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2012 at 05:53 AM

    hi sooraj,

    are you sorted if you have any issues get me back.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 06, 2012 at 06:46 AM

    Hi Sooraj,

    Hope this will help you.

    First create number range in SNRO as:

    Then in SE38, write the following code:

    REPORT ZNRO .

    DATA : inv_id TYPE i ,
    inv1(6) TYPE c VALUE 'AR' ,
    inv2(10) TYPE c ,
    invid(20) TYPE c .

    CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
    nr_range_nr = '1'
    object = 'ZNRO'
    * QUANTITY = '1'
    * SUBOBJECT = ' '
    * TOYEAR = '0000'
    * IGNORE_BUFFER = ' '
    IMPORTING
    NUMBER = INV_ID
    * QUANTITY =
    * RETURNCODE =
    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
    .
    IF sy-subrc <> 0.
    * Implement suitable error handling here
    ENDIF.

    inv2 = inv_id.
    CONCATENATE inv1 inv2 INTO invid.
    CONDENSE invid NO-GAPS.
    WRITE : invid .

    Execute it.

    - Regards,

    Manish Shankar.


    1.JPG (17.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2012 at 07:27 AM

    Hi

    you cant create a number range with char in snro, creation of alphanumeric number range is not allowed. try creating with numeric values.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 07, 2013 at 07:58 AM

    Hello So0,

    You can do it like this

    No From number To number ext

    2 AR00000000 AR99999999 X

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 08, 2013 at 05:28 AM

    Manish solution should work for you. If not you need to use external as Junhwan suggested.

    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.