Sie sind auf Seite 1von 36

*-----------------------------------------------------------------------*

*&---------------------------------------------------------------------*
*&
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

l_v_nachn TYPE nachn,


l_v_cal
TYPE fabkl,

" last name


" Factory C

l_v_last_d TYPE fsedd,

"Early Fini

l_v_last_t TYPE fsedz,

"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.

" Order Num

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

* ----------------------------------------------------------------------*

* --- MOD 004 D 2893 End. ----------------------------------------------*


* ----------------------------------------------------------------------*
* ----------------------------------------------------------------------*
* --- MOD 005 Start 29/02/2016. Conver the units. interanl to external. *
* ----------------------------------------------------------------------*
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.
IF sy-subrc <> 0.
*
implement suitable error handling here
ENDIF.
RC <> 0 Line No. :140
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.
IF sy-subrc <> 0.
*
implement suitable error handling here
ENDIF.
RC <> 0 Line No. :152

*
*
*
*
*
*
*

" 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.

" Early Sta

uo_efd = l_wa_afvu-usr09.

" Early Fin

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

***** END: Select Data From afvu **************************************


IF g_v_cons = abap_false.
uo_cstd = <fs_wa_objtab>-ntanf.
"- Constrai
nt_Start 1
uo_cstm = <fs_wa_objtab>-ntanz.
"- Constrai
nt_Start 2
uo_cfid = <fs_wa_objtab>-ntend.
"- Contrain
t_Fin 1
uo_cfit = <fs_wa_objtab>-ntenz.
"- Contrain
t_Fin2
ENDIF.
" IF G_V_CO
NS = ABAP_FALSE Line No. :297
uo_rqe = <fs_wa_objtab>-pernr.
Engineer

" Required_

* Mod 011 start


Defect 3914 get the SLA Intal start date from change log wh
ile the record created first time.
* ----------------------------------------------------------------------*
* --- Internal Tables and Variables -----------------------------------*
* ----------------------------------------------------------------------*
DATA: l_v_obj_id
TYPE cdhdr-objectid,
"Object val
ue
l_v_tabkey
TYPE cdpos-tabkey VALUE ' ',
" Comments
l_i_editpos_temp TYPE TABLE OF cdred,
"
l_i_editpos_tem1 TYPE TABLE OF cdred,
"
i_history
TYPE cdred_str_tab,
" Comments
l_v_autype
TYPE aufk-autyp,
"Order cate
gory
l_v_time
TYPE char10,
"Earliest s
cheduled start: Execution (time)
l_v_date_external TYPE string,
"
l_v_date_internal TYPE string.
"
FIELD-SYMBOLS: <l_fs_history> TYPE cdred.
" Comme
**Get order header data
SELECT SINGLE autyp FROM aufk INTO l_v_autype WHERE aufnr = <fs_wa_objtab>
-aufnr
AND auart = <fs_wa_objtab>auart.
IF sy-subrc = 0.
* ----------------------------------------------------------------------*

* --- 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.

" SLA Start

= l_wa_afvu-usr03.

" SLA Start

= l_wa_afvu-usr09.

" SLA Finis

= l_wa_afvu-usr03.

" SLA Finis

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.

CALL METHOD r_grid->set_selected_rows


EXPORTING
it_index_rows = l_i_rowindex.
* ----------------------------------------------------------------------*
* --- MOD 012 end --------------------------------------------------*
* ----------------------------------------------------------------------*
ENDMODULE.
"status_200
4 OUTPUT
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND_2004 INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
MODULE user_command_2004 INPUT.
*----------------------------------------------------------------------*
TYPES : BEGIN OF l_ty_qmma,
manum TYPE aknum,
"Consecutiv
e Number of Activity
fenum TYPE felfd,
"Item Numbe
r in Item Record
mngrp TYPE mfgrp,
"Code Group
- Activities
qmanum TYPE qmanum,
"Sort Numbe
r for Activity
END OF l_ty_qmma.
DATA :l_i_qmma
TYPE TABLE OF
l_i_notifactv
TYPE TABLE OF
on activity for creation
l_i_notifactv_cr TYPE TABLE OF
on activity for creation
l_i_notifactv_x TYPE TABLE OF
s Activities work structure for change
l_i_notifheader TYPE TABLE OF
ce Notification Header for creation
l_v_qmnum
TYPE qmnum,
on No
l_fl_create
TYPE flag,
ag
l_fl_change
TYPE flag,
ag
l_v_code_pcode TYPE mfcod,
ode
l_v_code_bi
TYPE mfcod,
ode
l_v_code_jir
TYPE mfcod,
ode "General Flagl_v_manum
TYPE numc4,
meters
l_v_fenum
TYPE numc4,
meters
l_v_qmanum
TYPE numc4,
meters
l_v_message
TYPE natxt.
xt

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

DATA: l_wa_return TYPE bapiret2.


ameter
DATA: l_v_upd_per TYPE flag.
ag
FIELD-SYMBOLS: <l_fs_qmma>
TYPE
<l_fs_return>
TYPE
ameter
<l_fs_notifactv> TYPE
on activity for creation
<l_fs_notifactv_x> TYPE
s Activities work structure for change

"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.

" CASE OK_C

*----------------------------------------------------------------------*
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 the pernr is old perner no need to update pernr.


IF <fs_wa_objtab>-pernr NE uo_rqe.
l_v_upd_per = abap_true.
ELSE.
_OBJTAB>-PERNR NE UO_RQE Line No. :616
l_v_upd_per = abap_false.
ENDIF.

" IF <FS_WA
" IF <FS_WA

_OBJTAB>-PERNR NE UO_RQE Line No. :616


* ----------------------------------------------------------------------*
* --- * MOD 010 D3773 END 07/04/2016 ---*
* ----------------------------------------------------------------------*
*----------------------------------------------------------------------*
CLEAR: l_v_last_d,l_v_last_t,l_v_unit,l_v_dura.
* Pass early satr date and time to method to get new finsh time and date
l_v_last_d = uo_esd.
"Early Star
t Date
l_v_last_t = uo_est.
"Early Star
t Time
l_v_unit = uo_dae .
"Normal Dur
ation unit
l_v_dura = uo_ndu .
"Normal Dur
ation
*----------------------------------------------------------------------*
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input
= l_v_unit
IMPORTING
output
= l_v_unit
EXCEPTIONS
unit_not_found = 1
OTHERS
= 2.
IF sy-subrc <> 0.
ENDIF.
" IF SY-SUB
RC <> 0 Line No. :641
* ----------------------------------------------------------------------*
* --- 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. :649
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

"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)

* Operation is already 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

MESSAGE i024 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.


* MOD 001
EXIT.
ENDIF.
" IF <FS_WA
_OBJTAB>-V_STTXT CS ZCL_PM_LITERALS=>GC_STAT_TECO Line
*----------------------------------------------------------------------*
*3 Don t release a TECO operation
* Operation is not technically Completed (Operation System Status is not TECO)
* Operation is already TECO
It cannot be released.
IF <fs_wa_objtab>-v_sttxt CS zcl_pm_literals=>gc_stat_teco .
* Operation is already TECO It cannot be updated
* MOD 001
*
MESSAGE i025 INTO l_wa_msg-string.
*
APPEND l_wa_msg TO g_i_msg .
MESSAGE i025 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
EXIT.
ENDIF.
_OBJTAB>-V_STTXT CS ZCL_PM_LITERALS=>GC_STAT_TECO Line

" IF <FS_WA

ENDIF.
RC = 0 Line No. :592

" IF SY-SUB

* Mod 007 Defect 3080


IF uo_cstd GT uo_cfid.
nt_Start 1

"- 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_cfid IS NOT INITIAL.


IF uo_cfit IS INITIAL.

" 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 UO_CSTD IS NOT INITIAL Line No. :501


