Beruflich Dokumente
Kultur Dokumente
*&---------------------------------------------------------------------*
*&
Module STATUS_2004 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE status_2004 OUTPUT.
*----------------------------------------------------------------------*
TYPES: BEGIN OF l_ty_afvu,
aufpl TYPE afvu-aufpl,
mber of operations in the order
aplzl TYPE afvu-aplzl,
unter for order
usr02 TYPE afvu-usr02,
with 10 characters
usr03 TYPE afvu-usr03,
with 10 characters
usr08 TYPE afvu-usr08,
for date
usr09 TYPE afvu-usr09,
for date
END OF l_ty_afvu.
"Routing nu
"General co
"User field
"User field
"User field
"User field
*----------------------------------------------------------------------*
DATA:
l_v_titel TYPE titel,
l_v_vorna TYPE vorna,
" Title
" first Nam
"Early Fini
"Early Fini
l_v_unit
"Normal Dur
e
alender
sh Date
sh Time
TYPE ehten,
ation
l_v_dura TYPE tagen ,
ation Unit
l_wa_afvu TYPE l_ty_afvu.
"Normal Dur
" Comments
*----------------------------------------------------------------------*
IF g_v_upd_opr = abap_false.
REFRESH l_i_objtab.
l_i_objtab[] = object_tab[].
**only one entry is expected to be available in the internal table
**No subrc check as the emptiness of the table is already satisfied
READ TABLE l_i_objtab ASSIGNING <fs_wa_objtab> INDEX g_v_index.
*----------------------------------------------------------------------*
IF sy-subrc = 0.
ord_num = <fs_wa_objtab>-aufnr.
ber
uo_kts = <fs_wa_objtab>-vornr.
ext Key
uo_ste = <fs_wa_objtab>-steus.
y
uo_ltx = <fs_wa_objtab>-ltxa1.
short text
* MOD 007 change of main workcenter to Plant workcenter.
uo_arb = <fs_wa_objtab>-v_arbpl.
* MOD 007 end.
uo_txt = <fs_wa_objtab>-wc_dec.
e Descerption
uo_wer = <fs_wa_objtab>-v_werks.
e Plant
uo_anl = <fs_wa_objtab>-anlzu.
uo_work = <fs_wa_objtab>-arbei.
uo_beh = <fs_wa_objtab>-arbeh.
uo_num = <fs_wa_objtab>-anzzl.
uo_ndu = <fs_wa_objtab>-dauno.
ation
uo_dae = <fs_wa_objtab>-daune.
ation Unit
p_code = <fs_wa_objtab>-pspel.
Code- PSPEL from object tab. == P_CODE
jir
= <fs_wa_objtab>-jobimdrsk .
ediate Risk == JIR
bi
= <fs_wa_objtab>-busimpt.
s Impact == BI
"Standard T
"Control Ke
"Operation
"Work Centr
"Work Centr
"Priority
"Work
"Work Unit
"Number
"Normal Dur
"Normal Dur
"**
Project
"**
Job Imm
"**
Busines
* ----------------------------------------------------------------------*
* --- MOD 004 D2893 start Appointment Type. ----------------------------*
* ----------------------------------------------------------------------*
uo_code = <fs_wa_objtab>-code.
uo_appt = <fs_wa_objtab>-apptext.
* if the appointment type is 01 Display only .
LOOP AT SCREEN.
IF screen-name = zcl_pme208_tech_pln_wb=>gc_pme208_scr_code.
IF uo_code = 01.
screen-input = 0.
for disable.
MODIFY SCREEN.
ELSE.
E = 01 Line No. :114
screen-input = 1.
for disable.
MODIFY SCREEN.
ENDIF.
E = 01 Line No. :114
ENDIF.
-NAME = ZCL_PME208_TECH_PLN_WB=>GC_PME208_SCR_CODE Lin
ENDLOOP.
CREEN Line No. :111
"1 enable 0
" IF UO_COD
"1 enable 0
" IF UO_COD
" IF SCREEN
" LOOP AT S
* ----------------------------------------------------------------------*
*
*
*
*
*
*
*
" IF SY-SUB
" IF SY-SUB
uo_dae = <fs_wa_objtab>-daune .
uo_beh = <fs_wa_objtab>-arbeh .
----------------------------------------------------------------------*
--- MOD 005 End 29/02/2016. Conver the units. interanl to external. *
----------------------------------------------------------------------*
--- As per the new Logic Data needs to beDerived instead of Copying -*
--- Get Factory Calender ID and working hour ------------------------*
--- of the engineer workcenter --------------------------------------*
----------------------------------------------------------------------*
*
*
*
*
*
----------------------------------------------------------------------*
--- These Select Singles are inside the Loop ------------------------*
--- as we dont want to fectch data ----------------------------------*
--- If the priority doesnt fit the condition ------------------------*
----------------------------------------------------------------------*
SELECT SINGLE fabkl
FROM t001w
INTO l_v_cal
WHERE werks EQ <fs_wa_objtab>-iwerk.
*----------------------------------------------------------------------*
* Pass early satr date and time to method to get new finsh time and date
l_v_last_d = <fs_wa_objtab>-fsavd.
"Early Star
t Date
l_v_last_t = <fs_wa_objtab>-fsavz.
"Early Star
t Time
l_v_unit = <fs_wa_objtab>-daune .
"Normal Dur
ation Unit
l_v_dura
ation
= <fs_wa_objtab>-dauno .
"Normal Dur
*----------------------------------------------------------------------*
* ----------------------------------------------------------------------*
* --- we cannot directly add the value as there can be multiple holidays in betw
een *
* --- Find the next working day of the calendar -----------------------*
* ----------------------------------------------------------------------*
CALL METHOD zcl_pm_util=>meth_inst_priv_get_nwd(
EXPORTING
im_cal = l_v_cal
im_dura = l_v_dura
im_unit = l_v_unit
CHANGING
ch_date = l_v_last_d
ch_time = l_v_last_t ).
*----------------------------------------------------------------------*s
*----------------------------------------------------------------------*
* Pass last satr date and time to output
<fs_wa_objtab>-fsavd = l_v_last_d .
Date
<fs_wa_objtab>-fsavz = l_v_last_t .
Time
"last Start
"last Start
*----------------------------------------------------------------------*
***** START: Select Data From afvu ************************************
*****
Into Table l_i_afvu **************************************
SELECT SINGLE
aufpl
aplzl
usr02
usr03
usr08
usr09
FROM afvu
INTO l_wa_afvu
WHERE aufpl = <fs_wa_objtab>-aufpl
AND aplzl = <fs_wa_objtab>-aplzl.
IF sy-subrc = 0.
REPLACE ALL OCCURRENCES OF ':' IN l_wa_afvu-usr02 WITH space.
CONDENSE l_wa_afvu-usr02.
uo_est = l_wa_afvu-usr02.
REPLACE ALL OCCURRENCES OF ':' IN l_wa_afvu-usr03 WITH space.
CONDENSE l_wa_afvu-usr03.
uo_eft = l_wa_afvu-usr03.
uo_esd = l_wa_afvu-usr08.
uo_efd = l_wa_afvu-usr09.
rt Date
ish Date
ENDIF.
" IF SY-SUB
RC = 0 Line No. :220
*----------------------------------------------------------------------*
* Sla end
l_v_last_d
Date
l_v_last_t
Time
l_v_unit
ation Unit
l_v_dura
ation
= uo_esd.
"SLA Start
= uo_est.
"SLA Start
= <fs_wa_objtab>-daune .
"Normal Dur
= <fs_wa_objtab>-dauno .
"Normal Dur
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input
= l_v_unit
IMPORTING
output
= l_v_unit
EXCEPTIONS
unit_not_found = 1.
* ----------------------------------------------------------------------*
* --- we cannot directly add the value as there can be multiple holidays in betw
een *
* --- Find the next working day of the calendar -----------------------*
* ----------------------------------------------------------------------*
IF <fs_wa_objtab>-priok GT 3.
CALL METHOD zcl_pm_util=>meth_inst_priv_get_nwd(
EXPORTING
im_cal = l_v_cal
im_dura = l_v_dura
im_unit = l_v_unit
CHANGING
ch_date = l_v_last_d
ch_time = l_v_last_t ).
*----------------------------------------------------------------------*s
*----------------------------------------------------------------------*
* Pass last satr date and time to output
uo_efd = l_v_last_d .
Date
uo_eft = l_v_last_t .
Date
ELSE.
_OBJTAB>-PRIOK GT 3 Line No. :260
l_v_cal = space.
CALL METHOD zcl_pm_util=>meth_inst_priv_get_nwd(
EXPORTING
im_cal = l_v_cal
im_dura = l_v_dura
im_unit = l_v_unit
CHANGING
ch_date = l_v_last_d
"last Start
"last Start
" IF <FS_WA
ch_time = l_v_last_t ).
*----------------------------------------------------------------------*s
*----------------------------------------------------------------------*
* Pass last satr date and time to output
uo_efd = l_v_last_d .
Date
uo_eft = l_v_last_t .
Date
ENDIF.
_OBJTAB>-PRIOK GT 3 Line No. :260
"last Start
"last Start
" IF <FS_WA
" Required_
* --- Create the Objkey and objid for data selection -----------------*
* ----------------------------------------------------------------------*
CLEAR: l_v_tabkey,l_v_obj_id.
l_v_tabkey = sy-mandt && <fs_wa_objtab>-aufpl && <fs_wa_objtab>-aplzl.
l_v_obj_id = sy-mandt && l_v_autype && <fs_wa_objtab>-aufnr. "
* ----------------------------------------------------------------------*
* --- Clear the Tables and clal th FM to Get the History. ------------*
* ----------------------------------------------------------------------*
CLEAR : i_history, l_i_editpos_temp.
*----------------------------------------------------------------------*
CALL FUNCTION 'CHANGEDOCUMENT_READ'
EXPORTING
objectclass
= zcl_pm_literals=>gc_order
objectid
= l_v_obj_id
tablekey
= l_v_tabkey
date_until
= sy-datum
time_until
= sy-uzeit
IMPORTING
et_cdred_str
= i_history
TABLES
editpos
= l_i_editpos_tem1
EXCEPTIONS
no_position_found
= 1
wrong_access_to_archive
= 2
time_zone_conversion_error = 3
OTHERS
= 4.
*----------------------------------------------------------------------*
IF sy-subrc <> 0.
MESSAGE i001(zpme210_msg) DISPLAY LIKE zcl_pm_literals=>gc_message_typ
e_e.
CLEAR l_i_editpos_temp.
EXIT.
ENDIF.
" IF SY-SUB
RC <> 0 Line No. :359
* ----------------------------------------------------------------------*
* --- Transfer the lines to the temporary table for deletion ---------*
* ----------------------------------------------------------------------*
l_i_editpos_temp[] = l_i_editpos_tem1[].
*----------------------------------------------------------------------*
SORT l_i_editpos_temp BY objectid changenr tabname.
* ----------------------------------------------------------------------*
* --- Get the fields from AFVU only as we need USR* fields only ------*
* ----------------------------------------------------------------------*
DELETE l_i_editpos_temp WHERE tabname NE zcl_pm_literals=>gc_afvu.
* ---- Delete to get the latest entry only# --------------------------*
SORT l_i_editpos_temp BY objectid changenr fname.
DELETE ADJACENT DUPLICATES FROM l_i_editpos_temp COMPARING fname.
SORT l_i_editpos_temp BY objectid tabkey fname.
* ----------------------------------------------------------------------*
* --- Read the table to get the latest line of the history ---------*
*
*
*
*
--- (Read will use binary searcjh so 4 read are better than loop ) -*
--- Below read will automatically select first row each time so ----*
--- a delete is avoided. -------------------------------------------*
----------------------------------------------------------------------*
READ TABLE l_i_editpos_temp ASSIGNING <l_fs_history>
WITH KEY objectid = l_v_obj_id
tabkey = l_v_tabkey
fname = zcl_pm_literals=>gc_usr08
BINARY SEARCH .
IF sy-subrc IS INITIAL.
l_v_date_external = <l_fs_history>-f_old.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external
= l_v_date_external
"external date fo
rmatting
IMPORTING
date_internal
= l_v_date_internal
"internal date fo
rmatting
EXCEPTIONS
date_external_is_invalid = 1
"the external dat
e is invalid
OTHERS
= 2.
uo_fsa = l_v_date_internal.
ELSE.
RC IS INITIAL Line No. :394
uo_fsa = l_wa_afvu-usr08.
ENDIF.
RC IS INITIAL Line No. :394
" IF SY-SUB
" IF SY-SUB
*
*
*
*
----------------------------------------------------------------------*
--- Below read will automatically select first row each time so a -*
--- delete is avoided. --------------------------------------------*
----------------------------------------------------------------------*
READ TABLE l_i_editpos_temp ASSIGNING <l_fs_history>
WITH KEY objectid = l_v_obj_id
tabkey = l_v_tabkey
fname = zcl_pm_literals=>gc_usr02 BINARY
SEARCH .
IF sy-subrc IS INITIAL.
l_v_time = <l_fs_history>-f_old.
REPLACE ALL OCCURRENCES OF ':' IN l_v_time WITH space.
CONDENSE l_v_time.
uo_fsz = l_v_time.
ELSE.
RC IS INITIAL Line No. :421
" IF SY-SUB
uo_fsz = l_wa_afvu-usr02.
ENDIF.
RC IS INITIAL Line No. :421
" IF SY-SUB
*
*
*
*
----------------------------------------------------------------------*
--- Below read will automatically select first row each time ---------*
--- so a delete is avoided.-----------------------------------------*
----------------------------------------------------------------------*
READ TABLE l_i_editpos_temp ASSIGNING <l_fs_history>
WITH KEY objectid = l_v_obj_id
tabkey = l_v_tabkey
fname = zcl_pm_literals=>gc_usr09 BINARY
SEARCH .
IF sy-subrc IS INITIAL.
l_v_date_external = <l_fs_history>-f_old.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external
= l_v_date_external
"external date fo
rmatting
IMPORTING
date_internal
= l_v_date_internal
"internal date fo
rmatting
EXCEPTIONS
date_external_is_invalid = 1
"the external dat
e is invalid
OTHERS
= 2.
uo_fse = l_v_date_internal.
ELSE.
RC IS INITIAL Line No. :443
uo_fse = l_wa_afvu-usr09.
" IF SY-SUB
ENDIF.
RC IS INITIAL Line No. :443
" IF SY-SUB
*
*
*
*
----------------------------------------------------------------------*
--- Below read will automatically select first row each time so------*
--- a delete is avoided. -------------------------------------------*
----------------------------------------------------------------------*
READ TABLE l_i_editpos_temp ASSIGNING <l_fs_history>
WITH KEY objectid = l_v_obj_id
tabkey = l_v_tabkey
fname = zcl_pm_literals=>gc_usr03 BINARY
SEARCH .
IF sy-subrc IS INITIAL.
l_v_time = <l_fs_history>-f_old.
REPLACE ALL OCCURRENCES OF ':' IN l_v_time WITH space.
CONDENSE l_v_time.
uo_fsez = l_v_time.
ELSE.
RC IS INITIAL Line No. :474
" IF SY-SUB
uo_fsez = l_wa_afvu-usr03.
ENDIF.
RC IS INITIAL Line No. :474
" IF SY-SUB
ELSE.
RC = 0 Line No.
uo_fsa
Date
uo_fsz
Time
uo_fse
h Date
uo_fsez
h Time
" IF SY-SUB
:326
= l_wa_afvu-usr08.
= l_wa_afvu-usr03.
= l_wa_afvu-usr09.
= l_wa_afvu-usr03.
ENDIF.
" IF SY-SUB
RC = 0 Line No. :326
*----------------------------------------------------------------------*
* MOD 011 end
*----------------------------------------------------------------------*
IF uo_rqe IS NOT INITIAL.
SELECT SINGLE ename FROM pa0001 INTO uo_ren WHERE pernr = uo_rqe AND end
da GE sy-datum.
IF sy-subrc NE 0.
SELECT SINGLE titel
vorna
nachn FROM pa0002
INTO (l_v_titel, l_v_vorna, l_v_nachn)
WHERE pernr = uo_rqe AND endda GE sy-datum.
IF sy-subrc = 0.
CONCATENATE l_v_titel l_v_vorna l_v_nachn INTO uo_ren SEPARATED B
Y space.
ENDIF.
" IF SY-SUB
RC = 0 Line No. :510
ENDIF.
" IF SY-SUB
RC NE 0 Line No. :504
ENDIF.
" IF UO_RQE
IS NOT INITIAL Line No. :502
ENDIF.
RC = 0 Line No. :83
ENDIF.
D_OPR = ABAP_FALSE Line No. :73
* update the screen fields with default values.
" IF SY-SUB
" IF G_V_UP
* ----------------------------------------------------------------------*
* --- MOD 012 start --------------------------------------------------*
* ----------------------------------------------------------------------*
CLEAR:l_i_rowindex[].
APPEND INITIAL LINE TO l_i_rowindex ASSIGNING <fs_rowindex>.
<fs_rowindex>-index = g_v_index.
l_ty_qmma,
bapi2080_notactvi,
"
"Notificati
bapi2080_notactvi,
"Notificati
bapi2080_notactvi_x,
"Changeflag
bapi2080_nothdri,
"BAPI Servi
"Notificati
"General Fl
"General Fl
"Activity C
"Activity C
"Activity C
"Count para
"Count para
"Count para
"Message Te
"Return Par
"General Fl
l_ty_qmma,
bapiret2,
"
"Return Par
bapi2080_notactvi,
"Notificati
bapi2080_notactvi_x.
"Changeflag
g_v_upd_opr = abap_true.
CASE ok_code. "sy-ucomm.
WHEN zcl_pm_literals=>gc_method_save OR
ODE "SY-UCOMM Line No. :582
zcl_pm_literals=>gc_act_ok.
*----------------------------------------------------------------------*
CLEAR: l_i_objtab.
*----------------------------------------------------------------------*
READ TABLE object_tab ASSIGNING <fs_wa_objtab> INDEX g_v_index.
IF sy-subrc = 0.
*
* get the new control key based on index from CRHD.
SELECT SINGLE werks FROM crhd INTO uo_wer
WHERE
arbpl = <fs_wa_objtab>-v_arbpl
%_HINTS ORACLE zcl_pm_literals=>gc_ind_steus.
* ----------------------------------------------------------------------*
* --- * MOD 010 D3773 start 07/04/2016 ---*
* ----------------------------------------------------------------------*
<fs_wa_objtab>-v_arbpl = uo_arb .
<fs_wa_objtab>-steus = uo_ste.
"Control Ke
y
* get the new control key based on index from CRHD.
SELECT SINGLE steus FROM crhd INTO <fs_wa_objtab>-steus
WHERE werks = uo_wer
AND arbpl = <fs_wa_objtab>-v_arbpl
%_HINTS ORACLE zcl_pm_literals=>gc_ind_steus.
IF sy-subrc = 0.
uo_ste = <fs_wa_objtab>-steus.
ENDIF.
RC = 0 Line No. :611
" IF SY-SUB
" IF <FS_WA
" IF <FS_WA
"last Start
"last Start
" IF <FS_WA
im_unit = l_v_unit
CHANGING
ch_date = l_v_last_d
ch_time = l_v_last_t ).
*----------------------------------------------------------------------*s
*----------------------------------------------------------------------*
* Pass last satr date and time to output
uo_efd = l_v_last_d .
Date
uo_eft = l_v_last_t .
Date
"last Start
"last Start
ENDIF.
" IF <FS_WA
_OBJTAB>-PRIOK GT 3 Line No. :649
* ----------------------------------------------------------------------*
* --- * MOD 009 D3623 start 24/03/2016 End ---*
* ----------------------------------------------------------------------*
* Validations;
*2 Operation is Dispatched or further processed after Dispatch (Operation numbe
red user status is not equal
*
to CRTD or DEFR or RAOP or RJCT)
* Don t trigger release of already Release operation
* Operation already released or above (Operation user status = RAOP)
*
Operation number& 1 successfully release.
IF ( <fs_wa_objtab>-v_ustxt NS zcl_pm_literals=>gc_stat_crtd
AND <fs_wa_objtab>-v_ustxt NS zcl_pm_literals=>gc_stat_defe AND
<fs_wa_objtab>-v_ustxt NS zcl_pm_literals=>gc_stat_raop
AND <fs_wa_objtab>-v_ustxt NS zcl_pm_literals=>gc_stat_rjct ) .
* MOD 001
* Selected operation is not suitable for update
*
MESSAGE i022 INTO l_wa_msg-string.
*
APPEND l_wa_msg TO g_i_msg .
MESSAGE i022 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
EXIT.
ENDIF.
" IF ( <FS_
WA_OBJTAB>-V_USTXT NS ZCL_PM_LITERALS=>GC_STAT_CRTD A
*----------------------------------------------------------------------*
* 2 Don t release a cancel operation
* Operation is not Cancelled (Operation un-numbered user status is not
celled)
* Operation is already Cancelled It cannot be released
CANC = Can
IF <fs_wa_objtab>-v_ustxt CS zcl_pm_literals=>gc_stat_canc .
* MOD 001
* Operation is already Cancelled It cannot be updated
*
MESSAGE i023 INTO l_wa_msg-string.
*
APPEND l_wa_msg TO g_i_msg .
MESSAGE i023 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
EXIT.
ENDIF.
" IF <FS_WA
_OBJTAB>-V_USTXT CS ZCL_PM_LITERALS=>GC_STAT_CANC Line
*----------------------------------------------------------------------*
* 5
Don t release already Confirmed operation
* Operation system status = CONF (confirmed)
It cannot be released
IF <fs_wa_objtab>-v_sttxt CS zcl_pm_literals=>gc_stat_teco .
* MOD 001
* Operation is already Confirmed
It cannot be updated
" IF <FS_WA
ENDIF.
RC = 0 Line No. :592
" IF SY-SUB
"- Constrai
g_v_cons = abap_true.
MESSAGE e041 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
EXIT.
ENDIF.
" IF UO_CST
D GT UO_CFID Line No. :757
IF uo_cstd = uo_cfid.
IF uo_cstm GT uo_cfit.
g_v_cons = abap_true.
MESSAGE e041 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
EXIT.
ENDIF.
" IF UO_CST
M GT UO_CFIT Line No. :765
ENDIF.
" IF UO_CST
D = UO_CFID Line No. :764
* ----------------------------------------------------------------------*
* --- MOD 004 end D2819 ------------------------------------------------*
* ----------------------------------------------------------------------*
IF uo_cfid IS NOT INITIAL.
IF uo_cstd IS INITIAL.
MESSAGE e051.
EXIT.
ENDIF.
D IS INITIAL Line No. :780
IF uo_cstm = space.
MESSAGE e034.
EXIT.
ENDIF.
M = SPACE Line No. :785
ENDIF.
D IS NOT INITIAL Line No. :779
IF uo_cstd IS NOT INITIAL.
IF ( uo_cstd NOT BETWEEN uo_esd AND uo_efd ) .
MESSAGE e030.
EXIT.
ENDIF.
STD NOT BETWEEN UO_ESD AND UO_EFD ) Line No. :792
IF ( uo_cfid NOT BETWEEN uo_esd AND uo_efd ).
MESSAGE e030.
EXIT.
ENDIF.
FID NOT BETWEEN UO_ESD AND UO_EFD ) Line No. :797
IF uo_cstd EQ uo_esd.
IF uo_cstm LT uo_est.
MESSAGE e031.
EXIT.
ENDIF.
M LT UO_EST Line No. :802
ENDIF.
D EQ UO_ESD Line No. :801
IF uo_cfid EQ uo_efd.
IF uo_cfit GT uo_eft.
MESSAGE e032.
EXIT.
ENDIF.
T GT UO_EFT Line No. :809
ENDIF.
D EQ UO_EFD Line No. :808
IF uo_cstd IS NOT INITIAL.
IF uo_cstm IS INITIAL.
IF uo_cstm = space.
MESSAGE e034.
g_v_cons = abap_true.
EXIT.
ENDIF.
M = SPACE Line No. :817
ENDIF.
D IS NOT INITIAL Line No. :815
" IF UO_CST
" IF UO_CST
" IF UO_CFI
" IF ( UO_C
" IF ( UO_C
" IF UO_CST
" IF UO_CST
" IF UO_CFI
" IF UO_CFI
" IF UO_CST
" IF UO_CST
IF uo_cfit = space..
MESSAGE e033.
g_v_cons = abap_true.
EXIT.
ENDIF.
T = SPACE Line No. :826
ENDIF.
D IS NOT INITIAL Line No. :824
" IF UO_CFI
" IF UO_CFI
" IF L_O_GR
EXIT.
ENDIF.
" IF UO_CST
D GT UO_CFID Line No. :835
ENDIF.
" IF UO_CST
D IS NOT INITIAL Line No. :791
*----------------------------------------------------------------------*
IF ( uo_esd
uo_arb
uo_wer
uo_beh
IS INITIAL OR
IS INITIAL OR
IS INITIAL OR
IS INITIAL ).
" IF L_O_GR
ENDIF.
" IF UO_CST
D = UO_CFID AND UO_CSTM GT UO_CFIT Line No. :861
*----------------------------------------------------------------------*
**only one entry is expected to be available in the internal table
**No subrc check as the emptiness of the table is already satisfied
READ TABLE object_tab ASSIGNING <fs_wa_objtab> INDEX g_v_index.
IF sy-subrc = 0.
* check the order is locked or not before update
CALL FUNCTION 'ENQUEUE_ESORDER'
EXPORTING
aufnr
= <fs_wa_objtab>-aufnr
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS
= 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
" IF SY-SUB
RC <> 0 Line No. :894
*----------------------------------------------------------------------*
<fs_wa_objtab>-ntanf
nt_Start 1
<fs_wa_objtab>-ntanz
nt_Start 2
<fs_wa_objtab>-ntend
t_Fin 1
<fs_wa_objtab>-ntenz
t_Fin2
<fs_wa_objtab>-v_arbpl
<fs_wa_objtab>-v_werks
e Plant
<fs_wa_objtab>-anlzu
<fs_wa_objtab>-arbei
<fs_wa_objtab>-arbeh
<fs_wa_objtab>-pernr
nginew
<fs_wa_objtab>-upd_opr
<fs_wa_objtab>-daune
ation unit
<fs_wa_objtab>-dauno
ation
= uo_cstd.
"- Constrai
= uo_cstm.
"- Constrai
= uo_cfid.
"- Contrain
= uo_cfit.
"- Contrain
= uo_arb .
= uo_wer .
"Work Centr
=
=
=
=
uo_anl .
uo_work .
uo_beh .
uo_rqe .
"Priority
"Work
"Work Unit
"Required E
= abap_true .
= uo_dae .
"Work Unit
"Normal Dur
= uo_ndu .
"Normal Dur
* ----------------------------------------------------------------------*
* --- MOD 002 27/11/2015 start change conversion back as per system ---*
* ----------------------------------------------------------------------*
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input
= <fs_wa_objtab>-daune
IMPORTING
output
= <fs_wa_objtab>-daune
EXCEPTIONS
unit_not_found = 1
OTHERS
= 2.
IF sy-subrc <> 0.
ENDIF.
RC <> 0 Line No. :926
" IF SY-SUB
" IF SY-SUB
l_wa_afvu-usr09 = uo_efd.
ish Date
l_wa_afvu-usr03 = uo_eft.
ish Time
l_wa_afvu-usr08 = uo_esd.
rt Date
l_wa_afvu-usr02 = uo_est.
" Early Sta
rt Time
*----------------------------------------------------------------------*
* ----------------------------------------------------------------------*
* --- MOD 004 D2893 start Appointment Type. ----------------------------*
* ----------------------------------------------------------------------*
IF <fs_wa_objtab>-code NE uo_code AND uo_code = 01.
MESSAGE text-360 TYPE zcl_pm_literals=>gc_message_type_s. "'Appointme
nt 01 Display only' TYPE 'S'.
EXIT.
ELSE.
" IF <FS_WA
_OBJTAB>-CODE NE UO_CODE AND UO_CODE = 01 Line No. :95
<fs_wa_objtab>-code = uo_code.
ENDIF.
" IF <FS_WA
_OBJTAB>-CODE NE UO_CODE AND UO_CODE = 01 Line No. :95
IF uo_code IS NOT INITIAL.
SELECT SINGLE kurztext FROM qpct INTO uo_appt
WHERE katalogart =
text-306
AND codegruppe
AND code
text-357
uo_code.
<fs_wa_objtab>-apptext = uo_appt.
ELSE.
" IF UO_COD
E IS NOT INITIAL Line No. :960
CLEAR: <fs_wa_objtab>-apptext.
ENDIF.
" IF UO_COD
E IS NOT INITIAL Line No. :960
* ----------------------------------------------------------------------*
* --- MOD 004 D 2893 End. ----------------------------------------------*
* ----------------------------------------------------------------------*
*----------------------------------------------------------------------*
"- Constrai
g_v_cons = abap_true.
MESSAGE e041 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
EXIT.
ENDIF.
" IF <FS_WA
_OBJTAB>-NTANF GT <FS_WA_OBJTAB>-NTEND " Line No. :975
IF <fs_wa_objtab>-ntanf = <fs_wa_objtab>-ntend.
IF <fs_wa_objtab>-ntanz GT <fs_wa_objtab>-ntenz.
g_v_cons = abap_true.
MESSAGE e041 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
EXIT.
ENDIF.
" IF <FS_WA
_OBJTAB>-NTANZ GT <FS_WA_OBJTAB>-NTENZ Line No. :983
ENDIF.
" IF <FS_WA
_OBJTAB>-NTANF = <FS_WA_OBJTAB>-NTEND Line No. :982
*----------------------------------------------------------------------*
IF ok_code = zcl_pm_literals=>gc_upd_opr .
EXIT.
ENDIF.
" IF OK_COD
E = ZCL_PM_LITERALS=>GC_UPD_OPR Line No. :993
* ----------------------------------------------------------------------*
* ----------------------------------------------------------------------*
APPEND <fs_wa_objtab> TO l_i_objtab .
* ----------------------------------------------------------------------*
* --- BEGIN OF MOD 007 -------------------------------------------------*
* ----------------------------------------------------------------------*
"get the selected record
READ TABLE object_tab[] ASSIGNING <fs_wa_objtab> INDEX g_v_index.
IF sy-subrc
"check is
IF p_code
jir
bi
IS INITIAL.
there any change in the value
<> <fs_wa_objtab>-pspel
OR
<> <fs_wa_objtab>-jobimdrsk OR
<> <fs_wa_objtab>-busimpt.
ENDIF.
RC <> 0 Line No. :1024
ENDIF.
<> <FS_WA_OBJTAB>-PSPEL Line No. :1015
" IF SY-SUB
" IF P_CODE
" IF SY-SUB
" IF JIR <>
" IF SY-SUB
ENDIF.
<FS_WA_OBJTAB>-BUSIMPT Line No. :1051
" IF BI <>
" IF SY-SUB
l_v_qmanum = 1.
ENDIF.
RC IS INITIAL Line No. :1085
" IF SY-SUB
" IF SY-SUB
l_v_manum = 1.
ENDIF.
RC IS INITIAL Line No. :1100
" IF SY-SUB
" IF SY-SUB
l_v_fenum = 1.
ENDIF.
RC IS INITIAL Line No. :1115
" IF SY-SUB
" IF SY-SUB
l_v_manum = l_v_manum + 1.
l_v_qmanum = l_v_qmanum + 1.
APPEND INITIAL LINE TO l_i_notifactv_cr ASSIGNING <l_fs_notifact
v>.
<l_fs_notifactv>-item_sort_no
<l_fs_notifactv>-act_sort_no
<l_fs_notifactv>-act_key
<l_fs_notifactv>-act_code
<l_fs_notifactv>-act_codegrp
=
=
=
=
=
l_v_fenum.
l_v_qmanum.
l_v_manum.
l_v_code_jir.
text-347.
ENDIF.
RC IS INITIAL Line No. :1132
" IF SY-SUB
" IF SY-SUB
l_v_manum = l_v_manum + 1.
l_v_qmanum = l_v_qmanum + 1.
APPEND INITIAL LINE TO l_i_notifactv_cr ASSIGNING <l_fs_notifa
ctv>.
<l_fs_notifactv>-item_sort_no
<l_fs_notifactv>-act_sort_no
<l_fs_notifactv>-act_key
<l_fs_notifactv>-act_code
<l_fs_notifactv>-act_codegrp
=
=
=
=
=
l_v_fenum.
l_v_qmanum.
l_v_manum.
l_v_code_bi.
text-346.
ENDIF.
RC IS INITIAL Line No. :1169
ENDIF.
DE_BI IS NOT INITIAL Line No. :1164
" IF SY-SUB
" IF L_V_CO
" IF CODE G
l_v_manum = l_v_manum + 1.
l_v_qmanum = l_v_qmanum + 1.
APPEND INITIAL LINE TO l_i_notifactv_cr ASSIGNING <l_fs_notifa
ctv>.
<l_fs_notifactv>-item_sort_no
<l_fs_notifactv>-act_sort_no
<l_fs_notifactv>-act_key
<l_fs_notifactv>-act_code
<l_fs_notifactv>-act_codegrp
=
=
=
=
=
l_v_fenum.
l_v_qmanum.
l_v_manum.
l_v_code_pcode.
text-362.
ENDIF.
ROUP ALREADY EXIST UPDATE IT IF SY-SUBRC IS INITIAL Li
ENDIF.
DE_PCODE IS NOT INITIAL Line No. :1203
" IF CODE G
" IF L_V_CO
'BAPI_ALM_NOTIF_DATA_ADD'
= l_v_qmnum
= l_i_notifactv_cr
= l_i_return.
ENDIF.
REATE IS NOT INITIAL Line No. :1242
" IF L_FL_C
" IF L_FL_C
" IF SY-SUB
" IF SY-SUB
ENDIF.
DE_JIR IS NOT INITIAL Line No. :1127
CLEAR :l_i_notifactv,l_i_notifactv_x,l_i_notifactv_cr.
ENDIF.
<> <FS_WA_OBJTAB>-PSPEL OR JIR <> <FS_WA_OBJT Line No
" IF L_V_CO
" IF SY-SUB
**
"Begin of Change
*** added defect 3080 to check constrain dates are within the
.
*** validation check and give waring messsage only.
**
LOOP AT g_i_prt ASSIGNING <fs_l_wa_prt> WHERE aufnr
ufnr
AND aufpl
ufpl
AND vornr
ornr.
" IF P_CODE
= <fs_wa_objtab>-a
= <fs_wa_objtab>-a
= <fs_wa_objtab>-v
) .
MESSAGE s042 .
ENDIF.
L_WA_PRT>-ZZPRT_AVB_F_DAT NOT BETWEEN UO_ESD AND UO Li
IF ( <fs_l_wa_prt>-zzprt_avb_t_dat
" IF ( <FS_
).
MESSAGE s042 .
ENDIF.
L_WA_PRT>-ZZPRT_AVB_T_DAT NOT BETWEEN UO_ESD AND UO Li
" IF ( <FS_
IF <fs_l_wa_prt>-zzprt_avb_f_dat EQ uo_esd.
IF <fs_l_wa_prt>-zzprt_avb_f_tim LT uo_est.
MESSAGE s042 .
ENDIF.
WA_PRT>-ZZPRT_AVB_F_TIM LT UO_EST Line No. :1339
ENDIF.
WA_PRT>-ZZPRT_AVB_F_DAT EQ UO_ESD Line No. :1338
" IF <FS_L_
" IF <FS_L_
IF <fs_l_wa_prt>-zzprt_avb_t_dat EQ uo_efd.
IF <fs_l_wa_prt>-zzprt_avb_t_tim GT uo_eft.
MESSAGE s042.
ENDIF.
WA_PRT>-ZZPRT_AVB_T_TIM
ENDIF.
WA_PRT>-ZZPRT_AVB_T_DAT
ENDIF.
WA_PRT>-ZZPRT_AVB_F_DAT
ENDLOOP.
_I_PRT Line No. :1318
*** end of add by kiran
" IF <FS_L_
GT UO_EFT Line No. :1347
" IF <FS_L_
EQ UO_EFD Line No. :1346
" IF <FS_L_
IS NOT INITIAL OR <FS_L_WA_PR
" LOOP AT G
MOD 007
ENDIF.
RC IS INITIAL Line No. :1009
" IF SY-SUB
* ----------------------------------------------------------------------*
* --- END OF MOD 007 ---------------------------------------------------*
* ----------------------------------------------------------------------*
**Update Operation data
**Update only custom fields in AFVC
CLEAR: l_i_return.
REFRESH: l_i_return.
*----------------------------------------------------------------------*
CALL METHOD zcl_pme208_tech_pln_wb=>meth_stat_pub_upd_opr
EXPORTING
im_upd_opr
= abap_true
im_pers_no
= l_v_upd_per
im_t_obj_tab = l_i_objtab
im_workcenter = abap_true
im_estd
= l_wa_afvu-usr09
im_estt
= l_wa_afvu-usr03
im_efnd
= l_wa_afvu-usr08
im_efnt
= l_wa_afvu-usr02
IMPORTING
ex_return_tab = l_i_return.
*----------------------------------------------------------------------*
**No binary search as the table would have less than 10 records
READ TABLE l_i_return ASSIGNING <fs_wa_return>
WITH KEY type = zcl_pm_literals=>gc_message_type_e
.
*----------------------------------------------------------------------*
**Error returned
IF sy-subrc = 0.
" IF SY-SUB
" IF SY-SUB
MESSAGE s058.
**Update the output display
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_o_gridref.
IF l_o_gridref IS NOT INITIAL.
CALL METHOD l_o_gridref->check_changed_data.
ENDIF.
" IF L_O_GR
IDREF IS NOT INITIAL Line No. :1467
ENDIF.
" IF SY-SUB
RC = 0 Line No. :1388
*----------------------------------------------------------------------*
* release the order
CALL FUNCTION 'DEQUEUE_ESORDER'
EXPORTING
aufnr = <fs_wa_objtab>-aufnr.
*----------------------------------------------------------------------*
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input
= <fs_wa_objtab>-daune
IMPORTING
output
= <fs_wa_objtab>-daune
EXCEPTIONS
unit_not_found = 1
OTHERS
= 2.
uo_dae = <fs_wa_objtab>-daune .
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input
= <fs_wa_objtab>-arbeh
IMPORTING
output
= <fs_wa_objtab>-arbeh
EXCEPTIONS
unit_not_found = 1
OTHERS
= 2.
uo_beh
= <fs_wa_objtab>-arbeh
" IF R_GRID
" IF SY-SUB
" IF R_GRID
WHEN zcl_pm_literals=>gc_act_cancel.
" CASE OK_C
ODE "SY-UCOMM Line No. :582
WHEN 'CAN2' .
" CASE OK_C
ODE "SY-UCOMM Line No. :582
EXIT.
*----------------------------------------------------------------------*
WHEN OTHERS.
" CASE OK_C
ODE "SY-UCOMM Line No. :582
*----------------------------------------------------------------------*
* check the early start date is grater then early finsh date
* check the early start time is grater then early finsh time
* check the early Last date is grater then Last finsh date
* check the early Last time is grater then Last finsh time
IF ( uo_esd IS INITIAL OR
uo_arb IS INITIAL OR
* ----------------------------------------------------------------------*
* --- MOD 003 Delect constrain start and finish from condition ---------*
* ----------------------------------------------------------------------*
*
uo_cstd IS INITIAL OR
*
uo_cfid IS INITIAL OR
* -----------------------------------------------------------------------*
uo_wer IS INITIAL OR
uo_beh IS INITIAL ).
* MOD 001
*
l_wa_msg-string = text-299.
*
APPEND l_wa_msg TO g_i_msg .
MESSAGE text-299 TYPE zcl_pm_literals=>gc_message_type_i
DISPLAY LIKE zcl_pm_literals=>gc_message_type_e.
* MOD 001
IF l_o_grid_msg IS NOT INITIAL.
CALL METHOD l_o_grid_msg->refresh_table_display.
ENDIF.
ID_MSG IS NOT INITIAL Line No. :1554
ENDIF.
SD IS INITIAL OR UO_ARB IS INITIAL OR * ----------- Li
ENDCASE.
ODE "SY-UCOMM Line No. :582
" IF L_O_GR
" IF ( UO_E
" CASE OK_C
* ----------------------------------------------------------------------*
* --- MOD 012 start --------------------------------------------------*
* ----------------------------------------------------------------------*
CLEAR:l_i_rowindex[].
APPEND INITIAL LINE TO l_i_rowindex ASSIGNING <fs_rowindex>.
<fs_rowindex>-index = g_v_index.
CALL METHOD r_grid->set_selected_rows
EXPORTING
it_index_rows = l_i_rowindex.
* ----------------------------------------------------------------------*
* --- MOD 012end --------------------------------------------------*
* ----------------------------------------------------------------------*
CLEAR:sy-ucomm.
ENDMODULE.
"user_comma
nd_2004 INPUT
*&---------------------------------------------------------------------*
*&
Module F4_UO_RQE INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE f4_uo_rqe INPUT.
"types
TYPES: BEGIN OF l_ty_arbpl,
objty LIKE crhd-objty,
es of the CIM resource
objid LIKE crhd-objid,
of the resource
arbpl LIKE crhd-arbpl,
r
werks LIKE crhd-werks,
END OF l_ty_arbpl,
BEGIN OF l_ty_pernr,
pernr TYPE pernr_d,
"Object typ
"Object ID
"Work cente
"Plant
"Personnel
Number
emnam TYPE emnam,
Name of Employee or Applicant
arbpl LIKE crhd-arbpl,
r
werks LIKE crhd-werks,
END OF l_ty_pernr.
"Formatted
"Work cente
"Plant
"data declaration
DATA :l_i_object
TYPE TABLE OF rcrid,
object work center or capacity
l_i_pernr
TYPE TABLE OF l_ty_pernr,
l_i_arbpl
TYPE TABLE OF l_ty_arbpl,
l_i_returntab TYPE TABLE OF ddshretval,
Structure Search Help <-> Help System
l_i_person
TYPE TABLE OF object_person_assignment,
a person to an object
l_r_arbpl
TYPE RANGE OF arbpl,
r
l_r_werks
TYPE RANGE OF werks_d.
"field sympols
FIELD-SYMBOLS :<l_fs_returntab> TYPE
Structure Search Help <-> Help System
<l_fs_person>
TYPE
a person to an object
<l_fs_pernr>
TYPE
<l_fs_arbpl>
TYPE
<l_fs_arbpl_r> LIKE
<l_fs_werks_r> LIKE
"Logistics
"
"
"Interface
"Asssigning
"Work cente
"Plant
ddshretval,
"Interface
object_person_assignment,
"Asssigning
l_ty_pernr,
l_ty_arbpl,
LINE OF l_r_arbpl,
LINE OF l_r_werks.
"
"
"
"
" IF UO_ARB
" IF UO_WER
" IF SY-SUB
"/ no value
ENDIF.
RC = 1 Line No. :1677
" IF SY-SUB
CLEAR l_i_pernr.
"populate the final table
LOOP AT l_i_person ASSIGNING <l_fs_person>.
"get the employee work center and palnt
READ TABLE l_i_arbpl ASSIGNING <l_fs_arbpl> WITH KEY objty = zcl_pm_literal
s=>gc_objty_a
objid = <l_fs_person>arbid
BINARY SEARCH.
IF sy-subrc IS INITIAL.
APPEND INITIAL LINE TO l_i_pernr ASSIGNING <l_fs_pernr>.
<l_fs_pernr>-arbpl = <l_fs_arbpl>-arbpl.
<l_fs_pernr>-werks = <l_fs_arbpl>-werks.
<l_fs_pernr>-pernr = <l_fs_person>-pernr.
<l_fs_pernr>-emnam = <l_fs_person>-stext.
ENDIF.
RC IS INITIAL Line No. :1695
" IF SY-SUB
ENDLOOP.
_I_PERSON Line No. :1687
" LOOP AT L
CLEAR :l_i_returntab.
"CALL THE SEARCH HELP
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield
= zcl_pme208_tech_pln_wb=>gc_pme208_pernr
_TECH_PLN_WB=>GC_PME208_PERNR => 'PERNR'
dynpprog
= sy-repid
dynpnr
= sy-dynnr
dynprofield
= zcl_pme208_tech_pln_wb=>gc_pme208_scr_rqe
_TECH_PLN_WB-GC_PME208_SCR_ARB => 'UO_RQE'
value_org
= zcl_pm_literals=>gs_seconds_s
TABLES
value_tab
= l_i_pernr
return_tab
= l_i_returntab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS
= 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
RC <> 0 Line No. :1724
"ZCL_PME208
"ZCL_PME208
" IF SY-SUB
" IF SY-SUB
ENDMODULE.
INPUT
" F4_UO_RQE
*&---------------------------------------------------------------------*
*&
Module F4_UO_ARB INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE f4_uo_arb INPUT.
"types
TYPES: BEGIN OF l_ty_crhd,
arbpl TYPE arbpl,
"Work cente
r
werks TYPE werks_d,
verwe TYPE ap_verwe,
"Plant
"Work Cente
r Category
END OF l_ty_crhd.
"data declaration
DATA :l_i_crhd
REFRESH l_r_werks.
"populate the plant value in screen
IF uo_wer IS NOT INITIAL.
"
" IF UO_WER
"Search hel
"Descriptio
uo_arb = <l_fs_returntab>-fieldval.
ENDIF.
RC IS INITIAL Line No. :1809
" IF SY-SUB
ENDMODULE.
INPUT
" F4_UO_ARB
*&---------------------------------------------------------------------*
*&
Form F4CALLBACK
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->RECORD_TAB text
*
<--SHLP
text
*
<--CALLCONTROL text
*----------------------------------------------------------------------*
FORM f4callback
TABLES record_tab STRUCTURE seahlpres
CHANGING shlp
TYPE shlp_descr
callcontrol LIKE ddshf4ctrl.
DATA: interface LIKE LINE OF shlp-interface.
DATA: l_wa_selop TYPE ddshselopt.
"Selection
options for value selection with search help
interface-valtabname = zcl_pme208_tech_pln_wb=>gc_pme208_dynp.
interface-valfield = zcl_pme208_tech_pln_wb=>gc_pme208_field.
MODIFY shlp-interface FROM interface
TRANSPORTING valtabname valfield
WHERE shlpfield = zcl_pme208_tech_pln_wb=>gc_pme208_add.
L'.
l_wa_selop-low
= uo_wer.
l_wa_selop-shlpfield = zcl_pme208_tech_pln_wb=>gc_pme208_f002.
l_wa_selop-shlpname = zcl_pme208_tech_pln_wb=>gc_pme208_tilt.
l_wa_selop-sign
= zcl_pm_literals=>gc_sign_i.
l_wa_selop-option
= zcl_pm_literals=>gc_option_eq.
APPEND l_wa_selop TO shlp-selopt.
ENDFORM.
LLBACK Line No. :1826
" FORM F4CALLBACK Line
"'DYNP'.
"'FELD'.
"'ADDITIONA
"'F0002'.
"'~'.