Application Development 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: 

Number range for the customized transaction

Former Member
0 Kudos

Hi Experts,

I am developing customized screen. When user saves after entering data a number should be generated automatically. Please tell how to maintain the number ranges for my transaction.

Regards,

B V Rao

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

Hi bala virupaksha,

create a number range object and interval through transaction SNRO.

Before you do your insert(at the time you are saving data into DB Table), you call function NUMBER_GET_NEXT for the nmuber range object and interval and use the number you get.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

5 REPLIES 5

former_member387317
Active Contributor
0 Kudos

Hi bala virupaksha,

create a number range object and interval through transaction SNRO.

Before you do your insert(at the time you are saving data into DB Table), you call function NUMBER_GET_NEXT for the nmuber range object and interval and use the number you get.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

0 Kudos

Hi Ilesh,

Could you please explain it clearly.

Regards,

Bala

0 Kudos

Hi,

Go to SNRO tcode and enter an object to be created and press create button.

Enter data element as S_CARR_ID and domain as POSNR

and 10% as warning and save.

create small program to update SCARR table with a carrid 01.

data : begin of itab occurs 0.

include structure scarr.

data end of itab.

itab-carrid = '01'.

append itab.

clear itab.

modify scarr from table itab.

and execute the program now your SCARR table will have 01 as carrid.

now maintain the number ranges for your newly created object in SNRO tcode

prees numer ranges button and enter 01 in Air line input field

in your program where you want these number ranges

declare a variable as follows

data number type nriv-nrlevel.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = 01 " Air line just you created

object = "the object name that you created in SNRO

  • QUANTITY = '1'

SUBOBJECT = '"naturally enter 01 ( which you assigned while creating N ranges)

  • TOYEAR = '0000'

  • IGNORE_BUFFER = ' '

IMPORTING

NUMBER = number

  • 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.

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

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

ENDIF.

Best Regards

Ramchander Rao.K

Edited by: ramchander krishnamraju on Dec 12, 2008 9:17 AM

former_member387317
Active Contributor
0 Kudos

Hi bala virupaksha,

Please have a look at below threads... U will get an idea on how to achieve it....

if you don't have authorization or donno how to create Number range object then ask to ur Functional & BASIS Consultant's help... or you can see already created number ranges in display mode and create new one accoring to ur requirement...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Former Member
0 Kudos

Thnaks