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

Incremental number

Former Member
0 Likes
1,595

Hi,

I want to know if there is a FM or craft to manage incremental numbers like 'VBLNR' or 'BELNR' in program

Thanks

F000000001

F000000002

F000000003

.

.

.

.

.

F000000010

10 REPLIES 10
Read only

former_member188827
Active Contributor
0 Likes
1,369

ur requirement is not clear..wat do u mean by managing incremental numbers?

Read only

0 Likes
1,369

I select the max of 'VBLNR' in table 'REGUH' for insering the next number of 'VBLNR':

For example the max is 'F000000009' i should add

'F000000010'

Read only

0 Likes
1,369

declare a constant

co_con(7) type c value 'F000000'.

wf_temp(10) type c.

wf_c type c.

wf_int type i .

wf_int = wf_int+1.

wf_c = wf_int.

concatenate co_con wf_c into wf_temp.

wf_ebeln = wf_temp.

then wf_ebeln will contain the incremented value.

Reward points if its useful....

Read only

0 Likes
1,369

what will be the next number for F999999999?

If it is going to be G000000001, then what will be the next number for Z999999999

Read only

0 Likes
1,369

the only way out is to catch the last two digits of the numuber....and increment the same..

Read only

Former Member
0 Likes
1,369

It is not possible to increment an alpha numbering number directly.

We have to split the character and the numeric part seperately and concatenate them again

Hope this helps,

Janani

Read only

Former Member
0 Likes
1,369

hiiii

there is a FM NUMBER_GET_NEXT..it will give you next integer numbers..

go through folowing link too

reward if useful

thx

twinkal

Read only

Former Member
0 Likes
1,369

Hi

Check this link

http://www.saptechnical.com/Tutorials/ABAP/SNRO/SNRO.htm

if want prefix with , u concatnate F with no coming from NUMBER_GET_NEXT.

thanks

sitaram

Read only

Former Member
0 Likes
1,369

Steps to create Incremental Numbers

1)Create a number range through transaction SNRO like Z_DISPO

2)Define Number Ranges through SNUM as you like

3)Call the FM "NUMBER_GET_NEXT" to get the next free number.


      call function 'NUMBER_GET_NEXT'
        exporting
          nr_range_nr                   = '01'
          object                        = 'Z_DISPO'
        importing
          number                        = v_disposition_no
*       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 .

Read only

Former Member
0 Likes
1,369

This message was moderated.