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: 

Fetch actual working days

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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..

0 Kudos

CAN U PLZ GIVE ME THE PROGRAM IN DETAIL

REGARDS