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: 

SELECT-OPTIONS problem....

Former Member
0 Kudos

Hi frnds,

DATA : num1 TYPE numc05.

SELECT-OPTIONS : s_range FOR num1.

i want to get the all values what ever i give in selection screen. i mean... suppose if i give 100 to 105 then i have to get the values 100,101,102,103,104,105.

how to get it?

thanks & regards,

balu

1 ACCEPTED SOLUTION

former_member188829
Active Contributor
0 Kudos

Hi,

Try this.

DATA : num1 TYPE numc05.

DATA:BEGIN OF itab OCCURS 0,
     num TYPE numc05,
     END OF itab.

SELECT-OPTIONS : s_range FOR num1.

START-OF-SELECTION.

  DO.
    IF s_range-low LE s_range-high.
      MOVE s_range-low TO itab-num.
      APPEND itab.
    ELSE.
      EXIT.
    ENDIF.
    s_range-low = s_range-low + 1.
  ENDDO.

  LOOP AT itab.
    WRITE: itab-num.
  ENDLOOP.

5 REPLIES 5

Former Member
0 Kudos

HI,

You need to use LOOP statment

LOOP AT S_RANGE>

<Here you will get the values>

ENDLOOP.

Thanks

Sudheer

Former Member
0 Kudos

Hi,

just mention the range in low and high... It will take all the range between it..

former_member212005
Active Contributor
0 Kudos

You should be able to get it....enter in low and high and ensure that the values you are entering are appended with leading zero's as you have declared them as NUMC

former_member188829
Active Contributor
0 Kudos

Hi,

Try this.

DATA : num1 TYPE numc05.

DATA:BEGIN OF itab OCCURS 0,
     num TYPE numc05,
     END OF itab.

SELECT-OPTIONS : s_range FOR num1.

START-OF-SELECTION.

  DO.
    IF s_range-low LE s_range-high.
      MOVE s_range-low TO itab-num.
      APPEND itab.
    ELSE.
      EXIT.
    ENDIF.
    s_range-low = s_range-low + 1.
  ENDDO.

  LOOP AT itab.
    WRITE: itab-num.
  ENDLOOP.

Former Member
0 Kudos

Can you explain your requirement a bit more. Where do you want to get the numbers, in S_RANGE?

Regards,

Susanta