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: 

unique number generation

former_member611341
Participant
0 Kudos

Hello guys...

In my dialogue program when a user starts audit I need to generate an internal number from range that begins with 40000000( 8 digit) series or similar.( it should be a unique number and many users may access this screen at same time ,so each time a unique number should be generated)

How can i do this?is there any function module there or do i have write code for it?

and second one is .

In my dialogue programme when a user enter PUSH BUTTON..i need to execute 3 of my custom programs in back ground and a spool request should be created so that the user can see the output in spool.

how can execute these programmes in back ground and how to create spool requests ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

1. Create a serial number range object in SNRO transaction and every time you want a new number you can call the NUMBER_GET_NEXT function.

2. Calling the reports in the background, you can do it using SUBMIT REPORT and RETURN EXPORTING LIST TO MEMORY and then access the list using LIST_FROM_MEMORY function.

Regards,

Ravi

Note : Please mark all the helpful answers

9 REPLIES 9

Former Member
0 Kudos

create a number range using the transaction SNRO.

then use the function module number_get_next. this will solve ur problem.

andreas_mann3
Active Contributor
0 Kudos

hi,

use:

1)create an object with trx SNRO

2) in your dialog use fm number_get_next

II)

 submit Z123      with p_1 = ....
                        to sap-spool
                           list name titel
                           IMMEDIATELY space
                           keep in spool 'X'
                     and return.

A.

Message was edited by: Andreas Mann

0 Kudos

thanks for quick replies..

In z transaction user enters a PUSH BUTTON then this number should be generated.( there may be two Z transaction associated wiht this number range)

can u tell me how to do it SNRO?

also some sample code in my dialouge prog how to use the func module.

0 Kudos

just go to SNRO and its easy you can do it yourself, just enter the name of the object and then specify the range for the numbers.

Then when you click on the button, call the NUMBER_GET_NEXT function and pass the object name you have created you will get back the serial number, its very easy to try out.

Regards,

Ravi

Note : Please mark all the helpful answers

0 Kudos

thank you guys for all your answers ...I will try out .

If i have any problems i will be back..

I will award points once im done..

Thnak you.

Former Member
0 Kudos

1. Create a serial number range object in SNRO transaction and every time you want a new number you can call the NUMBER_GET_NEXT function.

2. Calling the reports in the background, you can do it using SUBMIT REPORT and RETURN EXPORTING LIST TO MEMORY and then access the list using LIST_FROM_MEMORY function.

Regards,

Ravi

Note : Please mark all the helpful answers

Former Member
0 Kudos

hi aday,

You can use following function module .

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01'

object = 'AUFTRAG'

IMPORTING

number = number.

Hope this will help you.

Regards.

Vikas.

0 Kudos

Hello guys..

can i use two number ranges in one object in SNRO

like

80000000 - 89999999

40000000 - 49999999

in my dialog prog i have to select any one of number range based on input in screen.

how can i do that?

how to use 'NUMBER_GET_NEXT' function module in that case..

0 Kudos

Yes you can have two ranges with in one object. You give them 01 and 02 number ranges, and then pass that to the function.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01' or '02'

object = 'ObjectName'

IMPORTING

number = number.

Regards,

Ravi

Note : Please mark all the helpful answres and close the thread once the issue is resolved.