11-05-2007 1:33 PM
hi experts
i need to retrive the following data
1. actual working days of company
eg: toal calender years 28 or 30 or 31
company working days = total calender days in a month - day off' +public holidays.
2. actual working days of employee = actual working days of company - leaves.
this is from 2002
3. total absences = all kinds of absences as of my knowledge we can get this 2001
individually but i want to get in total.
please help me
regards
11-06-2007 3:06 AM
Try the following coding:
data: l_d_facdate_from type facdate,
l_d_facdate_to type facdate.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
CORRECT_OPTION = '+'
DATE = i_d_startdate
FACTORY_CALENDAR_ID = i_d_factcal_id
IMPORTING
FACTORYDATE = l_d_facdate_from
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
CORRECT_OPTION_INVALID = 2
DATE_AFTER_RANGE = 3
DATE_BEFORE_RANGE = 4
DATE_INVALID = 5
FACTORY_CALENDAR_NOT_FOUND = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
CORRECT_OPTION = '-'
DATE = i_d_enddate
FACTORY_CALENDAR_ID = i_d_factcal_id
IMPORTING
FACTORYDATE = l_d_facdate_to
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
CORRECT_OPTION_INVALID = 2
DATE_AFTER_RANGE = 3
DATE_BEFORE_RANGE = 4
DATE_INVALID = 5
FACTORY_CALENDAR_NOT_FOUND = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
e_d_difference = l_d_facdate_to - l_d_facdate_from + 1.
The function 'DATE_CONVERT_TO_FACTORYDATE' counts the workingdays so the result is the number of working days since 01.01.1995. This allows you to build differences quite easily.
Please give me reward points..
11-07-2007 6:13 AM