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: 

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

Former Member
0 Kudos

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

suresh_datti
Active Contributor
0 Kudos

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

suresh_datti
Active Contributor
0 Kudos

put the following in initilization.


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

Regards,

Suresh Datti

former_member181962
Active Contributor
0 Kudos

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

Former Member
0 Kudos

hi,

code an initializaiton event.

INITIALIZATION

SO_SITE-LOW = ''.

SO_SITE-HIGH = ''.

APPEND SO_SITE

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

hi

initialization.

so_site-high = 'high'.

so_site-low = 'low'.

append so_site.

Former Member
0 Kudos

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.

rahulkavuri
Active Contributor
0 Kudos
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.

0 Kudos

guys,

many thanks to you all...

regards,

sid

former_member188685
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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