2006 Jun 05 3:37 PM
Hello all.
Wich functions should i use to obtain the calendars and their associations with the plant? Is there any function that returns the nonworking days as intervals?
I also would like to know how to obtain shifts.
Thank you
Nuno Silva
2006 Jun 05 3:43 PM
Try
<b> call function 'CY_GET_TIMEINTERVAL'</b> exporting
calendar_id = rc65a-kalid
fiscal_year_variant = rc65a-periv
period_type = rc65a-zaper
sdatefrom = rc65a-zavon
sdateto = rc65a-zabis
importing
datefrom = rc65a-lidav
dateto = rc65a-lidab
datefrom_string = rc65a-zavon
dateto_string = rc65a-zabis
exceptions
interval_cannot_be_computed = 01.
FYI
<u><b>INCLUDE PROG :MC65AFP1</b></u>
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise"
Try
<b> call function 'CY_GET_TIMEINTERVAL'</b> exporting
calendar_id = rc65a-kalid
fiscal_year_variant = rc65a-periv
period_type = rc65a-zaper
sdatefrom = rc65a-zavon
sdateto = rc65a-zabis
importing
datefrom = rc65a-lidav
dateto = rc65a-lidab
datefrom_string = rc65a-zavon
dateto_string = rc65a-zabis
exceptions
interval_cannot_be_computed = 01.
FYI
<u><b>INCLUDE PROG :MC65AFP1</b></u>
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise"
2006 Jun 05 3:43 PM
Try
<b> call function 'CY_GET_TIMEINTERVAL'</b> exporting
calendar_id = rc65a-kalid
fiscal_year_variant = rc65a-periv
period_type = rc65a-zaper
sdatefrom = rc65a-zavon
sdateto = rc65a-zabis
importing
datefrom = rc65a-lidav
dateto = rc65a-lidab
datefrom_string = rc65a-zavon
dateto_string = rc65a-zabis
exceptions
interval_cannot_be_computed = 01.
FYI
<u><b>INCLUDE PROG :MC65AFP1</b></u>
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise"
2006 Jun 05 4:35 PM
Saquib,
I could not get the function to work the way it should. It says the interval is not valid
Thank you
Message was edited by: Nuno Silva
2006 Jun 05 3:47 PM
YOu can get the factory id from plants table T001w-FABKL.
FABKL is the field.
YOu can use the fm K_ABC_WORKDAYS_FOR_PERIODS_GET to get the working days in the interval specified.
The rest are non-working days.
Regards,
ravi
2006 Jun 05 4:38 PM
Ravi Kanth Talagana,
Thank you for the info on the plant's calendar.
That specific function asks for a parameter called CALL_PROG. What should i put there?
Function HOLIDAY_GET is quite usefull, but is there any way to convert this into intervals?
Thank you.
2006 Jun 05 4:51 PM
HI NUno,
The FM DATE_CONVERT_TO_FACTORYDATE will be more relevant to your requirement.
<b>date1 = start_date.
do.
if date1 = end_date.
exit.
endif.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING DATE = DATE1
FACTORY_CALENDAR_ID = CALENDAR
IMPORTING DATE = DATE2
FACTORYDATE = FACTORYD
WORKINGDAY_INDICATOR = WORKDAY
EXCEPTIONS CORRECT_OPTION_INVALID = 1
DATE_AFTER_RANGE = 2
DATE_BEFORE_RANGE = 3
DATE_INVALID = 4
FACTORY_CALENDAR_NOT_FOUND = 5.
if workday <> 'X'.
it_non_work_day-date = date1.
append it_non_work_day.
clear it_non_work_day.
endif.
date_1 = date_1 + 1.
enddo.</b>
REgards,
Ravi
2006 Jun 05 3:48 PM
hi,
use factory calender for working days.
FM.
WSAF_GET_LAST_DAY_OF_MONTH
FKK_ADD_WORKINGDAY
check if day of the month is a working day or not
CALL FUNCTION 'ISU_CHECK_HOLIDAY'
EXPORTING
i_date = xyv_read_end
i_calendar1 = gc_factory_cal
IMPORTING
e_x_no_workingday = flg_is_non_working
e_x_is_holiday = flg_is_holiday
EXCEPTIONS
not_found = 1
calendar_error = 2
OTHERS = 3.
IF sy-subrc <> 0 .
do nothing
ENDIF.
regards
2006 Jun 05 3:51 PM
YOu can use the fm HOLIDAY_GET to get the non working days.
Regards,
Ravi
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |