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

Function Module for getting Number ranges between two number

Former Member
0 Likes
1,891

Hi guys,

Is there any Function module which provide us the number range between two numbers?

For Ex:If i give 1 and 10 to FM it must give me 1

2

3

4.....upto 10.

is there any FM for doing this,but i'm not able to find exact Fm for same.

I can write small piece of code for getting number ranges, but if i get FM it could save little work.

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
1,218

[NUMBER_GET_NEXT Get the next unique number in a number range. Use tcode SNRO for maintaining number ranges |http://www.sapdevelopment.co.uk/fmodules/fmssap.htm]

5 REPLIES 5
Read only

former_member156446
Active Contributor
0 Likes
1,219

[NUMBER_GET_NEXT Get the next unique number in a number range. Use tcode SNRO for maintaining number ranges |http://www.sapdevelopment.co.uk/fmodules/fmssap.htm]

Read only

0 Likes
1,218

i don't want to create any object from SNRO.

simply i want to collect all numbers between two integers.

Read only

0 Likes
1,218

Hi

But why do u need a fm, can't you do it by yourself?

DATA: FROM_NUMBER TYPE I VALUE 1,
      TO_NUMBER   TYPE I VALUE 15.

DATA: NUMBER            TYPE I.

DATA: BEGIN OF T_NUMBER OCCURS 0,
              NR TYPE I,
          END    OF T_NUMBER.

NUMBER = FROM_NUMBER.

DO.
  IF NUMBER <= TO_NUMBER.
    T_NUMBER-NR = NUMBER.
    APPEND T_NUMBER.
  ELSE.
    EXIT.
  ENDIF.
  NUMBER = NUMBER + 1.
ENDDO.

LOOP AT T_NUMBER.
  WRITE: / T_NUMBER-NR.
ENDLOOP.

Max

Read only

0 Likes
1,218

Max,

Yes I can,but i was looking for FM if there any.

I think i must go with code only.

Read only

0 Likes
1,218

Okay Guys,

i Guess No FM available for doing same.

Will update the thread if found any.

Right now i created Z function modle with custom code and used in program.

Thank you.

Amit.