This website is not affiliated with, sponsored by, or approved by SAP AG.

rest day update/substitute

Human Resources (PM, OM, PA, TM ,PD)

Moderators: Snowy, thx4allthefish, muhnkee_2

rest day update/substitute

Postby Durga » Sun Oct 20, 2002 11:23 pm

Hi,
I have a problem in updating in monthly calendar. that is, if public holiday falls on saturday the substitution day is friday, and if PH falls on sunday the substition day is monday.
we have infotypes 2051,2003. how can we do this. can anybody give me idea..?
how can we identify the PH falls on sunday or saturday and how can we update the monthly calendar..?
pla. help me. Thanks you all in Advance.
Regards
Durgaaaa :oops:
Durga
 

Postby VankyKrish » Mon Oct 21, 2002 1:44 am

Hi Try Define Selection Rules in Day types.
IMG- TIME- WORKSCHDULE-DAY TYPES.

Here you can define the rules for cases when public holiday falls on a saturday and sunday

:D
VankyKrish
 
Posts: 35
Joined: Mon Oct 21, 2002 1:34 am
Location: Oman

rest day

Postby durga » Tue Oct 22, 2002 1:00 am

hai vamsy,
how can w e define rest day substition there in img..?
i have seen that. but there we have workdays and sat and sunday. but for me there no sunday or saturday..only rest day /off day.
what top do..?
plz. help.
regards
durga
durga
 

Postby Ramya » Tue Oct 22, 2002 1:11 am

Im also gettingbthe same problem. no one to help us
Ramya
Ramya
 

Postby MADHURI » Tue Oct 22, 2002 1:12 am

DONT U HAVE FUNC. CONSULTANT..?
MADHURI
 

Postby BHAVANA » Tue Oct 22, 2002 1:12 am

ITS VERY DIFFICULT PROBLEM
BHAVANA
 

Postby Guest » Wed Oct 23, 2002 12:00 am

Well Durga you still can do this with a combination of configuration:
use the day type, have it configured in a workschdule and counting rules.

This should work.

AD
Guest
 

Postby dURGAA » Wed Oct 23, 2002 12:42 am

wHERE CAN WE CONFIGURE THAT ONE..?CAN WE WRITE A PROGRAM TO DO THIS..?IF SO, HOW TO DO..?PLZ. HELP ME.
dURGA
sINGAPORE
dURGAA
 

Postby durgaa » Wed Oct 23, 2002 12:49 am

this requirement is for new work schdule-shift workers. they dont have any sunday or saturday. they have only rest day/off day leaves. so if PH falls on Rest day which is saturday we need to bring the PH to FRiday. If the PH falls on OFF day which is Sunday we need to move the PH to Monday.
can we create a substitition for that particular day ..?( ex. for if ph on restday/sat substition on friday).
and.. The changes should reflect in Monthly Calendar..(2051 infotype).?
This is for a Employee Subgroup Only.
can we Check the restday and Ph using 0007 infotype.if so how can anybody give idea..?????
Pl. help.
thanks in advance
Durgaaaaaa
Singapore
durgaa
 

Postby Guest » Wed Oct 23, 2002 1:24 am

durgaa wrote:this requirement is for new work schdule-shift workers. they dont have any sunday or saturday. they have only rest day/off day leaves. so if PH falls on Rest day which is saturday we need to bring the PH to FRiday. If the PH falls on OFF day which is Sunday we need to move the PH to Monday.
can we create a substitition for that particular day ..?( ex. for if ph on restday/sat substition on friday).
and.. The changes should reflect in Monthly Calendar..(2051 infotype).?
This is for a Employee Subgroup Only.
can we Check the restday and Ph using 0007 infotype.if so how can anybody give idea..?????
Pl. help.
thanks in advance
Durgaaaaaa
Singapore
Guest
 

urgent

Postby durga » Wed Oct 23, 2002 1:51 am

plz. help me its urgent
durga
 

