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: 

generating series

Former Member
0 Kudos

Hi,

I am trying to generate series for text symbols.When the count gets more then 999 the code is going in dump.Can ne1 suggest m how the series increases with combn of alphabet and number with length 3.

eg:a01,a02.......b23....e99.....

Thanks.

2 REPLIES 2

Former Member
0 Kudos

check the type you have used to store that variable.

former_member196299
Active Contributor
0 Kudos

hi Abhishek,

I got your doubt . why d't you try like this .

Generate a Number range in SNRO with range till 999. next use this number range in a FM NUMBER_GET_NEXT . this FM is used to get the nest number like 01, 02, 03 ... and then after you get the number write the logic to concatenate the the alphabets you want . i think this will solve your problem .

one sample for generating the number range n getting the next number is given below :

While creating a number range using transaction SNRO, a number object is created. This is the object you mention in the EXPORTING field OBJECT. In the field NR_RANGE_NR, you mention the interval that you have created in the Number Range Object. I cannot put up screens here, but I can tell you the path.

SNRO>Put object name>Display>Goto(Menu Bar)>Number Ranges-->Intervals and in the table control the first field, No. is put in NR_RANGE_NR. This is the path in 4.7 SAP version. In 4.6C, I think Intervals comes as soon as you put object name in SNRO Transaction. There are many more fields in the function module, but I suspect that you want the basic functionality.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = '01'

OBJECT = 'YPOLLID'

IMPORTING

NUMBER = LS_NUMBER

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.

ENDIF.

for anyother clarifications write back ..

Reward if helpful !

Thanks

Ranjita

Message was edited by:

Ranjita Kar