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: 

number of holiday, saturday and sunday between two dates

Former Member
0 Kudos

Hi all,

I try to count the number of holiday, saturday and sunday between two dates ( no working days)

Can you let me an exemple,

thank i am new in abap.

Karima.

2 REPLIES 2

GauthamV
Active Contributor
0 Kudos

hi,

Use Function module RKE_SELECT_FACTDAYS_FOR_PERIOD.

I_DATAB = 01.01.2008

I_DATBI = 21.10.2008

I_FACTID = '01' .

I_FACTID = '01' , in table TFACD indicates 5 working days in a week and the holiday calender <blank>. This will not consider holidays.

Former Member
0 Kudos

Hi Karima,

Already posted reply in datawarehousing Forum

Try this code . For ex for ITALY use

DATA : IT_HOLIDAYS TYPE TABLE OF ISCAL_DAY.
 
CALL FUNCTION 'HOLIDAY_GET'
 EXPORTING
   HOLIDAY_CALENDAR                 = 'IT'
*   FACTORY_CALENDAR                 = ' '
   DATE_FROM                        = '20080101'
   DATE_TO                          = SY-DATUM
* IMPORTING
*   YEAR_OF_VALID_FROM               =
*   YEAR_OF_VALID_TO                 =
*   RETURNCODE                       =
  TABLES
    HOLIDAYS                         = IT_HOLIDAYS
* EXCEPTIONS
*   FACTORY_CALENDAR_NOT_FOUND       = 1
*   HOLIDAY_CALENDAR_NOT_FOUND       = 2
*   DATE_HAS_INVALID_FORMAT          = 3
*   DATE_INCONSISTENCY               = 4
*   OTHERS                           = 5
          .
IF SY-SUBRC EQ 0.
 
  WRITE 'Done'.
 
ENDIF.

Output will be

01.01.2008 X 006 Nw Yrs Day New Year's Day

06.01.2008 X 007 Epiphany Epiphany

23.03.2008 X 801 Easter Easter Sunday

24.03.2008 X 002 Easter Mon Easter Monday

25.04.2008 X 036 Liberazio. Festa della Liberazione

01.05.2008 X 009 May Day May Day

02.06.2008 X 257

15.08.2008 X 048 Assumption Assumption

Regards

Edited by: Rajvansh Ravi on Oct 21, 2008 6:20 AM