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

Adding default value for a select-options in a selection-screen

Former Member
0 Likes
5,310

hello gurus,

i have a report program with the following select-options in a selection-screen block:

select-options:  so_site  for MyTable-werks.

i want the so_site to have a default value once the program displays. can it be possible?

regards,

sid

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
2,367

put the following in initilization.


INITIALIZATION.
SO_SITE-SIGN = 'I'.
SO_SITE-OPTION = 'EQ'.
SO_SITE-LOW = 'XXXX'.
APPEND SO_SITE.

Regards,

Suresh Datti

12 REPLIES 12
Read only

suresh_datti
Active Contributor
2,368

put the following in initilization.


INITIALIZATION.
SO_SITE-SIGN = 'I'.
SO_SITE-OPTION = 'EQ'.
SO_SITE-LOW = 'XXXX'.
APPEND SO_SITE.

Regards,

Suresh Datti

Read only

Former Member
0 Likes
2,367

HI Sid,

tty this code.

initialiazation.

so_site-low = '1000'.

so_site-high = '1100'.

so_site-sign = 'I'. "I For include values E for exclude values

so_site-option = 'BT. " BT for between ,EQ for equal

append so_site.

Regards,

ravi

Read only

Former Member
0 Likes
2,367

hi,

code an initializaiton event.

INITIALIZATION

SO_SITE-LOW = ''.

SO_SITE-HIGH = ''.

APPEND SO_SITE

Read only

0 Likes
2,367

hi,

Add this Code

initialiazation.

<b>so_site-low = '500'.

so_site-high = '1800'.

so_site-sign = 'I'.

so_site-option = 'BT.

append so_site.</b>

Regards,

Santosh

Read only

Former Member
0 Likes
2,367

As it SELECT-OPTIONS you cannot have the DEFAULT clause with it. As Suresh suggested you will have to do it in INITLAIZATION only.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

Former Member
0 Likes
2,367

hello sid,

in the inittialization event , u can set the low and high values for ex,

initialisation.

s0_site-low = abc.

s0_site-high = xyz.

append so_site.

regards,

keerthi.

Message was edited by: keerthi kiran varanasi

Read only

Former Member
0 Likes
2,367

hi

initialization.

so_site-high = 'high'.

so_site-low = 'low'.

append so_site.

Read only

Former Member
0 Likes
2,367

Hi sid,

1. Whenever we use select-option,

an internal table of type range is

automatically created.

2. so, in fact, we have to put

record in this internal table.

3. eg. Just copy paste in new program.

4.

report abc.

*----


tables : t001.

*----


select-options : bukrs for t001-bukrs.

initialization.

bukrs-sign = 'I'.

bukrs-option = 'EQ'.

bukrs-low = '1000'.

append bukrs.

regards,

amit m.

Read only

rahulkavuri
Active Contributor
0 Likes
2,367
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,
                S_FKDAT FOR VBRK-FKDAT,
                S_MATNR FOR VBRP-MATNR.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.

PARAMETERS : LIST RADIOBUTTON GROUP G1,
             GRID  RADIOBUTTON GROUP G1 DEFAULT 'X'.


SELECTION-SCREEN END OF BLOCK B2.

************************************************************************
*****************            INITIALIZATION         ********************
************************************************************************

INITIALIZATION.

  STR_DATE = SY-DATUM - 200.
  S_FKDAT-LOW = STR_DATE.
  S_FKDAT-HIGH = SY-DATUM.
  S_FKDAT-SIGN = 'I'.
  APPEND S_FKDAT.
Read only

0 Likes
2,367

guys,

many thanks to you all...

regards,

sid

Read only

Former Member
0 Likes
2,367

Hi,

what about this.....

Check it. you can have Default option using select options.

REPORT  ZTEST_SELECTION             .

tables: vbak.
select-options: vbeln for vbak-vbeln <b>default '1' to '10000'</b>.

Regards

vijay

Read only

Former Member
0 Likes
2,367

Hi,

find the syntax

SELECT-OPTIONS sel FOR f.

1. ... DEFAULT g

2. ... DEFAULT g ... OPTION xx ... SIGN s

3. ... DEFAULT g TO h

4. ... DEFAULT g TO h ... OPTION op ... SIGN s

Regards,

Sunily