Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FM to find no days in factory calander

Former Member
0 Kudos
868

hi

i want to find out no of days for give date according to factory colander ..

e.g.

my date is 01.01.2009 ;

in month 01 may some holidays like sundays

removing all the holidays i want to find no of days ..

1 ACCEPTED SOLUTION

Former Member
0 Kudos
282

HI,

Try this FM.

'DAY_ATTRIBUTES_GET'

13 REPLIES 13

Former Member
0 Kudos
282

Hi,

use the FM: HOLIDAY_GET..

This will give you all the holidays according to the factory calender..

Regards

Shiva

0 Kudos
282

hi shiva

thanq for u fast reply ...

as i mentioned i want no of working days after removing holidays according to factory calendar Is there any function module available ?

ysr

0 Kudos
282

Finally [search>>>|https://forums.sdn.sap.com/search.jspa?q=working%20days%20factory%20calendar&dateRange=last90days&searchID=24626890&rankBy=10001&start=0]

0 Kudos
282

hi j@y,

i will give only date 01.01.2008.

is there any FM to find no of working days according to Factory calendar ..

without writing any code straight forward .. like i will give date FM has to give no working days for

particular date.

ysr

0 Kudos
282

hi experts ,

any help ...

ysr

0 Kudos
282

Hi YSR,

I think there is no such FM. You have to make some simple calculations like getting the starting date and ending date of the month of the date which you will enter as follows.


*Get no. of days using date
CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'
  EXPORTING
    p_fecha        = p_date
  IMPORTING
    number_of_days = l_f_number_of_days.

*Get start date
l_f_start+6(2) = '01'.         "This is always same - starting day
l_f_start+4(2) = p_date+4(2).  "Get month from given date
l_f_start+0(2) = p_date+4(2).  "Get year from given date

*Get end date
l_f_end+6(2) = l_f_number_of_days. "This is always same - starting day
l_f_end+4(2) = p_date+4(2).  "Get month from given date
l_f_end+0(2) = p_date+4(2).  "Get year from given date

And you give the startdate and end date along with the Factory calendar ID to the FM RKE_SELECT_FACTDAYS_FOR_PERIOD to get the no. of working days in a date range.

Best Regards,

Sasidhar Reddy Matli.

0 Kudos
282

FACTORY_CALENDAR_ATTRIBUTE_GET

0 Kudos
282

hi,

not sure

check this out.

DATE_CONVERT_TO_FACTORYDATE Calendar function: Returns factory calendar date

FACTORYDATE_CONVERT_TO_DATE Calendar function: Returns date for a factory ca

LAST_FACTORYDATE_GET Calendar function: Return last factory date for

or u can do one thing

use HOLIDAY_GET , then u will get no. of holidays.

then use ISHMED_GET_DAYS_PER_MONTH to get total days for the month .

then do calculation .

Former Member
0 Kudos
283

HI,

Try this FM.

'DAY_ATTRIBUTES_GET'

Former Member
0 Kudos
282

Hello YSR,

You can use the FM RKE_SELECT_FACTDAYS_FOR_PERIOD to get the no. of working days in a date range.

To get the no. of working days for a months, you give the starting and ending date of the month. You need to pass Factory ID also.

Use the FM HR_E_NUM_OF_DAYS_OF_MONTH to get the no. of days. Just type a date in the input. you will get the no.of days of the month. Using this you can get the end date to pass to the FM RKE_SELECT_FACTDAYS_FOR_PERIOD.

Best Regards,

Sasidhar Reddy Matli.

Edited by: Sasidhar Reddy Matli on Apr 8, 2009 4:12 PM

Former Member
0 Kudos
282

Try FM WDKAL_DATE_ADD_FKDAYS

This gives no of working days in a date range...

Former Member
0 Kudos
282

Hi

You can try the following fm's

GET_DATE_FROM_CALID

CYCP_GET_CALENDAR

CY_GET_CALENDAR

DATE_CONVERT_TO_FACTORYDATE

FACTORYDATE_CONVERT_TO_DATE

LAST_FACTORYDATE_GET

Thanks

Satish

Former Member
0 Kudos
282

closed