* Constraint Start is before Constraint Finish
IF uo_cstd GT uo_cfid .
g_v_cons = abap_true.
MESSAGE text-283 TYPE zcl_pm_literals=>gc_message_type_i DISPLAY LIKE
zcl_pm_literals=>gc_message_type_s.
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. :841

" 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 ).

MESSAGE text-358 TYPE


zcl_pm_literals=>gc_message_type_i DISPLAY LIKE zcl_pm_literals=>gc_mes
sage_type_e.
EXIT.
ENDIF.
" IF ( UO_E
SD IS INITIAL OR UO_ARB IS INITIAL OR UO_WER IS IN Lin
*----------------------------------------------------------------------*
IF uo_cstd = uo_cfid AND
uo_cstm GT uo_cfit .
g_v_cons = abap_true.
l_wa_msg-string = text-289.
APPEND l_wa_msg TO g_i_msg .
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. :869

" IF L_O_GR

MESSAGE text-290 TYPE zcl_pm_literals=>gc_message_type_i


DISPLAY LIKE zcl_pm_literals=>gc_message_type_e.
EXIT.

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

* Work involved in the activity


CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input
= <fs_wa_objtab>-arbeh
IMPORTING
output
= <fs_wa_objtab>-arbeh
EXCEPTIONS
unit_not_found = 1
OTHERS
= 2.
IF sy-subrc <> 0.
ENDIF.
RC <> 0 Line No. :940

" IF SY-SUB

l_wa_afvu-usr09 = uo_efd.

" Early Fin

ish Date
l_wa_afvu-usr03 = uo_eft.

" Early Fin

ish Time
l_wa_afvu-usr08 = uo_esd.

" Early Sta

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. ----------------------------------------------*
* ----------------------------------------------------------------------*
*----------------------------------------------------------------------*

* Mod 007 Defect 3080


IF <fs_wa_objtab>-ntanf GT <fs_wa_objtab>-ntend.
nt_Start 1

"- 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.

"validate the input for project code


IF p_code <> <fs_wa_objtab>-pspel.
SELECT SINGLE code
FROM qpct INTO l_v_code_pcode
WHERE katalogart = text-306
AND codegruppe = text-362
AND kurztext = p_code.
IF sy-subrc <> 0.
CLEAR p_code.
MESSAGE e047 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.

ENDIF.
RC <> 0 Line No. :1024
ENDIF.
<> <FS_WA_OBJTAB>-PSPEL Line No. :1015

" IF SY-SUB
" IF P_CODE

"validate the input for th job immediate risk


IF jir <> <fs_wa_objtab>-jobimdrsk .
SELECT SINGLE code
FROM qpct INTO l_v_code_jir
WHERE katalogart = text-306
AND codegruppe = text-347
AND kurztext = jir.
IF sy-subrc <> 0.
CLEAR jir.
MESSAGE e048 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
ENDIF.
RC <> 0 Line No. :1042
ENDIF.
<FS_WA_OBJTAB>-JOBIMDRSK Line No. :1033

" IF SY-SUB
" IF JIR <>

"validate the business impact


IF bi <> <fs_wa_objtab>-busimpt.
SELECT SINGLE code
FROM qpct INTO l_v_code_bi
WHERE katalogart = text-306
AND codegruppe = text-346
AND kurztext = bi.
IF sy-subrc <> 0.
CLEAR bi.
MESSAGE e049 DISPLAY LIKE zcl_pm_literals=>gc_message_type_s.
ENDIF.
RC <> 0 Line No. :1059

" IF SY-SUB

ENDIF.
<FS_WA_OBJTAB>-BUSIMPT Line No. :1051

" IF BI <>

"pass the notification no


l_v_qmnum = <fs_wa_objtab>-qmnum.
"get activity details
SELECT manum
fenum
mngrp
qmanum
FROM qmma
INTO TABLE l_i_qmma
WHERE qmnum = l_v_qmnum.
"GET THE LAST SORT NO
SORT l_i_qmma BY qmanum DESCENDING.

READ TABLE l_i_qmma ASSIGNING <l_fs_qmma> INDEX 1.


IF sy-subrc IS INITIAL.
l_v_qmanum = <l_fs_qmma>-qmanum.
ELSE.
RC IS INITIAL Line No. :1085

" IF SY-SUB

l_v_qmanum = 1.
ENDIF.
RC IS INITIAL Line No. :1085

" IF SY-SUB

"GET THE LAST ACTIVITY NO


SORT l_i_qmma BY manum DESCENDING.
READ TABLE l_i_qmma ASSIGNING <l_fs_qmma> INDEX 1.
IF sy-subrc IS INITIAL.
l_v_manum = <l_fs_qmma>-manum.
ELSE.
RC IS INITIAL Line No. :1100

" IF SY-SUB

l_v_manum = 1.
ENDIF.
RC IS INITIAL Line No. :1100

" IF SY-SUB

"GET THE LAST ITEM NO


SORT l_i_qmma BY fenum .
READ TABLE l_i_qmma ASSIGNING <l_fs_qmma> INDEX 1.
IF sy-subrc IS INITIAL.
l_v_fenum = <l_fs_qmma>-fenum.
ELSE.
RC IS INITIAL Line No. :1115

" IF SY-SUB

l_v_fenum = 1.
ENDIF.
RC IS INITIAL Line No. :1115

" IF SY-SUB

SORT l_i_qmma BY mngrp.


"populate the new value of JIR to the bapi
IF l_v_code_jir IS NOT INITIAL.
READ TABLE l_i_qmma ASSIGNING <l_fs_qmma> WITH KEY mngrp = text-34
7 BINARY SEARCH.
IF sy-subrc IS INITIAL.
"IF CODE GROUP ALREADY EXIST UPDATE IT
l_fl_change = abap_true.

APPEND INITIAL LINE TO l_i_notifactv ASSIGNING <l_fs_notifactv>.


<l_fs_notifactv>-act_key
= <l_fs_qmma>-manum.
<l_fs_notifactv>-act_sort_no = <l_fs_qmma>-qmanum.
<l_fs_notifactv>-act_code
= l_v_code_jir.
APPEND INITIAL LINE TO l_i_notifactv_x ASSIGNING <l_fs_notifactv
_x>.
<l_fs_notifactv_x>-act_key = <l_fs_qmma>-manum.
<l_fs_notifactv_x>-act_code = abap_true.
ELSE.
RC IS INITIAL Line No. :1132
"CODE GRUOUP not exist add a new activity
l_fl_create = abap_true.

" 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

"POPULATE THE NEW VALUE OF BUSINESS IMPACT TO BAPI


IF l_v_code_bi IS NOT INITIAL.
READ TABLE l_i_qmma ASSIGNING <l_fs_qmma> WITH KEY mngrp = text346 BINARY SEARCH.
IF sy-subrc IS INITIAL.
"IF CODE GROUP ALREADY EXIST UPDATE IT
l_fl_change = abap_true.
APPEND INITIAL LINE TO l_i_notifactv ASSIGNING <l_fs_notifactv
>.
<l_fs_notifactv>-act_key
= <l_fs_qmma>-manum.
<l_fs_notifactv>-act_sort_no = <l_fs_qmma>-qmanum.
<l_fs_notifactv>-act_code
= l_v_code_bi.
APPEND INITIAL LINE TO l_i_notifactv_x ASSIGNING <l_fs_notifac
tv_x>.
<l_fs_notifactv_x>-act_key = <l_fs_qmma>-manum.
<l_fs_notifactv_x>-act_code = abap_true.
ELSE.
RC IS INITIAL Line No. :1169
"CODE GRUOUP not exist add a new activity
l_fl_create = abap_true.

" 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

"POPULATE THE PROJECT CODE TO BABI


IF l_v_code_pcode IS NOT INITIAL.
READ TABLE l_i_qmma ASSIGNING <l_fs_qmma> WITH KEY mngrp = text362 BINARY SEARCH.
"IF CODE GROUP ALREADY EXIST UPDATE IT
IF sy-subrc IS INITIAL.
l_fl_change = abap_true.
APPEND INITIAL LINE TO l_i_notifactv ASSIGNING <l_fs_notifactv
>.
<l_fs_notifactv>-act_key
= <l_fs_qmma>-manum.
<l_fs_notifactv>-act_sort_no = <l_fs_qmma>-qmanum.
<l_fs_notifactv>-act_code
= l_v_code_pcode.
APPEND INITIAL LINE TO l_i_notifactv_x ASSIGNING <l_fs_notifac
tv_x>.
<l_fs_notifactv_x>-act_key = <l_fs_qmma>-manum.
<l_fs_notifactv_x>-act_code = abap_true.
ELSE.
ROUP ALREADY EXIST UPDATE IT IF SY-SUBRC IS INITIAL Li
"CODE GRUOUP not exist add a new activity
l_fl_create = abap_true.

" 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

"add the new activity


IF l_fl_create IS NOT INITIAL.
CALL FUNCTION
EXPORTING
number
TABLES
notifactv
return

'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

"update the existing activity


IF l_fl_change IS NOT INITIAL.
CALL FUNCTION 'BAPI_ALM_NOTIF_DATA_MODIFY'
EXPORTING
number
= l_v_qmnum
TABLES
notifactv = l_i_notifactv
notifactv_x = l_i_notifactv_x
return
= l_i_return.
ENDIF.
HANGE IS NOT INITIAL Line No. :1255

" IF L_FL_C

READ TABLE l_i_return ASSIGNING <l_fs_return> WITH KEY type = zcl_


pm_literals=>gc_message_type_e.
IF sy-subrc <> 0.
CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
EXPORTING
number = l_v_qmnum
TABLES
return = l_i_return.
" check if return parameter from notification save BAPI has erro
r message(s).
READ TABLE l_i_return ASSIGNING <l_fs_return> WITH KEY type = zc
l_pm_literals=>gc_message_type_e.
IF sy-subrc <> 0.
" if return parameter from notification save BAPI has no error
s, call this BAPI
" This method executes a COMMIT WORK command to write the chan
ges to the database.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true
IMPORTING
return = l_wa_return.

"update the alv table


<fs_wa_objtab>-jobimdrsk = jir.
<fs_wa_objtab>-busimpt = bi.
<fs_wa_objtab>-pspel
= p_code.
CLEAR :l_v_code_bi, l_v_code_jir,l_v_code_pcode.
ELSE.
RC <> 0 Line No. :1281

" IF SY-SUB

" call rollback function if create notification has errors.


CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
return = l_wa_return.
ENDIF.
RC <> 0 Line No. :1281
ENDIF.
RC <> 0 Line No. :1270

" 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

Early start or not

= <fs_wa_objtab>-a
= <fs_wa_objtab>-a
= <fs_wa_objtab>-v

IF <fs_l_wa_prt>-zzprt_avb_f_dat IS NOT INITIAL OR


<fs_l_wa_prt>-zzprt_avb_t_dat IS NOT INITIAL.
IF ( <fs_l_wa_prt>-zzprt_avb_f_dat

NOT BETWEEN uo_esd AND uo_efd

) .
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_

NOT BETWEEN uo_esd AND uo_efd

).
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.

MESSAGE <fs_wa_return>-message TYPE zcl_pm_literals=>gc_message_type_e


