2009 Jul 15 10:45 AM
Hi ALL,
This is quit differnt.
I need to give input the 'start date' and the 'number of days' and get the total days from the start date in year,month and day format.
for example.
start date :01.01.2009
number of days as 32
then i should get
years:0
months :1
days :1
Pleas help me out.
2009 Jul 15 10:58 AM
hi,
please SEARCH forum
use 'HR_99S_DATE_ADD_SUB_DURATION'
IM_DATE - provide your input date
IM_OPERATOR - This one is whether you want to add/sub from your date " + / - "
IM_DURATION - Duration means How many years/months/days you want to add/sub
or 'J_1H_CAL_DATE_IN_INTERVAL'
thanks
2009 Jul 15 10:51 AM
2009 Jul 15 10:55 AM
Try using this code and see if this helps the requirement.
DATA: w_durdd type PSEN_DURATION, w_datein type sy-datum, w_dateout type sy-datum, MOVE 32 TO w_durdd-durdd. CALL FUNCTION 'HR_99S_DATE_ADD_SUB_DURATION' EXPORTING im_date = w_datein im_operator = '+' im_duration = w_durdd IMPORTING EX_DATE = w_dateout.
2009 Jul 15 10:57 AM
Hi ,
use this function module 'HR_99S_DATE_ADD_SUB_DURATION' .
Please let me know if you still have any issues on this.
Thansk and regards,
Rajeshwar.
2009 Jul 15 10:58 AM
hi,
please SEARCH forum
use 'HR_99S_DATE_ADD_SUB_DURATION'
IM_DATE - provide your input date
IM_OPERATOR - This one is whether you want to add/sub from your date " + / - "
IM_DURATION - Duration means How many years/months/days you want to add/sub
or 'J_1H_CAL_DATE_IN_INTERVAL'
thanks
2009 Jul 15 10:59 AM
Hello
Use FM HR_SEN_CRULE_0100_DURATION, where begin date = your start date and end date = your start date + number of days.
2009 Jul 15 2:06 PM
with ref to Maroz post ...
FM works
ex
parameters:pa_dat type sy-datum.
parameters:pa_days type i.
data:v_dat type sy-datum.
data:output type PSEN_DURATION_DEC.
v_dat = pa_dat + pa_days.
CALL FUNCTION 'HR_SEN_CRULE_0100_DURATION'
EXPORTING
id_begda = pa_dat
id_endda = v_dat
IMPORTING
ES_DURATION = output
EXCEPTIONS
CONVERSION_NOT_SPECIFIED = 1
CONVERSION_NOT_POSSIBLE = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
write:/ 'Years', output-CALYY DECIMALS 0,
/ 'Months', output-CALMM DECIMALS 0,
/'Days', output-CALDD DECIMALS 0.
ENDIF.
2009 Jul 15 11:11 AM
Hi,
Please use following FM,
CALL FUNCTION 'HR_99S_INTERVAL_BETWEEN_DATES'
EXPORTING
BEGDA = " Enter Start Date"
endda = " Enter Start Date + Number of day (i.e. in your case 32) = End Date
TAB_MODE = ' '
IMPORTING
DAYS = " No Of days between Start and End Date
C_WEEKS = " No Of weeks between Start and End Date
C_MONTHS = " No Of Months between Start and End Date
C_YEARS = " No Of Years between Start and End Date
WEEKS =
MONTHS =
YEARS =
D_MONTHS =
MONTH_TAB =
.
Thanks and Regards,
ShreeMohan
2009 Jul 15 12:21 PM
hi Anusha,
first u pass the date and the days to the following fm you will get the result date....
data:date type sy-datum,
r_date(10) type c.
date = sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '32'
MONTHS = '0'
START_DATE = date
IMPORTING
RESULT_DATE = r_date
.
write:/ r_date.
then you need to pass the result date and the date to the following fm to get the required output...
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = r_date
date2 = date
IMPORTING
years = v_years
months = v_months
days = v_days
EXCEPTIONS
invalid_dates_specified = 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.
here u will get the difference in days, months and year...
i hope u wil get help from this...
regards
Ashu Singh