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-option default value???

Former Member
0 Likes
909
DATA: gsber1         like csks-gsber.
select distinct GSBER
  into (gsber1)
  from csks
 where kostl = sch_kostl.
endselect.
  SELECT-OPTIONS : gsber    FOR csks-gsber DEFAULT gsber1.

why not input value gsber1?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
547

Pung,

DATA: gsber1 like csks-gsber.

One way is :

INITIALIZATION.

select distinct GSBER

into (gsber1)

from csks

where kostl = sch_kostl.

endselect.

gsber = gsber 1.

SELECT-OPTIONS : gsber FOR csks-gsber.

Other way is.....

select distinct GSBER

into (gsber1)

from csks

where kostl = sch_kostl.

endselect.

SELECT-OPTIONS : gsber FOR csks-gsber.

AT SELECTION-SCREEN OUTPUT.

gsber = gsber 1.

Now it will work.But in selection statemnet if you get the value of gsber1 is null selection screen input will be empty.

Don't forget ot reward if useful

3 REPLIES 3
Read only

Former Member
0 Likes
547

select-option specifies a range of values.. u can initilize default values in initialization event like

gsber-low = '1'.

gsber-high = '100'.

append gsber.

or u can give default values in selection-screen page by clicking extension(arrow mark button) green button indicates a range of values n red button indicated not to display those range of values..

hope u cleared ur doubt

Read only

Former Member
0 Likes
548

Pung,

DATA: gsber1 like csks-gsber.

One way is :

INITIALIZATION.

select distinct GSBER

into (gsber1)

from csks

where kostl = sch_kostl.

endselect.

gsber = gsber 1.

SELECT-OPTIONS : gsber FOR csks-gsber.

Other way is.....

select distinct GSBER

into (gsber1)

from csks

where kostl = sch_kostl.

endselect.

SELECT-OPTIONS : gsber FOR csks-gsber.

AT SELECTION-SCREEN OUTPUT.

gsber = gsber 1.

Now it will work.But in selection statemnet if you get the value of gsber1 is null selection screen input will be empty.

Don't forget ot reward if useful

Read only

Former Member
0 Likes
547

Pung,

Pls. see the docs. below.

To assign default values to a selection criterion, you use the following syntax:

SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] ....

Default values <g> and <h> can be literals or field names. You can only use fields that contain a value when the program is started. These fields include several predefined data objects.

For each SELECT-OPTIONS statement, you can specify only one DEFAULT addition. This means that you can fill only the first row of selection table <seltab> with default values. To fill more rows with default values, the selection table must be processed before the selection screen is called, for example, during the AT SELECTION-SCREEN -OUTPUT event.

You use the DEFAULT addition as follows to address the individual components of the first row:

To fill only the LOW field (single field comparison), use:

........DEFAULT <g>.

To fill the LOW and HIGH fields (range selection), use:

........DEFAULT <g> TO <h>.

To fill the OPTION field, use:

........DEFAULT <g> [to <h>] OPTION <op>.

For single field comparisons, <op> can be EQ, NE, GE, GT, LE, LT, CP, or NP. The default value is EQ. For range selections, <op> can be BT or NB. The default value is BT.

To fill the SIGN field, use:

........DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>.

The value of <s> can be I or E. The default value is I.

The input fields of the selection criterion are filled with the default values. The user can accept or change these values.

REPORT DEMO.

DATA WA_SPFLI TYPE SPFLI.

SELECT-OPTIONS AIRLINE FOR WA_SPFLI-CARRID

DEFAULT 'AA'

TO 'LH'

OPTION NB

SIGN I.

Don't forget ot reward if useful...