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: 

How to capture values in Range into internal table?

former_member321825
Active Participant
0 Kudos

Hello,

I have a order number as select-options in selection screen.

If a order number range is given as range say 3400001 to 3400004.

Is there any Fm so that range can be shown as list so that i can loop all order numbers to find corresponding entries in setleaf.

O/p should be :

3400001

3400002

3400003

3400004

Regards,

Rachel

1 ACCEPTED SOLUTION

former_member321825
Active Participant
0 Kudos

If I have a given order number(Zaufnr) between 340001 to 340015

when I loop at zaufnr i get the below

Loop at zaufnr .

1 I |BT |000003400001|000003400015 |

But what i require is values that falls between that range

000003400001

000003400002

000003400003

000003400004...

...

...

000003400015

3 REPLIES 3

kiran_k8
Active Contributor
0 Kudos

Rachel,

Range is also like an internal table.If you have declared the order number as S_VBELN in the selection screen then you can loop at s_vbeln or read s_vbeln ..........You can check the structure of this range in debugging and use the correponding values.

Kiran.

former_member321825
Active Participant
0 Kudos

If I have a given order number(Zaufnr) between 340001 to 340015

when I loop at zaufnr i get the below

Loop at zaufnr .

1 I |BT |000003400001|000003400015 |

But what i require is values that falls between that range

000003400001

000003400002

000003400003

000003400004...

...

...

000003400015

0 Kudos

Hello

Try anything like this:


do.
  clear itab.
  itab-aufnr = zaufnr-low.
  append itab.
  zaufnr-low = zaufnr-low + 1.
  if zaufnr-low > zaufnr-high.
    exit.
  endif.
enddo.

In table itab you will have all values from range.