<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HR: Working days between two given dates in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698846#M624901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like useing function module DURATION_DETERMINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Aug 2007 19:19:07 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-08-28T19:19:07Z</dc:date>
    <item>
      <title>HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698844#M624899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      I have to calculate the working days (ie days which are not OFF) between two dates for the employees.&lt;/P&gt;&lt;P&gt;      Is there any function to achieve that? any advice will be greatly appreciated &amp;amp; rewarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Fede.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:14:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698844#M624899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698845#M624900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Federico,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use FM &amp;lt;b&amp;gt;RKE_SELECT_FACTDAYS_FOR_PERIOD&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aneesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:16:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698845#M624900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698846#M624901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like useing function module DURATION_DETERMINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698846#M624901</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-08-28T19:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698847#M624902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use this FM RKE_SELECT_FACTDAYS_FOR_PERIOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0.&lt;/P&gt;&lt;P&gt;        include structure RKE_DAT.&lt;/P&gt;&lt;P&gt;data: end of itab. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data: wa_num type i.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_datab  = start_date&lt;/P&gt;&lt;P&gt;            i_datbi  = end_date&lt;/P&gt;&lt;P&gt;            i_factid = '01'&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            eth_dats = itab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;describe table itab lines wa_num.&lt;/P&gt;&lt;P&gt;write: / 'Working days between two periods is', wa_num.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:20:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698847#M624902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698848#M624903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPORT ZTEST NO STANDARD PAGE HEADING LINE-COUNT 65&lt;/P&gt;&lt;P&gt;LINE-SIZE 132&lt;/P&gt;&lt;P&gt;MESSAGE-ID ZZ.&lt;/P&gt;&lt;P&gt;PARAMETER : P_DATE LIKE SY-DATUM.&lt;/P&gt;&lt;P&gt;data: it_holidays like iscal_day occurs 0 with header line.&lt;/P&gt;&lt;P&gt;DATA: T_DATE LIKE SY-DATUM.&lt;/P&gt;&lt;P&gt;data : x_date(4) type c.&lt;/P&gt;&lt;P&gt;data: cnt type i.&lt;/P&gt;&lt;P&gt;REFRESH : IT_HOLIDAYS.&lt;/P&gt;&lt;P&gt;CLEAR : IT_HOLIDAYS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'HOLIDAY_GET'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;HOLIDAY_CALENDAR = 'US'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FACTORY_CALENDAR = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATE_FROM = P_DATE&lt;/P&gt;&lt;P&gt;DATE_TO = T_DATE&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;YEAR_OF_VALID_FROM =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;YEAR_OF_VALID_TO =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RETURNCODE =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;HOLIDAYS = IT_HOLIDAYS&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;FACTORY_CALENDAR_NOT_FOUND = 1&lt;/P&gt;&lt;P&gt;HOLIDAY_CALENDAR_NOT_FOUND = 2&lt;/P&gt;&lt;P&gt;DATE_HAS_INVALID_FORMAT = 3&lt;/P&gt;&lt;P&gt;DATE_INCONSISTENCY = 4&lt;/P&gt;&lt;P&gt;OTHERS = 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cnt = 0.&lt;/P&gt;&lt;P&gt;loop at it_holidays.&lt;/P&gt;&lt;P&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; it_holidays.&lt;/P&gt;&lt;P&gt;cnt = cnt + 1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_date = t_date - p_date - cnt.&lt;/P&gt;&lt;P&gt;write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'No of working days are' ,  x_date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698848#M624903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698849#M624904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guys, thanks a lot for your time, but I think I didnt explain myself very well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The days I need depends on the planned working time of each employee (ie its work schedule rule), because an employee could work from sunday through friday, and other from monday through wednesday, and then they have diffentes amount of days OFFs between two given dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I was clear enough&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:23:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698849#M624904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698850#M624905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Where you store this working schedule.. what every code that we have send works on factory calender, which considers monday to friday as working days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what you can do is .. get the working scheduel for the employee from that table.. then pass the schedule to this function module and it will return you the working days...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698850#M624905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698851#M624906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Federico,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this, but I am not sure it works. Just give it a try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: it_ptpsp type standard table of t_ptpsp initial size 0,
      wa_ptpsp type t_ptpsp.

  CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'
       EXPORTING
            pernr             = pernr-pernr
            begda             = pn-begda
            endda             = pn-endda
*          KUG               =
*          REFRESH           = 'X'
*          WORKING_HOURS     = 'X'
*          SWITCH_ACTIV      =
*          MODIFY_ENTRIES    = 'X'
*          I0001_I0007_ERROR = '0'
*          READ_CLUSTER      =
      IMPORTING
           warning_occured   =   gd_warning
       TABLES
*          I0000             =
*          I0001             =
*          I0002             =
*          I0007             =
*          I0049             =
*          I2001             =
*          I2002             =
*          I2003             =
            perws             = it_ptpsp   "Stores employees work schedule 
*          I0003             =
      EXCEPTIONS
           error_occured     = 1
           abort_occured     = 2
           OTHERS            = 3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:32:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698851#M624906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698852#M624907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working schedule is stored in infotype 0007, table PA0007, field SCHKZ; the code you kindly gave to me considers monday to friday as working days, but not all employees follow that schedule, some of the employees in my company work 6 times a week (so that they have only 1 day OFF) and others work 4 days a week and the like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:34:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698852#M624907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698853#M624908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It didnt work dude, anyway, many thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698853#M624908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698854#M624909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Dude. I cant find anything else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aneesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 19:55:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698854#M624909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T19:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698855#M624910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   What is that you are trying to find out.. the total working days in a month or a year . or between any two dates... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thansk&lt;/P&gt;&lt;P&gt;mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 20:00:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698855#M624910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T20:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698856#M624911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Between any two dates&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 20:11:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698856#M624911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T20:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698857#M624912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what you have to do is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select the Work Schedule Rule from PA0007 for a employee .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case  v_schedule&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 'STANDARD'.&lt;/P&gt;&lt;P&gt; use the code that we have already sent you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when 'ESP_0102' " this will tell you on what days a person will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us say he works from monday through wed..day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us say start date is today... and i want to calculate the total number of working days for this guy till sept 15.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : lv_startdate type sy-datum,&lt;/P&gt;&lt;P&gt;         lv_enddate type sy-datum,&lt;/P&gt;&lt;P&gt;         lv_tempdate type sy-datum.&lt;/P&gt;&lt;P&gt;data : lv_workdays type i.&lt;/P&gt;&lt;P&gt;lv_startdate = sy-datum.&lt;/P&gt;&lt;P&gt;lv_tempdate = sy-datum + 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function DAY_ATTRIBUTES_GET and pass lv_startdate and lv_enddate it will return the details of the week.. mon , tue , wen, thru, as we know he starts on monday .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say read table where WE = 'MO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this table will have the start date..so ur start date wold be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_startdate = itab-date.&lt;/P&gt;&lt;P&gt;and end date would be&lt;/P&gt;&lt;P&gt;lv_enddate =  lv_startdate + 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while lv_enddate &amp;lt;= sept15.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0.&lt;/P&gt;&lt;P&gt;include structure RKE_DAT.&lt;/P&gt;&lt;P&gt;data: end of itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_num type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_datab = start_date&lt;/P&gt;&lt;P&gt;i_datbi = end_date&lt;/P&gt;&lt;P&gt;i_factid = '01'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;eth_dats = itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;describe table itab lines wa_num.&lt;/P&gt;&lt;P&gt;lv_workingdays = wa_num + lv_workingdays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_startdate =  lv_startdate + 6.&lt;/P&gt;&lt;P&gt;lv_enddate = lv_enddate + 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endwhile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here lv_workingdays will have the no of working days for a employe..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like this you have to do for each and every type of possible work Schedule rule&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 20:30:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698857#M624912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T20:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698858#M624913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot dude for your time, i tried it but it didnt work as I expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 21:12:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698858#M624913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T21:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698859#M624914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all, I made myself a program to achieve my need, because I didnt find any function to do it, I will share what I coded, may be it could be useful for anyone else:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zphr_working_days.

PARAMETER p_fechad LIKE sy-datum OBLIGATORY.
PARAMETER p_fechah LIKE sy-datum OBLIGATORY.
PARAMETER p_pernr       LIKE pa0007-pernr OBLIGATORY.


TABLES t552a.

DATA wa_t552a         LIKE t552a.
DATA anio             LIKE t552a-kjahr.
DATA mes              LIKE t552a-monat.
DATA dia              LIKE t552a-monat.
DATA v_fecha          LIKE sy-datum.
DATA v_pht            LIKE pa0007-schkz.
data v_wdays          type i.
DATA wa_duration      LIKE psen_duration_dec.

* Data para los punteros
FIELD-SYMBOLS: &amp;lt;v_symb_ttp&amp;gt;.
DATA v_field_ttp(14) TYPE c.
FIELD-SYMBOLS: &amp;lt;v_symb_tpr&amp;gt;.
DATA v_field_tpr(14) TYPE c.

v_wdays = 0.

v_fecha = p_fechad.

WHILE v_fecha &amp;lt;= p_fechah.

  select single schkz
  into v_pht
  from pa0007
  where pernr = p_pernr
  and begda   &amp;lt;= v_fecha
  and endda   &amp;gt;= v_fecha.

  if sy-subrc = 0.
*  Recupero el anio, mes y día
    anio = v_fecha+0(4).
    mes  = v_fecha+4(2).
    dia  = v_fecha+6(2).

    SELECT SINGLE *
      FROM t552a
      INTO wa_t552a
     WHERE zeity = '1'
       AND mofid = 'PR'
       AND mosid = '10'
       AND schkz = v_pht
       AND kjahr = anio
       AND monat = mes.


    CONCATENATE 'WA_T552A-TTP' dia INTO v_field_ttp.
    ASSIGN (v_field_ttp) TO &amp;lt;v_symb_ttp&amp;gt;.
    CONCATENATE 'WA_T552A-TPR' dia INTO v_field_tpr.
    ASSIGN (v_field_tpr) TO &amp;lt;v_symb_tpr&amp;gt;.

    if ( &amp;lt;v_symb_ttp&amp;gt; eq ' ' OR
         &amp;lt;v_symb_ttp&amp;gt; eq 0 ) AND
         &amp;lt;v_symb_tpr&amp;gt; ne 'OFF'.

         add 1 to v_wdays.

     endif.

  endif.

* Incrementamos el día en uno
  add 1 to v_fecha.

ENDWHILE.


write: / 'PHT:' , v_pht , 'working days:' , v_wdays .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know it is not performant at all, Im far of being an abaper,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 21:14:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698859#M624914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T21:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698860#M624915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sure you play around with this logic... nothing beyond this.. i am sure.. where do you think this will not work.. i dont see y this will not work ... let me know what exactly u r not getting...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 21:16:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698860#M624915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T21:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: HR: Working days between two given dates</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698861#M624916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your logic is quite nice Mahesh, thats for sure, the problem is that you are assumming that all works schedule have the same scheduling every week, and that is not true because there are some rotating works schedule wich changes the scheduling weekly, so I cant put the logic in a case statement as you kindly suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2007 22:23:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hr-working-days-between-two-given-dates/m-p/2698861#M624916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-28T22:23:31Z</dc:date>
    </item>
  </channel>
</rss>

