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
1,118

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
Read only

Former Member
0 Likes
1,082

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

Read only

Former Member
0 Likes
1,082

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.

Read only

Former Member
0 Likes
1,082

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

Read only

Former Member
0 Likes
1,082

use NO-EXTENSION

Read only

Former Member
0 Likes
1,082

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

Read only

0 Likes
1,082

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

Message was edited by:

Prashanth Polsani

Read only

0 Likes
1,082

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

regards,

Vimal

Read only

Former Member
0 Likes
1,082

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

Read only

Former Member
0 Likes
1,082

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

Read only

Former Member
0 Likes
1,082

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'.

Read only

Former Member
0 Likes
1,082

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

Read only

Former Member
0 Likes
1,082

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

Read only

Former Member
0 Likes
1,082

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.

Read only

Former Member
0 Likes
1,082

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