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

former_member198441
Participant
0 Kudos

Hi all,

I want to read only those two records given in lower limit and upperlimit of select-options.

pls help me ....points will be rewarded..

ThankYou,

Prashanth.

14 REPLIES 14

Former Member
0 Kudos

Declare your select option with "NO-EXTENSION" clause. This will make sure that you will be able to enter only LOW and HIGH value in select option.

ashish

Former Member
0 Kudos

HI,

tables:mara.

select-options:mat for mara-matnr no-extension.

data:itab like mara occurs 0 with header line.

select * from mara into table itab where matnr = mat-low or matnr = mat-high.

loop at itab.

write:/ itab-matnr,itab-ernam,itab-ersda.

endloop.

rgds,

bharat.

Former Member
0 Kudos

hi,

write the query like this..

<b>consider SELOPT is ur select options for MATNR</b>

SELECT *

FROM MARA INTO TABLE ITAB

WHERE

<b> MATNR EQ SELOPT-LOW OR

MATNR EQ SELOPT-HIGH.</b>

With Rgds,

S.Barani

Former Member
0 Kudos

use NO-EXTENSION

Former Member
0 Kudos

hi prashanth,

use :

SELECT * FROM TABLENAME

INTO TABLE ITAB

WHERE FIELD EQ SEL_OPTLOW OR FIELD EQ SEL_OPTHIGH.

Hope this helps u.

regards,

sohi

0 Kudos

can i get the solution using/Creating the <b>"RANGES"</b>tables....

Message was edited by:

Prashanth Polsani

0 Kudos

The Low value and high Value itself gives u a range.

regards,

Vimal

former_member223537
Active Contributor
0 Kudos

Hi,

use IN operator in the select query.

Select * from MARA
      into table itab
      where matnr IN s_matnr.

This will include low & high values of S_MATNR.

Best regards,

Prashant

Former Member
0 Kudos

Hi Prashanth,

You can use either of these:

Eg :1

select-options:s_matnr for mara-matnr no-extension.

data:itab like mara occurs 0 with header line.

Select * from MARA

into table itab

where matnr IN s_matnr.

eg :2

select-options:s_matnr for mara-matnr no-extension.

data:itab like mara occurs 0 with header line.

select * from mara into table itab where matnr = mat-low or matnr = mat-high.

Reward if useful.

Regards,

Chitra Parameswaran

Former Member
0 Kudos

Hi Prasanth,

Use the below logic

data v_num type i.

select-options: s_num for v_num.

at selection-screen.

delete s_num where not option = 'BT'.

Former Member
0 Kudos

Hi Prashanth,

Suppose you have created the select option named s_matnr.

then you can write the query,

select single * from mara where matnr between s_matnr-low and s_matnr-high.

reward if useful,

regards,

Supriya

Former Member
0 Kudos

Hi

One more way of doing this if you dont want to use No Extension :

SELECT *

FROM MARA INTO TABLE ITAB

WHERE

MATNR IN s_matnr.

describe table itab lines lin .

After this

DELETE ITAB from 2 to (lin-1) .

Itab will always have 2 records with low and high value .

Praveen.

Message was edited by:

praveen parasiya

Former Member
0 Kudos

Hi,

You can use the ranges or select statement as below :

select-options : so_bukrs for bsis-bukrs. 

First Option

ranges : gr_bukrs for bsis-bukrs.

initialization.

gr_bukrs-option = 'BT'.
gr_bukrs-sign = 'I'.
gr_burks-low = so_bukrs-low.
gr_bukrs-high = so_bukrs-low.

append gr_bukrs.

gr_bukrs-option = 'BT'.
gr_bukrs-sign = 'I'.
gr_burks-low = so_bukrs-high.
gr_bukrs-high = so_bukrs-high.

append gr_bukrs.


start-of-selection.

select field1 field2 from <tablename> into table itab where bukrs in gr_bukrs.


or 

Second option.

select field1 field2 from <tablename> into table itab
                       where bukrs eq so_bukrs-low
                            or  bukrs eq so_bukrs-high.

Thanks,

Sriram Ponna.

Former Member
0 Kudos

Why don't you use select_option-low and select_option-high values for selection.