Postby endurista » Wed Oct 23, 2002 2:07 am

Hi Durga,

The transaction for maintaining holidays, calendars... is OY05. What you are looking for is a special holiday type. In the public holiday definition mark "Guaranteed" if it is an ordinary holiday - or define a movable with warranty. The problem I see is that in one shift the holiday is given one day before, in the other one day after the holiday. I think the rule behind is if it is saturday = free - one day before, if it is sunday = free -one day after. Try this: make one guaranteed on saturday/sunday and move it before. Make the other one - which is in fact the same holiday guaranteed on sunday and move it after.

Hope this helps/works

regards,

endurista

Thanks for registering at my website
endurista
 
Posts: 133
Joined: Sun Oct 20, 2002 10:42 am
Location: Munich

urgent : plz. read

Postby Durga » Wed Oct 23, 2002 4:34 am

Hi Endurista,
Thank u very Much for ur Reply.Yes i tried the way which u suggested. But My case is different.
The total scenario is like this.
some employee work in shifts they dont have saturdays or sunday leaves. they have only rest day or half day.
so.. they get rest day/off day on any day(including work days).( it depends on work schdule).
so suppose,
1. if a employee gets a rest day or off day on wednesday( which is also PH), and off day or rest day on thursday also ..>we need to move the PH to Tuesday.
2. if if Thursday in above case is not OFF day then the PH is Thursday itself.
these are some of the cases.
and my Project manager is not intrested in configuration he wants me to write a program.so im writing a program also,.
im taking all holidays into an itab say itab1, and all personnel no.s into another itab, say itab2.

im taking itab1 date( that is holiday date) and i want to check the planned working time infotype 0007 column-pa0007-arbst= working hours on that holiday date
if pa0007 arbst is '0' its a rest day.so i can create a substition for that holiday .its okay. But my problem in program is im unable to get the planned working time (arbst) in pa0007 for a particular date.
suppose tomorrow is restday for an employee ..im expecting arbst should be 0. but not so.
IMP:where can i get the planned working hours (pa0007-arbst) on a particular day..?( because if arbst is 0 then its rest day).
i think u understood my problem.,
plz. suggest me some solution.opr else.. can i use 2051(monthly calendar) using hr_read_infotype can i read the 2051 infotype to get the planned working houirs..?
plz. mail me.
im very very sorry for this long mail.and also excuse me if i disturbed u from ur work.
thankyou very much.
Regards
Durga
adi labs
Durga
 

Postby endurista » Wed Oct 23, 2002 5:21 am

Hi Durga,

so if the question is how to get the target hours for a particular day in a program then maybe I got a quick fix: It is a function module used by CATS to get target hours out of your work schedule - CATS_GET_TARGET_HOURS.
Here is a sample of the code I used in one of my programs.
Try this one and let me know.

DESCRIBE TABLE CATS1 LINES N.
IF N NE 0.
DO N TIMES.
CLEAR CATST.
REFRESH ZTARGETHOURS.
READ TABLE CATS1 INDEX 1 INTO CATST.
CALL FUNCTION 'CATS_GET_TARGET_HOURS'
EXPORTING
PERNR = CATST-EMPLOYEENUMBER
BEGDA = CATST-WORKDATE
ENDDA = CATST-WORKDATE
TABLES
TARGET_HOURS = ZTARGETHOURS
EXCEPTIONS
PERNR_NOT_FOUND = 1
TOO_MANY_DAYS = 2
OTHERS = 3.

IF ZTARGETHOURS-STDAZ NE 0.
MOVE ZTARGETHOURS-STDAZ TO CATST-CATSHOURS.
APPEND CATST TO CATS1.
ENDIF.
DELETE CATS1 INDEX 1.
ENDDO.
ENDIF.

In table CATS1 - internal table I got the workdates and the personnel number and then I check whether planned working hours are 0.
Regards,

endurista
endurista
 
Posts: 133
Joined: Sun Oct 20, 2002 10:42 am
Location: Munich

hai endurist

Postby Durga » Wed Oct 23, 2002 8:45 pm

hai Endurista,
Thankyou very much for ur help. Its working . but its considering all cases. i mean if the day is off or rest or public holiday its giving 0.But what i want is,
im taking a public holiday ..im checking whether that date is a rest day or off day for that employee. if its rest day or off day -- already its holiday so i will create a substitution and my problem will be solved.
so will u please tell me any other function module.
thanks a lot.
below is my program.
Regards
Durgaa

*======================================================================*
* Program ID : ZHRPHCHNG
* Program Description : This program will Change the PH which falls on
* Rest Day. if the Rest day is Saturday ,Substition is Previous Day.
* Last change by :
* Last change date :
* Version Control : 1.0
*======================================================================*
* Change Date Prgmr Details of change
*
*======================================================================*
TABLES: PERNR,PA0001.
DATA : BEGIN OF ITAB4 OCCURS 0.
INCLUDE STRUCTURE P2051.
DATA : END OF ITAB4.

DATA : BEGIN OF ITAB1 occurs 0,
begda LIKE PA0000-BEGDA,
END OF ITAB1.

DATA : BEGIN OF ITAB2 OCCURS 0,
pernr like p0000-pernr,
*begda like p0007-begda,
END OF ITAB2.

data : begin of catst occurs 0,
pernr like p0000-pernr,
begda like p0000-begda,
thours LIKE PTIMEOV1-REGULARHOURS,

*STDAZ LIKE PTIMEOV1-REGULARHOURS.
*thours type p0007-arbst,
end of catst.
data : n type i.
selection-screen:begin of block blk1 with frame title text-100.

data : begin of ztargethours occurs 0.
include structure cats_hours_per_day.
*STDAZ LIKE PTIMEOV1-REGULARHOURS,
*stdaz like p0007-arbst,
Data: end of ztargethours.
PARAMETERS:
SUBGROUP LIKE PA0001-PERSK.

SELECTION-SCREEN SKIP.
selection-screen:end of block blk1.

START-OF-SELECTION.
*
*** LIST OF EMPLOYEE WHO BELONG TO THE SPECIFIED EMPLOYEE SUBGROUP.

SELECT DISTINCT PERNR FROM PA0001 INTO ITAB2 WHERE PERSK = SUBGROUP.
WRITE ITAB2-PERNR.
append itab2.
ENDSELECT.

**** lIST OF pUBLIC hOLIDAYS.

SELECT DATUM INTO ITAB1 FROM THOC WHERE IDENT = 'SB' AND DATUM >
SY-DATUM.
WRITE ITAB1-begda.
append itab1.
ENDSELECT.

WRITE ' HOLIDAYS'.

loop at itab1.

*DESCRIBE TABLE itab2 LINES N.
*IF N NE 0.
*DO N TIMES.
loop at itab2.
CLEAR CATST.
REFRESH ZTARGETHOURS.
move itab2-pernr to catst-pernr.
*READ TABLE itab2 INDEX 1 INTO CATST.
move itab1-begda to catst-begda.
append catst.
*read table itab1 index 1 into catst.
CALL FUNCTION 'CATS_GET_TARGET_HOURS'
EXPORTING
PERNR = CATST-pernr
BEGDA = CATST-begda
ENDDA = CATST-begda
TABLES
TARGET_HOURS = ZTARGETHOURS
EXCEPTIONS
PERNR_NOT_FOUND = 1
TOO_MANY_DAYS = 2
OTHERS = 3.

IF ZTARGETHOURS-STDAZ eq 0.

*MOVE ZTARGETHOURS-STDAZ TO CATST-tHOURS.
*APPEND CATST TO CATS1.
ENDIF.
*DELETE itab1 INDEX 1.
write ztargethours-stdaz.
*ENDDO.
*ENDIF.
endloop.
endloop.
Durga
 

Next

Return to Human Resources

Who is online

Users browsing this forum: No registered users and 6 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.