METHOD iow_z_workday_escalation~get_escalation_settings.
*"------------------------------------------------------------------------*
*" Declaration of Overwrite-method, do not insert any comments here please!
*"
*"methods GET_ESCALATION_SETTINGS
*" importing
*" !IS_MSMP_EXEC_CONTEXT type GRFN_MW_S_EXECUTION_CONTEXT
*" !IS_STAGE type GRFNMWCNSTGV
*" returning
*" value(ES_ESCALATION_SETTINGS) type GRFNMW_S_TEMPLATE_ESCALATION
*" raising
*" CX_GRFN_MSMP_CONFIGURATION_ERR
*" CX_GRFN_MSMP_NO_APPROVER
*" CX_GRFN_MSMP .
*"------------------------------------------------------------------------*
DATA: ls_escalation_settings TYPE grfnmw_s_template_escalation,
l_escalation_user TYPE grfn_mw_wf_appr_usr.
DATA ls_global_settings TYPE grfnmwcnglbset.
DATA: end_date LIKE sy-datum,
end_time LIKE sy-uzeit,
start_date LIKE sy-datum,
start_time LIKE sy-uzeit.
DATA: lv_timestamp TYPE timestampl.
ls_global_settings = cl_grfn_msmp_configuration=>get_global_settings( is_msmp_exec_context-process_id ).
IF is_stage-escalation_type <> grfnw_msmp_c_escalation_type-no_escalation.
IF ( ls_global_settings-escalation_enble EQ abap_true ).
ls_escalation_settings-requested_esclation_date = ls_global_settings-escalation_date.
ENDIF.
ls_escalation_settings-escalation_type = is_stage-escalation_type.
GET TIME STAMP FIELD lv_timestamp.
* convert to date and time
CONVERT TIME STAMP lv_timestamp TIME ZONE sy-zonlo INTO DATE start_date TIME start_time.
* calculate time
CALL FUNCTION 'END_TIME_DETERMINE'
EXPORTING
duration = is_stage-escalation_time
unit = grfnw_msmp_c_duration_units-minutes
factory_calendar = 'EU' "Factory Calendar ID from SCAL transaction
IMPORTING
end_date = end_date
end_time = end_time
CHANGING
start_date = start_date
start_time = start_time
EXCEPTIONS
factory_calendar_not_found = 1
date_out_of_calendar_range = 2
date_not_valid = 3
unit_conversion_error = 4
si_unit_missing = 5
parameters_no_valid = 6
error_message = 7
OTHERS = 7.
IF sy-subrc = 0.
ls_escalation_settings-latest_end_date = end_date.
ls_escalation_settings-latest_end_time = end_time.
ELSE.
RAISE EXCEPTION TYPE cx_grfn_msmp_configuration_err.
ENDIF.
ENDIF.
es_escalation_settings = ls_escalation_settings.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |