Avoid Recalculation of Time and Date of Splits

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

1.

Go to SE37

2. Enter function module CX_KBED_INDIVIDUAL_CAPACITIES

3. Press button “Change”

4. Search for the following context block

clear t499r.
endif.
endif.

5. After this context block insert the following code block

* Modification in order to control split scheduling "XBEK001422


DATA: ls_kbedd type kbedd, "XBEK001422
ls_cxafvg_v2 type cxafvg_v2, "XBEK001422
lv_flg_no_calendar type c, "XBEK001422
lv_autyp type auftyp. "XBEK001422
* Local copies "XBEK001422
ls_kbedd = kbedd. "XBEK001422
ls_cxafvg_v2 = cxafvg_v2. "XBEK001422
lv_flg_no_calendar = x_flg_no_calendar. "XBEK001422

IF not ls_kbedd-aufpl is initial.


CALL FUNCTION 'CO_BT_CAUFV_READ_WITH_AUFPL'
EXPORTING
AUFPL_IMP = ls_kbedd-aufpl
IMPORTING
AUTYP_EXP = lv_autyp
EXCEPTIONS
NOT_FOUND = 01.
IF SY-SUBRC <> 0.
select single autyp from caufv into lv_autyp
where aufpl = ls_kbedd-aufpl.
ENDIF.
ELSE. "XBEK001422
IF not ls_kbedd-aufnr is initial.
CALL FUNCTION 'CO_BT_CAUFV_READ_WITH_KEY' "XBEK001422
EXPORTING "XBEK001422
AUFNR_ACT = ls_kbedd-aufnr "XBEK001422
IMPORTING "XBEK001422
AUTYP_EXP = lv_autyp "XBEK001422
EXCEPTIONS "XBEK001422
NOT_FOUND = 1 "XBEK001422
OTHERS = 2. "XBEK001422
IF SY-SUBRC <> 0. "XBEK001422
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO "XBEK001422
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. "XBEK001422
ENDIF. "XBEK001422
ENDIF.
ENDIF.
* Only for PM and CS orders. "XBEK001422
IF lv_autyp = 30. "XBEK001422
* In order to avoid split time reset, time data of HR "XBEK001422
* person should not be considered. "XBEK001422
* For the function call 'CX_SCHED_VIA_OPERATING_TIME' "XBEK001422
* and 'CX_OPR_SCHEDULE' some parameters must be initial."XBEK001422
CLEAR: ls_kbedd-pernr, "XBEK001422
ls_kbedd-arbid, "XBEK001422
ls_kbedd-kapid, "XBEK001422
ls_cxafvg_v2-arbid. "XBEK001422
* No consideration of holidays "XBEK001422
lv_flg_no_calendar = 'X'. "XBEK001422
ENDIF. "XBEK001422

6. Search for the following context block

call function 'CX_SCHED_VIA_OPERATING_TIME'


exporting
i_date_start = start_date
i_time_start = start_time
i_date_end = end_date
i_time_end = end_time
i_unit = cxafvg_v2-daune

7. After this context block delete the following code block

i_arbid = kbedd-arbid
i_pernr = kbedd-pernr
i_kapid = kbedd-kapid
i_flg_exact_breaks = x_flg_exact_breaks
i_flg_no_calendar = x_flg_no_calendar

8. Afterwards insert the following code block

i_arbid = ls_kbedd-arbid "XBEK001422


i_pernr = ls_kbedd-pernr "XBEK001422
i_kapid = kbedd-kapid
i_flg_exact_breaks = x_flg_exact_breaks
i_flg_no_calendar = lv_flg_no_calendar "XBEK001422
9. Search for the following context block

call function 'CX_OPR_SCHEDULE'


exporting
afvg_v1_imp = cxafvg_v1

10. After this context block delete the following code block

afvg_v2_imp = cxafvg_v2

11. Afterwards insert the following code block

afvg_v2_imp = ls_cxafvg_v2 "XBEK001422


* \ afvg_v2_imp = cxafvg_v2 "XBEK001422
12. Search for the following context block

i_flg_forward = 'X'
i_date = start_date
i_time = start_time
CXZEIT_IMP = CXZEIT
t499r_imp = t499r
i_opr_status = status

13. After this context block delete the following code block

i_kapid = kbedd-kapid
i_pernr = kbedd-pernr
i_flg_exact_breaks = x_flg_exact_breaks
i_flg_shift_order = x_flg_shift_order
i_flg_no_calendar = x_flg_no_calendar

14. Afterwards insert the following code block

i_kapid = ls_kbedd-kapid "XBEK001422


i_pernr = ls_kbedd-pernr "XBEK001422
i_flg_exact_breaks = x_flg_exact_breaks
i_flg_shift_order = x_flg_shift_order
i_flg_no_calendar = lv_flg_no_calendar "XBEK001422

You might also like