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

Select-options...?

Former Member
0 Likes
9,696

Hello Gurus,

How to we use SIGN,OPTION,LOW,HIGH in select-options command and why do we use it ..and what does each of these options mean...

Cheers:Jim

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
7,479

hi,

What does SIGN "I" & "E" mean?

The 'I' value in the SIGN field denotes 'Include', that means to Include the values given in the LOW and HIGH fields.

U may use 'E' here to exclude these values, when u r using the range in a SELECT query.

What is OPTION?

Option can be a whole range, which includes:

EQ (Equal)

BT (Between)

CP (Contain Pattern)

Regards

Anversha

13 REPLIES 13
Read only

Former Member
0 Likes
7,479

Hi Jimmy,

Just do F1 on select options and you will find the details.

Regards,

Atish

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
7,479

Hi,

Selecti-options is used to create a range of data.

SIGN is used to mention either E for 'Exclusive' or 'I' for "Inclusive".

OPTION is used to mention any logical condition likeEQ", "NE", "GE", "GT", "LE", "LT", "CP" and "NP etc.

LOW is used as lower value of the range

HIGH is used as the Higer value of the range.

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

Read only

anversha_s
Active Contributor
0 Likes
7,480

hi,

What does SIGN "I" & "E" mean?

The 'I' value in the SIGN field denotes 'Include', that means to Include the values given in the LOW and HIGH fields.

U may use 'E' here to exclude these values, when u r using the range in a SELECT query.

What is OPTION?

Option can be a whole range, which includes:

EQ (Equal)

BT (Between)

CP (Contain Pattern)

Regards

Anversha

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
7,479

<b>Hi

For Ranges we use this Sign,option,low and high values explicitly.

Selection-options: s_matnr for mara-matnr.

will create the internal table by name s_matnr with header line with values Sign,option,low and high.

Which ever you entred in selection-screen will stores accordingly automatically.

But in some case you will create the Reanges.

Renages: s_matnr for mara-matnr.

Here will create the internal table by name s_matnr without header line .

So here we have to assign the values explicitly like

s_matnr-sign = 'I'.

s_matnr-option = 'Eq'

s_matnr -low = 'value'.

s_matnr-high -'value'.

append s_matnr.

Regards,

Sree</b>

Read only

Former Member
0 Likes
7,479

HI,

we will use like below.

select-options:i_matnr for mara-matnr.

initialization.

i_matnr-sign = 'I'.

i_matnr-option = 'BT'.

i_matnr-low = '10'.

i_matnr-high = '100'.

append i_matnr.

have a look at this link

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba74635c111d1829f0000e829fbfe/content.htm

rgds,

bharat.

Read only

Former Member
0 Likes
7,479

hi,

The row type of a selection table is a structure that consists of four components: SIGN, OPTION, LOW, and HIGH. Each row of a selection table that contains values represents a sub-condition for the complete selection criterion. Description of the individual components:

SIGN

The data type of SIGN is C with length 1. The contents of SIGN determine for each row whether the result of the row condition is to be included in or excluded from the resulting set of all rows. Possible values are I and E.

– I stands for "inclusive" (inclusion criterion - operators are not inverted)

– E stands for "exclusive" (exclusion criterion - operators are inverted)

OPTION

The data type of OPTION is C with length 2. OPTION contains the selection operator. The following operators are available:

– If HIGH is empty, you can use EQ, NE, GT, LE, LT,CP, and NP. These operators are the same as those that are used for logical expressions. Yet operators CP and NP do not have the full functional scope they have in normal logical expressions. They are only allowed if wildcards ( '*' or '+' ) are used in the input fields. If wildcards are entered on the selection screen, the system automatically uses the operator CP. The escape character is defined as #.

– If HIGH is filled, you can use BT (BeTween) and NB (Not Between). These operators correspond to BETWEEN and NOT BETWEEN that you use when you check if a field belongs to a range. You cannot use wildcard characters.

LOW