DISPLAY LIKE zcl_pm_literals=>gc_message_type_e.
ELSE.
" IF SY-SUB
RC = 0 Line No. :1388
* ----------------------------------------------------------------------*
* --- MOD 012 start --------------------------------------------------*
* ----------------------------------------------------------------------*
CLEAR: l_i_return_tab[].
UNASSIGN: <fs_wa_return_tab>,<fs_wa_objtab>.
**Dispatch ZM06 operation is the status of the order is REL and user status is R
AOP
READ TABLE object_tab ASSIGNING <fs_wa_objtab> INDEX g_v_index.
IF sy-subrc EQ 0 AND
<fs_wa_objtab>-steus EQ zcl_pm_literals=>gc_cntrlkey_zm06 AND
<fs_wa_objtab>-sttxt CS zcl_pm_literals=>gc_stat_rel AND
<fs_wa_objtab>-v_ustxt CS zcl_pm_literals=>gc_raop AND
<fs_wa_objtab>-pernr IS NOT INITIAL.
**Call method to create confirmation in SAP with reason code DISP
CALL METHOD zcl_pme208_tech_pln_wb=>meth_stat_pub_crt_conf
EXPORTING
im_reason
= zcl_pme208_tech_pln_wb=>gc_pme208_disp
"DISP
im_s_date
= sy-datum
im_s_time
= sy-uzeit
im_f_date
= sy-datum
im_f_time
= sy-uzeit
im_pernr
= <fs_wa_objtab>-pernr
IMPORTING
ex_return
= l_i_return_tab
CHANGING
ch_t_obj_tab = l_i_objtab.
* ----------------------------------------------------------------------*
* --- MOD 012 end --------------------------------------------------*
* ----------------------------------------------------------------------*
**No binary search as the table would have less than 10 records
READ TABLE l_i_return_tab ASSIGNING <fs_wa_return_tab>
WITH KEY type = zcl_pm_literals=>gc_messag
e_type_e.
*----------------------------------------------------------------------*
IF sy-subrc NE 0.
**Commit the updates
CALL METHOD zcl_pme208_tech_pln_wb=>meth_stat_pub_commit
CHANGING
ch_t_obj_tab = l_i_objtab
EXCEPTIONS
commit_failed = 1
OTHERS
= 2.
*----------------------------------------------------------------------*
IF sy-subrc <> 0.

**Not all operations are updated


* MOD 001
MESSAGE e000 DISPLAY LIKE zcl_pm_literals=>gc_message_type_e.
ENDIF.
" IF SY-SUB
RC <> 0 Line No. :1444
*----------------------------------------------------------------------*
ELSE.
" IF SY-SUB
RC NE 0 Line No. :1433
**Selected operation not dispatched successfully
MESSAGE <fs_wa_return_tab>-message TYPE zcl_pm_literals=>gc_messag
e_type_e
DISPLAY LIKE zcl_pm_literals=>gc_message_type_e.
ENDIF.
RC NE 0 Line No. :1433
ENDIF.
RC EQ 0 AND <FS_WA_OBJTAB>-STEUS EQ ZCL_PM_LITERALS=>

" 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

* MOD 008 D3529 Update the Early start in ALV.


*--- Refresh
object_tab_final[] = object_tab[].
dded refresh data to update final table to use later
PERFORM refresh_f30 USING l_wa_selfield.
IF r_grid IS NOT INITIAL.
CALL METHOD r_grid->refresh_table_display.
ENDIF.
IS NOT INITIAL Line No. :1508

" MOD 003 a

" IF R_GRID

* MOD 008 End


ENDIF.
RC = 0 Line No. :884
* Add ALV Grid refresh in order to see the changed data.
IF r_grid IS NOT INITIAL.
CALL METHOD r_grid->refresh_table_display.
ENDIF.
IS NOT INITIAL Line No. :1518

" 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.

"
"
"
"

"populate the workcenter entered in the screen


REFRESH l_r_arbpl.
IF uo_arb IS NOT INITIAL.
APPEND INITIAL LINE TO l_r_arbpl ASSIGNING <l_fs_arbpl_r>.
<l_fs_arbpl_r>-low
= uo_arb.
<l_fs_arbpl_r>-sign = zcl_pm_literals=>gc_sign_i.
<l_fs_arbpl_r>-option = zcl_pm_literals=>gc_option_eq.
ENDIF.
IS NOT INITIAL Line No. :1622

