2008 Jun 09 4:05 PM
HI!
In my selection screen in my report I need to default a
selection option to a future date which is 3 months from the
present date. Can anyone tell me whats the way to do this so
that I can add 3 montsh from the present date and default it in my selection screen.
example : if we consider todays date then we need to
default that date to 9th of september 2008 so it keeps of
changing everyday as dates proceed.
Thanks
HI!
In my selection screen in my report I need to default a
selection option to a future date which is 3 months from the
present date. Can anyone tell me whats the way to do this so
that I can add 3 montsh from the present date and default it in my selection screen.
example : if we consider todays date then we need to
default that date to 9th of september 2008 so it keeps of
changing everyday as dates proceed.
Thanks
2008 Jun 09 4:07 PM
2008 Jun 09 4:08 PM
hi,
do this way ...
initialization.
V_DATE = SY-DATUM.
p_date = v_date + 90.
.
2008 Jun 09 4:11 PM
hi,
You can even use RP_CALC_DATE_IN_INTERVAL FM
parameters output_date type sy-datum.
data input_date type sy-datum.
initialization.
input_date = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = input_date
days = '00'
months = '03'
signum = '+'
years = '00'
IMPORTING
calc_date = output_date. Regards,
Santosh
2008 Jun 09 4:30 PM
I have a my selection screen like this and if I try adding just 90 to it it gives me error , and regarding using FM , do I really need to use the FM to have this working as its just the selection screen , I am not sure..
p_rb2 RADIOBUTTON GROUP G1,
p_date AS CHECKBOX MODIF ID 234,
p_bedat TYPE vbak-guebg DEFAULT sy-datum MODIF ID 234,
p_endat TYPE vbak-gueen MODIF ID 234,<------
p_rental AS CHECKBOX MODIF ID 234.
<----- need to default this as present date plus 3 months.
Thanks
2008 Jun 09 4:36 PM
hi,
I am not getting any error in this way ......
parameters : p_rb1 RADIOBUTTON GROUP G1.
parameters : p_rb2 RADIOBUTTON GROUP G1,
p_date AS CHECKBOX MODIF ID 234,
p_bedat TYPE vbak-guebg DEFAULT sy-datum MODIF ID 234,
p_endat TYPE vbak-gueen MODIF ID 234, " 2008/09/07
p_rental AS CHECKBOX MODIF ID 234.
initialization.
p_endat = sy-datum + 90.
2008 Jun 09 4:14 PM
TABLES bseg.
DATA: l_date TYPE sy-datum.
SELECT-OPTIONS: s_date FOR bseg-bzdat.
INITIALIZATION.
CALL FUNCTION 'ADD_TIME_TO_DATE'
EXPORTING
i_idate = sy-datum
i_time = '3'
i_iprkz = '2'
* I_RDMHD =
IMPORTING
o_idate = l_date
EXCEPTIONS
invalid_period = 1
invalid_round_up_rule = 2
internal_error = 3
OTHERS = 4.
MOVE l_date TO s_date-high.
s_date-sign = 'I'.
s_date-option = 'EQ'.
APPEND s_date.
2008 Jun 09 4:49 PM
Check the below program :
REPORT ZTEST78 .
data v_fdate type d.
CALL FUNCTION 'HR_PSD_DATES_ADD_MONTHS'
EXPORTING
V_DATE = sy-datum
V_MONTHS = 3
IMPORTING
E_DATE = v_fdate
EXCEPTIONS
NOT_POSITIVE = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write:/ v_fdate.
do not add 90 days ,some months may have 31 or 29 or 28,you will not get exact calculation,so use FM 'HR_PSD_DATES_ADD_MONTHS'
Thanks
Seshu
Thanks
Seshu
2008 Jun 09 8:52 PM
Yes the dates are showing defaulted to 3 months from now . I have another question to it , if in my report I want to show the result based on these dates itself, like when I check this checkbox which has the dates inbeteen present date and 3 months from now as done in selection screen , how do I show the output based on this selection. As of now when I check this checkbox i.e with valid dates from today to valid date upto 3 months from now , it still is showing me the entire report and not the contracts in between these dates. Can anyone help me in explaining this please.
Thanks
2008 Jun 09 10:44 PM
you need to use that date in the select statement, in the where condition..clause..
2008 Jun 11 10:18 PM