10-13-2008 8:06 PM
Hi Gurus,
my requirement is to get a working day.
I know how many days my work will take to finish i.e no of days, let us say 10 days
I need to add these number of working days to the system date excluding the weekend days.i.e I need to add 10 working days to the system date.
Any help is appreciated...........
Thanks,
Sudhaaaaaaaa........
10-13-2008 8:23 PM
Do like this:
DATA: it_psp TYPE STANDARD TABLE OF ptpsp WITH HEADER LINE,
wrk_days type i.
CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE' "get EE working days
EXPORTING
pernr = "EE number here
begda = "start date in your case sy-datum
endda = "end date in your case sy-datum+10
TABLES
perws = it_psp. "now you will get work schedule within this period but more general
"you have to take only days you are interested in
wrk_days = 0.
LOOP AT it_psp WHERE datum BETWEEN sy-datum AND sy-datum+10
AND tagty = 0 "work/paid
AND stdaz <> 0. "working hours
ADD 1 TO wrk_days. "here you have how many days are really working ones between sy-datum and 10 days later
ENDLOOP.
10-13-2008 8:23 PM
Do like this:
DATA: it_psp TYPE STANDARD TABLE OF ptpsp WITH HEADER LINE,
wrk_days type i.
CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE' "get EE working days
EXPORTING
pernr = "EE number here
begda = "start date in your case sy-datum
endda = "end date in your case sy-datum+10
TABLES
perws = it_psp. "now you will get work schedule within this period but more general
"you have to take only days you are interested in
wrk_days = 0.
LOOP AT it_psp WHERE datum BETWEEN sy-datum AND sy-datum+10
AND tagty = 0 "work/paid
AND stdaz <> 0. "working hours
ADD 1 TO wrk_days. "here you have how many days are really working ones between sy-datum and 10 days later
ENDLOOP.