06-20-2008 2:19 PM
Hi SAP guru,
Is there a SAP FM that allows me to input a date,
eg
20.06.2008
and return me the day of the year,
eg
254
out of 365 days.
Thanks
06-20-2008 2:23 PM
Hi,
Use this function module HR_CALC_YEAR_MONTH_DAY, and give the starting and ending date of the year to get the no of days (but it will give based on YEARS, MONTHS, DAYS).
Edited by: Ravi Kumar on Jun 20, 2008 3:26 PM
06-20-2008 2:23 PM
Hi,
Use this function module HR_CALC_YEAR_MONTH_DAY, and give the starting and ending date of the year to get the no of days (but it will give based on YEARS, MONTHS, DAYS).
Edited by: Ravi Kumar on Jun 20, 2008 3:26 PM
06-23-2008 2:16 AM
Hi,
I cannot find the FM you mentioned.
I am on rel4.7 and I am not having HR module.
06-20-2008 2:28 PM
use FM
HR_HK_DIFF_BT_2_DATES
pass date1 (the day U want to enter)
date2 = first day of the year(get year from date1)
output_format = 02.
U'll get the days in DAYS ...
06-23-2008 2:17 AM
Thanks for the prompt reply.
However, you have not clearly understand my problem.
I need to find out the day of the year, not the difference
06-20-2008 2:37 PM
hi
try this FM this will solve ur problem
FIMA_DAYS_AND_MONTHS_AND_YEARS
SD_CALC_DURATION_FROM_DATETIME
HR_99S_INTERVAL_BETWEEN_DATES
<REMOVED BY MODERATOR>
Cheers
Snehi
Edited by: Alvaro Tejada Galindo on Jun 20, 2008 9:59 AM
06-20-2008 2:37 PM
hiiii
i have logic for getting total number of days..like below.it will help you to get days..
PARAMETERS:
p_date TYPE sy-datum.
SELECTION-SCREEN END OF BLOCK b1 .
DATA:
w_date TYPE sy-datum,
w_second TYPE d,
w_result TYPE i.
AT SELECTION-SCREEN OUTPUT .
p_date = sy-datum.
w_date = p_date - 1.
p_date = w_date.
START-OF-SELECTION.
w_second = p_date.
w_second+6(2) = '01'.
w_result = w_date - w_second.
WRITE: / 'Number Of Days Is:',w_result.
<REMOVED BY MODERATOR>
thx
twinkal
Edited by: Alvaro Tejada Galindo on Jun 20, 2008 10:00 AM
06-20-2008 2:54 PM
data: days type i .
CALL FUNCTION 'HR_99S_INTERVAL_BETWEEN_DATES'
EXPORTING
BEGDA = '20080101'
ENDDA = sy-datum
TAB_MODE = ' '
IMPORTING
DAYS = days .
write:/ 'no of days is' , days .
06-23-2008 2:18 AM
Thanks for the prompt reply.
However, this is not what I am looking for.
I need to know the day of year.
06-20-2008 2:56 PM
Use the FM--- OIUH_PWTOJULIANDT.
Pass the date only in the format YYYY-MM-DD.
The above FM contains 3 parameters and all are mandatory:
Result will be stored in the RDATE parameter. The first four letters contains the Year and next letters contain the day of the year.
<REMOVED BY MODERATOR>
Regards,
Kiran Bobbala
Edited by: Alvaro Tejada Galindo on Jun 20, 2008 10:00 AM
06-20-2008 3:04 PM
Colin,
You can use this FM "HR_AUPBS_MONTH_DA" to get return the year of day. But u need to give the start date and end date.
Regards,
Suresh Kumar.
06-23-2008 2:20 AM
Thanks for the prompt reply.
However, this is not what I need.
I had only 1 date. I need to convert it to day of year.
06-23-2008 3:07 AM
Hi,
Use Function Module
FI_PSO_DAYS_MONTHS_YEARS_GET.
Give start date
And To Date.
This would calculate the number of days.
Regards,
Nikhil
07-15-2008 10:13 AM
Thanks for all the suggestion.
I decided to use FUNCTION 'BKK_ADD_WORKINGDAY'.
This function allows me to get the last date before input date.