Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- METHOD if_swf_flex_ifs_condition_def~get_conditions.
- *&**********************************************************************
- *OBJECT ID : ZCL_MM_SWF_WORKFLOW_COND *
- *TITLE : Purchase Order Pre-Condition check *
- *AUTHOR : Shiva Krishna *
- *DATE : 17/02/2021 *
- *DEVELOPMENT ID : W-PR-0001 *
- *Rev-Trac : 326,129,198,2781 *
- *REQUESTED BY : Rachel McCutcheon *
- *TRANSPORT NO. : SD1K904020,SD1K905223,SD1K905390,SD1K905462 *
- * SD1K905550 *
- *DESCRIPTION : Purchase Order Pre-Condition check *
- * To check the preconditions for the workflow to get trigger *
- *&**********************************************************************
- *& CHANGE HISTORY LOG *
- *&---------------------------------------------------------------------*
- * DATE(MM/DD/YYYY)| DEVELOPER | REQUESTOR | TRANSPORT # *
- * 07/29/2021 | Shiva Krishna | Eswar | TR# SD1K906194 *
- * DESCRIPTION : Added new logic to determine the PR workflow agents *
- * 11/17/2021 | Venkatesh | Eswar | TR# SD1K907675 *
- * SD1K907863 *
- * DESCRIPTION : New logic for procurement manager and PG#903 *
- *&---------------------------------------------------------------------*
- * 01/10/2023 | Ahmed Ait Lahcen | Hamza Asrar | TR# SD1K911104 *
- * DESCRIPTION : Suppress WF approval for some contract change scenarios*
- *&---------------------------------------------------------------------&
- * 02/20/2023 | Ahmed Ait Lahcen | Hamza Asrar | TR# SD1K911356 *
- * DESCRIPTION : Suppress WF approval for PO / Contract *
- *&---------------------------------------------------------------------&
- *&--- Local WorkArea Declarations
- DATA : ls_condition LIKE LINE OF ct_condition.
- DATA : ls_parameter LIKE LINE OF ct_parameter.
- *&--- Contract Reference Conditions
- *&--- Update the Pre-Conditions
- ls_condition-id = 1.
- ls_condition-subject = 'Contract Reference'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 1.
- ls_parameter-name = 'EKPO-KONNR'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Target Value for Outline Agreement in Document Currency
- *&--- Update the Pre-Conditions
- ls_condition-id = 3.
- ls_condition-subject = 'Total net value of all line items in Quantity Contract greater than'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 3.
- ls_parameter-name = 'EKPO-ZWERT'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- ls_parameter-id = 3.
- ls_parameter-name = 'Currency'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- ls_parameter-service_path = '/sap/opu/odata/sap/S_MMPURWorkflowVH_CDS'.
- ls_parameter-entity = 'S_MMPURWorkflowVH'.
- ls_parameter-property = 'Currency'.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Target Value for Outline Agreement in Document Currency
- *&--- Update the Pre-Conditions
- ls_condition-id = 4.
- ls_condition-subject = 'Total net value of all line items in Quantity Contract less than or equal to'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 4.
- ls_parameter-name = 'EKPO-ZWERT1'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Update Currency
- ls_parameter-id = 4.
- ls_parameter-name = 'Currency'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- ls_parameter-service_path = '/sap/opu/odata/sap/S_MMPURWorkflowVH_CDS'.
- ls_parameter-entity = 'S_MMPURWorkflowVH'.
- ls_parameter-property = 'Currency'.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Account Assignment Category
- *&--- Update the Pre-Conditions
- ls_condition-id = 5.
- ls_condition-subject = 'Account Assignment Category'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 5.
- ls_parameter-name = 'EBAN-KNTTP'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Account Assignment Category
- *&--- Update the Pre-Conditions
- ls_condition-id = 6.
- ls_condition-subject = 'Job Code'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 6.
- ls_parameter-name = 'PA0001-ZZJOB_CODE'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- PR Initiator Manager/Cost center owner
- *&--- Update the Pre-Conditions
- ls_condition-id = 7.
- ls_condition-subject = 'Initiator Manager/Cost Center Owner'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 7.
- ls_parameter-name = 'M/O'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Job Code at Manager's Level
- *&--- Update the Pre-Conditions
- ls_condition-id = 8.
- ls_condition-subject = TEXT-t01.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 8.
- ls_parameter-name = 'PA0001-ZZJOB_CODE'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Job Code at cost centre owner's Level
- *&--- Update the Pre-Conditions
- ls_condition-id = 9.
- ls_condition-subject = TEXT-t02.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- APPEND ls_condition TO ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 9.
- ls_parameter-name = 'PA0001-ZZJOB_CODE'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Begin of changes for RT 1412 tr SD1K907675
- *&--- Procurement Manager
- **&--- Update the Pre-Conditions
- ls_condition-id = 10.
- ls_condition-subject = 'Procurement Manager'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- INSERT ls_condition INTO TABLE ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 10.
- ls_parameter-name = 'P'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- Purchasing group 903
- **&--- Update the Pre-Conditions
- ls_condition-id = 11.
- ls_condition-subject = 'Approval Level'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- INSERT ls_condition INTO TABLE ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 11.
- ls_parameter-name = '1/2/3'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- End of changes for RT 1412 tr SD1K907675
- *&--- Begin of code for RT# 2781 TR# SD1K911104
- *&--- Update the Pre-Conditions
- ls_condition-id = 12.
- ls_condition-subject = 'Contract change'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- INSERT ls_condition INTO TABLE ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 12.
- ls_parameter-name = 'Contract change'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- End of code for RT# 2781 TR# SD1K911104
- *&--- Begin of code for RT# 2876 TR# SD1K911356
- *&--- Update the Pre-Conditions
- ls_condition-id = 13.
- ls_condition-subject = 'PO change'.
- ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
- INSERT ls_condition INTO TABLE ct_condition.
- CLEAR : ls_condition.
- *&--- Update Parameters for Pre-Conditions
- ls_parameter-id = 13.
- ls_parameter-name = 'PO change'.
- ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
- ls_parameter-mandatory = abap_false.
- APPEND ls_parameter TO ct_parameter.
- CLEAR : ls_parameter.
- *&--- End of code for RT# 2876 TR# SD1K911356
- ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement