‎2008 Aug 23 8:27 AM
Hi to all
I am using function module
HR_PERSON_READ_WORK_SCHEDULE.
for getting the employee's actual work schedule and public holiday class FTKLA.
But I am unable to get the correct public holiday class.
Please guide me.
How to do that.
Regards
Anubhav
‎2008 Aug 23 8:38 AM
‎2008 Aug 23 8:37 AM
To get the public holiday class use another function module.HOLIDAY_GET.
Loop at it_PSP.
if it_psp-tprog = 'OFF'
call function 'holiday_get'.
.......
.......
endif.
endloop.
‎2008 Aug 23 8:40 AM
Thanks
But I also want to read actual work schedule and holiday class simultaneously.
My requirement is to check both work schedule and holiday class at the same time.
Please suggest me another way.
Thanks
Anubhav
‎2008 Aug 23 8:45 AM
Dear Abhinav,
First call the FM HR_PERSON_READ_WORK_SCHEDULE.
The output of this FM is PSP table, take the records into it_psp.
Now process the Internal table it_psp.
Loop at it_PSP.
if it_psp-tprog = 'OFF'
call function 'holiday_get'.
.......
.......
*move the info from holiday_get FM and it_psp into other *internal table.
endif.
endloop.
‎2008 Aug 25 12:41 PM
Thanks for your reply...
What should be the input parameters to be given to
Holiday_get
There is two parameter
one is holiday calender and other one factory calender.
What should be given for that and how to find it for an employee.
Please guide..
Regards
Anubhav Gupta
‎2008 Aug 23 8:38 AM
‎2008 Aug 25 12:49 PM
Hi,
form build_work_schedule tables b_psp structure pdpsp
b_day_psp structure pdsppsp
b_employees structure pdpnr
using value(b_begda) like sy-datum
value(b_endda) like sy-datum
value(b_read_db) type c.
data: counter type i. "Note 495298
call function 'HR_PERSON_READ_WORK_SCHEDULE'
exporting
begin_date = b_begda
end_date = b_endda
grouping_dws = motpr "VEX Modif
grouping_attendence = moabw
grouping_substitute = mover
read_from_database = b_read_db
im_read_no_locked_records = 'X' "803380
tables
pernr_tab = b_employees
psp = b_psp
day_psp = b_day_psp
exceptions
error_in_build_psp = 1
others = 2.
read table b_employees with key error = 'X'
transporting pernr.
if sy-subrc eq 0.
read table d3000_pers with key pernr = b_employees-pernr
transporting name.
if sy-subrc eq 0.
message s582 with d3000_pers-name.
else.
message s582 with b_employees-pernr.
endif.
endif.
Hope it helps you.
‎2008 Aug 25 12:53 PM
Hi,
HOLIDAY_GET Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.
for parameters factory calender and holiday calender check table TFACD.
Regards
Adil