The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked.

– If HIGH is empty, the contents of LOW define a single field comparison. In combination with the operator in OPTION, it specifies a condition for the database selection.

– If HIGH is filled, the contents of LOW and HIGH specify the upper and lower limits for a range. In combination with the operator in OPTION, the range specifies a condition for the database selection.

HIGH

The data type of HIGH is the same as the column type of the database table, to which the selection criterion is linked. The contents of HIGH specify the upper limit for a range selection.

If the selection table contains more than one row, the system applies the following rules when creating the complete selection criterion:

Form the union of sets defined on the rows that have SIGN field equal to I (inclusion).

Subtract the union of sets defined on the rows that have SIGN field equal to E (exclusion).

If the selection table consists only of rows in which the SIGN field equals E, the system selects all data outside the set specified in the rows.

s_bukrs-sign = 'E'.

s_bukrs-option = 'EQ'.

s_bukrs-low = '0010'.

append s_Bukrs.

I means Include the values you have entered.

E Exclude the values you have entered.

Eg. You have entered 5 to 10 in the select option.

then usign I the values considered are 5,6,7,8,9,10.

Using E the values considered are 6,7,8,9

Read only

former_member196299
Active Contributor
0 Likes
7,479

hi Jimmy ,

SIGN means the inclde or exclude option of the values range .

OPTION is used to mention the logical parameters like =, => etc .

HIGH , here you should metion the higher value of your range ,

LOW , here you should metion the lower value of your range .

For further information , click on F1 on select-option syntax .

Regards,

Ranjita

Read only

former_member186741
Active Contributor
0 Likes
7,479

Here's some useful help:

Logical Expressions - Comparison with a Selection Criterion

f [NOT] IN sel checks whether the current contents of the field f are in the set described by the selection criterion sel (internal table). The table sel must have a fixed predefined structure.

... BEGIN OF sel,

SIGN(1),

OPTION(2),

LOW LIKE f,

HIGH LIKE f,

END OF sel.

The declarations

RANGES sel FOR f.

SELECT-OPTIONS sel FOR f.

TYPES sel TYPE or LIKE RANGE OF f

DATA sel TYPE or LIKE RANGE OF f

automatically generate an internal table sel with this structure.

The components of sel have the following meaning:

SIGN contains 'I' for "Inclusive" or 'E' for "Exclusive".

OPTION contains one of the following operators:

EQ (Equal to)

BT (Between ... and ...)

CP (Contains pattern)

LE (Less than or equal to)

GE (Greater than or equal to)

NE (Not equal to)

NB (Not between ... and ...)

NP (Does not contain pattern)

GT (Greater than)

LT (Less than)

LOW contains the comparison value; with BT, this is the lower limit of the range.

With BT and NB, HIGH contains the higher limit of the range.

Note

Each line of the table sel describes a set.

The set defined by the entire table sel is the union of "inclusive sets" (lines with SIGN = 'I') minus the union of "exclusive sets" (lines with SIGN = 'E').

If no lines exist with SIGN = 'I', the union of "inclusive sets" is set to its maximum size.

If no lines exist with SIGN = 'E', the union of "exclusive sets" is empty.

If sel is empty, sel defines the whole set, i.e. the condition f IN sel is always satisfied.

Example

Contents of table sel:

SIGN | OPTION | LOW | HIGH

-


I | BT | 1 | 6

E | BT | 4 | 7

I | EQ | 7 |

I | EQ | 9 |

E | EQ | 1 |

The set described by sel contains the numbers 2, 3 and 9.

Note

The logical expression is satisfied whenever the table sel is empty.

Short form:

Instead of "f IN sel", you can use the short form "sel" if f is the reference field (... FOR f) for the selection criterion (SELECT-OPTION) sel.

Example

DATA SFLIGHT_WA TYPE SFLIGHT.

SELECT-OPTIONS S_FLDATE FOR SFLIGHT_WA-FLDATE.

...

