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: 

Selection

Former Member
0 Kudos

hi all

i have an selection statement like

PARAMETERS:GL LIKE SKB1-SAKNR.

Now i need to specify to ranges for this how can i do that like i need to mention in Low-High values at the same time i cannot use the SELECT-OPTIONS statement...please help

vijay

6 REPLIES 6

Former Member
0 Kudos

<b>Refer the following:</b>

RANGES rtab FOR dobj [OCCURS n].

<b>Effect</b>

Obsolete declaration of a Ranges-table. This statement (not allowed in classes) is a short form of the following statement sequence which is also not allowed in classes:

DATA: BEGIN OF rtab OCCURS {10|n},

sign TYPE c LENGTH 1,

option TYPE c LENGTH 2,

low LIKE dobj,

high LIKE dobj,

END OF rtab.

An internal table rtab with the structure of a selection table and a header line is declared. Without the addition OCCURS, the initial memory requirement (see DATA - ranges-tables) of the ranges-table is set to ten rows. With the addition OCCURS, you can specify a numeric literal or a numeric constant n to determine a different initial memory requirement.

<b>Note</b>

It is not allowed to declare internal tables with header lines. Due to this, the statement RANGES is not allowed in header lines. To declare a ranges-table in classes, you can use the addition TYPE|LIKE RANGE OF (see TYPES - ranges-table type and DATA - ranges-tables).

0 Kudos

You have to declare a table in the code like the above and have to feed the data of the table manually.

Former Member
0 Kudos
use ranges

PARAMETERS:GL LIKE SKB1-SAKNR.

ranges : r_GL for GL.

r_GL-sign = 'I'.
r_GL-option = 'BT'.
r_GL-low = GL.
r_GL-high = ''.
append r_GL.

Former Member
0 Kudos

Hi,

create one more parameters like that and use as shown below.

PARAMETERS:L_GL LIKE SKB1-SAKNR.

PARAMETERS:H_GL LIKE SKB1-SAKNR.

select * from SKB1 into <wa> where SAKNR >= L_GL and SAKNR <=H_GL.

endselect.

anyway the best solution for this is select-options.

Former Member
0 Kudos

Just go through ranges statements.

Former Member
0 Kudos

DATA: BEGIN OF NUMBERS,

ONE TYPE P VALUE 10,

TWO TYPE P VALUE 20,

THREE TYPE P VALUE 30,

FOUR TYPE P VALUE 40,

FIVE TYPE P VALUE 50,

END OF NUMBERS,

SUM TYPE I VALUE 1000,

INDEX TYPE I.

RANGES SELECTION FOR INDEX.

SELECTION-SIGN = 'I'.

SELECTION-OPTION = 'BT'.

SELECTION-LOW = 2.

SELECTION-HIGH = 4.

APPEND SELECTION.

ADD NUMBERS-ONE THEN NUMBERS-TWO

UNTIL NUMBERS-FIVE

ACCORDING TO SELECTION

GIVING SUM.

SUM now contains 90. Only the sub-fields TWO to FOUR were selected from the structure NUMBERS and added together.

try this mR. Vijay