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 pattern

Former Member
0 Likes
3,172

Hi Experts,

i'm new to abap.

on selection screen there is a select-option for field city of LFA1 table.

the user wants that all city starting with (A* or a) till (H or h*) should be displayed.

how should i go about it.

plz help.

10 REPLIES 10
Read only

Former Member
0 Likes
1,708
select-options : s_city for LFA1-CITY.

INITIALIZATION.

s_city-sign = 'I'.
s_city-option = 'CP'.
s_city-low = 'A*'.
s_city-high = 'H*'.
append s_city.
clear s_city.


s_city-sign = 'I'.
s_city-option = 'CP'.
s_city-low = 'a*.
s_city-high = 'h*.
append s_city.
clear s_city.

Message was edited by:

Chandrasekhar Jagarlamudi

Read only

SantoshKallem
Active Contributor
0 Likes
1,708

try this

Initialization.

s_city-sign = 'I'.

s_city-option = 'CP'.

s_city-low = 'A'.

s_city-high = 'HZ'.

append s_city.

clear s_city.

Read only

Former Member
0 Likes
1,708

hi,

you can initialize the value by giving the range in INITIALIZATION events.

like city-low = 'a'

city-high = ' h'. and city is your select-options name.

Read only

Former Member
0 Likes
1,708

Hi,

do like this

data : it_lfa1 type standard table of lfa1.

select-options : s_ort01 for lfa1-ort01.

select * from lfa1

into corresponding fields of

table it_lfa1

where ort01 in s_ort01.

you can enter A*

Regards

Shiva

Read only

Former Member
0 Likes
1,708

Hello Annie,

This link gives all the possible patterns:

http://help.sap.com/saphelp_46c/helpdata/en/34/8e72da6df74873e10000009b38f9b8/frameset.htm

In particular:

Example

TABLES SBOOK.

SELECT-OPTIONS FL_DATE FOR SBOOK-FLDATE.

INITIALIZATION.

MOVE: 'I' TO FL_DATE-SIGN,

'EQ' TO FL_DATE-OPTION,

<b>SY-DATUM TO FL_DATE-LOW.</b>

APPEND FL_DATE.

MOVE: 'BT' TO FL_DATE-OPTION,

<b>'19960101' TO FL_DATE-LOW,

'19960630' TO FL_DATE-HIGH.</b>

APPEND FL_DATE.

When the selection screen is displayed, FL_DATE already contains the selection by the single value SY-DATUM (current date) and the interval from January 1 to June 30, 1996.

Regards,

Beejal

**Reward if this helps

Read only

Former Member
0 Likes
1,708

Can't i do it without hardcoding the values.

As the requirement can be starting with (J* or j) upto (R or r*).

the requirement may change.

how should i go about it.

plz help.

Read only

0 Likes
1,708

Hi

try as shown above by me

regards

Shiva

Read only

0 Likes
1,708

Hi,

Try simply in the selection screen j* and rzzzz(maximum z as suggested).

In the coding as usual,

select * from db into table itab where field in s_field.

Here s_field is a select-option.

Message was edited by:

Jayanthi Jayaraman

Read only

0 Likes
1,708

Dear Try With Serch Help Option

you can get your requirment esely

1.use list box (combo box) and add most resanly option like (a-h, a-c, p-s ....)

2.use it to your serch help option

add rewards if helpful

Read only

SantoshKallem
Active Contributor
0 Likes
1,708

the user has to enter the values manually.

if he need A to H, then have to enter A to HZ (in selection screen)

J to R ---> J to RZ