IF S_FLDATE. ... ENDIF.

is equivalent to

IF SFLIGHT_WA-FLDATE IN S_FLDATE. ... ENDIF.

Note

With the options CP and NP, the LOW and HIGH fields must be of type C, and LOW must contain at least one wildcard character. In this context, + represents a single character, while * represents any character string, even if it is blank.

CP and NP are the only options where + and * act like this. Therefore, the line

I BT A* D*

in no way defines a set of records starting with all those which begin with " A" and ending with all those which begin with "D", but rather the set of all records which are greater than or equal to the single values " A" and less than or equal to "D". This set is smaller since, if the character "Z" in the character set is greater than " *" and the value "DZ" starts with "D", it is not part of the defined set.

Read only

Former Member
0 Likes
7,479
Select Options is basically a internal table.
Low and High: The specify the range for a particular field in the output (eg Kunnr between 1000 and 2000)
Sign: the possible options you have is either I or E . I stands for include and the output is all the values between high and low values. E stands for Exclude. The output is all the values except the the values between high and low.
Option: two entries are possible either BT (between) or NB (not between)
Read only

Former Member
0 Likes
7,479

SELECT-OPTIONS system implicitly creates the select options internal table

which contains the fields of SIGN,OPTION,LOW & HIGH.

Eg. to SELECT-OPTIONS : 
----------------------------------------- 

REPORT YARSELECT. 
TABLES YTXLFA1. 
SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR. 
INITIALIZATION. 
VENDOR-LOW    =   1000.               " It specifies the range starting value. 
VENDOR-HIGH    =   2000.               " It specifies the range ending value. 
VENDOR-OPTION  =  'BT'.                " specifies ranges value is in between. 
VENDOR-SIGN      = 'I'.                     "specifies both inclussive. 

APPEND VENDOR. 


- - - - 
- - - - 
SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB  
WHERE LIFNR IN VENDOR

Some tips: 
Sign is always I (for Include) or E (for Exclude) 
Option can be a whole range, which includes: 
EQ        (Equal)  
BT        (Between))  
CP        (Contain Pattern) 

reward points if it is usefull ......

girish

Read only

0 Likes
7,479

Hello Jimmy,

A simple Example: If Select Option SO has Sign = 'I', Option = 'EQ', Low = '1' and High = '10'

If we have a variable V = 5 and we write

IF V IN SO[].

This means, we check if 5 is EQUAL(EQ) to any value INCLUDED(I) in range LOW(1) to HIGH(10).

Hope this helps.

Johnson

Message was edited by:

Johnson Ittyerah

Read only

Former Member
0 Likes
7,479

Hi,

A select-option is an internal table.

In the internal table sign, option,low and high are the fields.

You use SIGN to indicate whether to include or exclude the values in the given range.

In OPTION you can give whether to consider the values greater than(GT),LE, equal to (denoted as EQ),greater than and equal to(denoted bt GE) etc.

Low and high are used to select the range of values ie you when you wish to have all values from 1- 100, you give 1 in LOW and 100 in HIGH.

So for example if you want to consider all the values from 1- 100, then you can fill the select option as

sign = I.

option = EQ.

LOW = 1

HIGH = 100.

The select option in the screen is automatically filled with these values when you enter the data at the selection screen.

You will be manually filling these values only when you declare a range table.

Hope this helps you.

Reward if helpfull.

Read only

Former Member
0 Likes
7,479

hi,

Selecti-options is used to give a list of input data at a time.

SIGN is used to mention either E for 'Exclusive' or 'I' for "Inclusive".

e-> both low and high values are excluded in the list

i-> both low and high values are included in the list

OPTION is used to mention any logical condition [oerator for selection]

likeEQ", "NE", "GE", "GT", "LE", "LT", "CP" and "NP etc.

LOW is used as lower value of the range [lower limit]

HIGH is used as the Higer value of the range. [upper limit ]

if help ful reward soem points.

Regards,

Suresh.