10-07-2008 4:22 PM
Hi,
I have a select option which must have a default value. This default value is the current date -1 (yesterday...).
DATA ws_date TYPE p0001-begda.
SELECT-OPTIONS s_date FOR ws_date DEFAULT sy-datum - 1.
But sy-datum - 1doesn't exist.
The 'RP_CALC_DATE_IN_INTERVAL' function allows to calculate a date.
I do :
SELECT-OPTIONS s_date FOR ws_date.
INITIALIZATION.
w_current_date = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = w_current_date
days = '01'
months = '00'
signum = '-'
years = '00'
IMPORTING
calc_date = w_new_date.
s_date = w_new_date.
But the new date is not display as like a default value...
10-07-2008 4:25 PM
hi Xavier,
you have to code the following way:
INITIALIZATION.
DATA : lv_datum TYPE sy-datum.
lv_datum = sy-datum - 1.
s_date-low = 'I'.
s_date-option = 'EQ'.
s_date-low = lv_datum.
APPEND s_date.
hope this helps
ec
10-07-2008 4:25 PM
hi Xavier,
you have to code the following way:
INITIALIZATION.
DATA : lv_datum TYPE sy-datum.
lv_datum = sy-datum - 1.
s_date-low = 'I'.
s_date-option = 'EQ'.
s_date-low = lv_datum.
APPEND s_date.
hope this helps
ec
10-07-2008 4:26 PM
Hi,
You need to write the code like this.
data : ws_date type sy-datum.
Select-options : S_date for ws_date.
Initialization.
s_date-option = 'EQ'.
s_date-Sign = 'I'.
s_date-low = sy-datum - 1.
append s_date.
Hope this helps.
Regards,
Pramod