Application Development and Automation 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: 
Read only

Problem in getting public holiday class using function module

Former Member
0 Likes
1,568

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

1 ACCEPTED SOLUTION
Read only

bpawanchand
Active Contributor
0 Likes
1,092

Hi

Check the tables mentioned in the thread

Regards

Pavan

7 REPLIES 7
Read only

Former Member
0 Likes
1,092

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.

Read only

0 Likes
1,092

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

Read only

0 Likes
1,092

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.

Read only

0 Likes
1,092

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

Read only

bpawanchand
Active Contributor
0 Likes
1,093

Hi

Check the tables mentioned in the thread

Regards

Pavan

Read only

Former Member
0 Likes
1,092

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.

Read only

Former Member
0 Likes
1,092

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