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,401

hi,

i hav created one selection screen option for standard DATE ...but in first input of select options i want to display the preceding calender date...how can i do this using sy-datum(current date).

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,358

Hi,

try this,

initialization.

s_date-low = sy-datum - 1.

12 REPLIES 12
Read only

Former Member
0 Likes
1,358

at initialisation event assign default value to your date selection parameter...

Read only

0 Likes
1,358

Hi Priya Patil,

Use INITIALIZATION Event to set Default Value for Select-options.

Example Code.

Select-Option: S_Bfdatet for Bkpf-Bldat.

INITIALIZATION.

DATA: Date1 like sy-datum.

date1 = sy-datum-30.

s_bldat_low = date1.

s_bldat_high = sy-datum.

append s_bldat.

Hope this will help u.

with regards,

nagaraju

Read only

Former Member
0 Likes
1,359

Hi,

try this,

initialization.

s_date-low = sy-datum - 1.

Read only

0 Likes
1,358

it is giving error?? that's y i raised the question

Read only

0 Likes
1,358

what error are you getting?

Read only

0 Likes
1,358

i have written like this

select-options:s_date for tbtco-sdlstrtdt obligatory default sy-datum-1 to sy-datum,

giving error

data object "SY" does not have component called datum-1...

some type casting required ...

i want that....

Read only

0 Likes
1,358

instead of

select-options:s_date for tbtco-sdlstrtdt obligatory default sy-datum-1 to sy-datum,

define selection option as

select-options:s_date for tbtco-sdlstrtdt obligatory,

in initialization event assign the default value...

INITIALIZATION.

s_date-low = sy-datum - 1.

append s_date.

Read only

0 Likes
1,358

> data object "SY" does not have component called datum-1...

Give a space between SY-DATUM and - and 1.

SY-DATUM - 1.

Read only

Former Member
0 Likes
1,358

Hi Priya Patil,

Use INITIALIZATION Event to set Default Value for Select-options.

Example Code.

Select-Option: S_Bldat for Bkpf-Bldat.

INITIALIZATION.

DATA: Date1 like sy-datum.

date1 = sy-datum-30.

s_bldat_low = date1.

s_bldat_high = sy-datum.

append s_bldat.

Hope this will help u.

with regards,

Sharmishta Dadapure.

Read only

Former Member
0 Likes
1,358

do it like this:

select-options:
  s_date for tbtco-sdlstrtdt obligatory.

Initialization.

s_date-low  = sy-datum - 1.
s_date-high = sy-datum.
append s_date.

you cannot do any calculation in your select options like

sy-datum - 1, if there is any calculation in the default value of your selection screen you have to use INITIALIZATION event.

the DEFAULT option is for fixed values.

With luck,

Pritam.

Read only

Former Member
0 Likes
1,358

Hi Priya,

calculations cannot be done in the select options.

instead use the Initialization event and do the manipulations using S_DATE-low and S_Date-high.

this would serve the purpose.

Regards.

Shruti

Read only

Former Member
0 Likes
1,358

hi

you have to write the

default values at the

initilization event

it is help ful for you

thanks

naresh