" IF UO_ARB

"populate the plant populated in the screen


REFRESH l_r_werks.
IF uo_wer IS NOT INITIAL.
APPEND INITIAL LINE TO l_r_werks ASSIGNING <l_fs_werks_r>.
<l_fs_werks_r>-low
= uo_wer.
<l_fs_werks_r>-sign = zcl_pm_literals=>gc_sign_i.
<l_fs_werks_r>-option = zcl_pm_literals=>gc_option_eq.
ENDIF.
IS NOT INITIAL Line No. :1635
CLEAR: l_i_arbpl,l_i_object, l_i_person.
"get the workcenter object id
SELECT objty
objid
arbpl
werks

" IF UO_WER

INTO TABLE l_i_arbpl FROM crhd


WHERE werks IN l_r_werks
AND arbpl IN l_r_arbpl
AND lvorm EQ space.
IF sy-subrc IS INITIAL.
SORT l_i_arbpl BY objty objid.
l_i_object[] = l_i_arbpl[].
ENDIF.
RC IS INITIAL Line No. :1658

" IF SY-SUB

* get the persons.


CALL FUNCTION 'COI2_PERSON_OF_WORKCENTER'
EXPORTING
begda
= sy-datlo
endda
= sy-datlo
TABLES
out_persons = l_i_person
in_object = l_i_object
EXCEPTIONS
OTHERS
= 1.
IF sy-subrc = 1.
MESSAGE s047(ih).
s found.
EXIT.

"/ 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

"populate the selected value


READ TABLE l_i_returntab ASSIGNING <l_fs_returntab> INDEX 1.
IF sy-subrc IS INITIAL.
uo_rqe = <l_fs_returntab>-fieldval.
ENDIF.
RC IS INITIAL Line No. :1730

" 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

TYPE TABLE OF l_ty_crhd.

REFRESH l_r_werks.
"populate the plant value in screen
IF uo_wer IS NOT INITIAL.

"

APPEND INITIAL LINE TO l_r_werks ASSIGNING <l_fs_werks_r>.


<l_fs_werks_r>-low
= uo_wer.
<l_fs_werks_r>-sign = zcl_pm_literals=>gc_sign_i.
<l_fs_werks_r>-option = zcl_pm_literals=>gc_option_eq.
ENDIF.
IS NOT INITIAL Line No. :1757
DATA: record_tab TYPE TABLE OF seahlpres,
p result structure
shlp
TYPE shlp_descr,
n of Search Help
callcontrol LIKE ddshf4ctrl.

" IF UO_WER
"Search hel
"Descriptio

"get the work center for the plant


CLEAR l_r_werks[].
SELECT arbpl
werks
verwe
FROM crhd
INTO TABLE l_i_crhd
WHERE werks IN l_r_werks.
CLEAR :l_i_returntab.
"provide the search help value for selection
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield
= zcl_pm_literals=>gc_fieldname_arbpl
"zcl_pm_literals=>GC_FIELDNAME_ARBPL => 'ARBPL'
dynpprog
= sy-repid
dynpnr
= sy-dynnr
dynprofield
= zcl_pme208_tech_pln_wb=>gc_pme208_scr_arb
"ZCL_PME208_TECH_PLN_WB-GC_PME208_SCR_ARB => 'UO_A
RB'
value_org
= zcl_pm_literals=>gs_seconds_s
callback_form
= zcl_pme208_tech_pln_wb=>gc_pme208_callback "'F4CALLBAC
K'
callback_program = sy-repid
TABLES
value_tab
= l_i_crhd
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.
" IF SY-SUB
RC <> 0 Line No. :1803
"populate the selected value
READ TABLE l_i_returntab ASSIGNING <l_fs_returntab> INDEX 1.
IF sy-subrc IS INITIAL.

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'.
"'~'.

" FORM F4CA


No. :1826

Das könnte Ihnen auch gefallen