‎2006 Jun 27 11:34 AM
hi friends,
i wanted to enter the default date in my selection screen.
my default date is 30 days before the today's date.
i.e. if today is 31 dec then it will display in selection screen
date 1/12/06 to 31/12/06.
will anybody send the coding??
‎2006 Jun 27 11:35 AM
select-options : s_date type d.
initialization.
s_date-low = sy-datum.
subtract 30 from s_date-low.
s_date-high = sydatum.
‎2006 Jun 27 11:42 AM
Hi,
Just curious. If today is 27 June, then what do you want on the screen ? <b>1 june - 27 june</b> or <b>27 may - 27 june</b>
The above code will give you 30 day's difference. but if you want the dates to be populated from the first of the month to the current date, then do as follows -
select-options : s_date type d.
initialization.
s_date-low = sy-datum.
s_date+6(2) = '01'.
s_date-high = sydatum.Regards,
Anand Mandalika.
‎2006 Jun 27 11:35 AM
select-options: p_date for sy-datum.
In initialization
do this:
p_date-low = sy-datum - 30.
p_date-high = sy-datum.
p_date-sign = 'I.
p_date-option = 'BT'.
append p_date.
clear p_date.
Regards,
ravi
‎2006 Jun 27 11:37 AM
Hi Salil,
As the initialization event is called before the selection screen you can set your date in this event.
Use the code.
INITIALIZATION.
data : l_date type sy-datum.
l_data = sy-datum - 30.
write l_date.
‎2006 Jun 27 11:37 AM
you can use these two Fm's to calculate date
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = IT_HEADER-INVOICE_DATE
DAYS = '00'
MONTHS = '01'
SIGNUM = '-'
YEARS = '00'
IMPORTING
CALC_DATE = BILLING_PERIOD-LOW
or
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = IT_HEADER-INVOICE_DATE
DAYS = '00'
MONTHS = '01'
SIGNUM = '-'
YEARS = '00'
IMPORTING
CALC_DATE = BILLING_PERIOD-LOW
reward if you find this helpful.
‎2006 Jun 27 11:38 AM
‎2006 Jun 27 11:40 AM
Hi,
I'm assuming that date field is a parameter field (p_date).
INITIALIZATION.
p_date = sy-datum - 30.
Regs,
Venkat Ramanan
‎2006 Jun 27 11:42 AM
Hi salil,
1. we have to use APPEND for select options.
2. just copy paste
3.
report abc.
*----
select-options : mydate for sy-datum.
INITIALIZATION.
MYDATE-LOW = SY-DATUM - 30.
MYDATE-HIGH = SY-DATUM.
append mydate.
regards,
amit m.
‎2006 Jun 27 11:46 AM
Hi,
Do this way...
select-options: date for sy-datum.
initialization.
date-low = sy-datum - 30.
date-high = sy-datum.
date-sign = 'I.
date-option = 'BT'.
append date.
clear date.Regards
vijay
‎2006 Jun 27 11:54 AM
Hi Salil,
In order to find out the date 30 days in advance just do this calculation.
Data: ws_date type sy-datum.
ws_date = sy-datum - 30.
If you want the starting date and ending date of this month. then use this function module <b>"HR_JP_MONTH_BEGIN_END_DATE"</b>
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
ev_month_begin_date = s_date-low
ev_month_end_date = s_date-high.
s_date-sign = 'I'.
s_date-option = 'BT'.
APPEND s_date.
now your
s_date-low = 20060601. "(01/06/2006)
s_date-high = 20060630. "(30/06/2006)
So you can use either of the two above.
Hope this solves ur issue. Reward if helpful.
Regards,
Tushar