cancel
Showing results for 
Search instead for 
Did you mean: 

Need WBS ELEMENT in start condition of Manage workflow for journal entry verification

SMK_Ganesh
Participant
0 Kudos
177

Hi SAP Experts,

Need to add wbs element in start condition in manage workflow for journal entry verification.

For that I have created badi but wbs element Value for help is not coming and i have given SCENARIO_ID = WS02800046.

I think due to service path & entity only the value is not coming.

please check and revert.

SWF_WORKFLOW_CONDITION_DEF

CONSTANTS: co_id TYPE if_swf_flex_ifs_condition_def=>ty_condition_id VALUE 'CF_SWF_FLEX_IFS_BADI_COND_SAMP'.

data : ls_condition like line of ct_condition.
data : ls_parameter like line of ct_parameter.

* WBS Element Condition
ls_condition-id = 'id_WBS'.
ls_condition-subject = 'WBS Element'.
ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
append ls_condition to ct_condition.

* Parameter for Workflow level condition - WBS Element
ls_parameter-id = 'id_WBS'.
ls_parameter-name = 'WBS Element'.
ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
ls_parameter-service_path = '/sap/opu/odata/sap/API_PROJECT_SRV'. " Update with appropriate OData service
ls_parameter-entity = 'WBSHierarchyNode'. " Adjust entity name accordingly
ls_parameter-property = 'WBSCode'. " Adjust property for WBS element
ls_parameter-mandatory = abap_false.
append ls_parameter to ct_parameter.

SWF_WORKFLOW_CONDITION_EVAL

CONSTANTS co_id TYPE if_swf_flex_ifs_condition_def=>ty_condition_id VALUE 'CL_SWF_FLEX_IFS_BADI_COND_SAMP' ##NO_TEXT.

cv_is_true = abap_false.
DATA lt_wbs_element TYPE TABLE OF i_journalentryitem.

IF is_sap_object_node_type-sont_key_part_2 IS INITIAL.
SELECT WBSELEMENTINTERNALID INTO TABLE @LT_wbs_element
FROM i_journalentryitem
WHERE accountingdocument = @IS_sap_object_node_type-sont_key_part_1.
ELSE.
SELECT WBSELEMENTINTERNALID INTO TABLE @LT_wbs_element
FROM i_journalentryitem
WHERE accountingdocument = @IS_sap_object_node_type-sont_key_part_1
AND accountingdocumentitem = @IS_sap_object_node_type-sont_key_part_2.
ENDIF.

IF lt_wbs_element IS NOT INITIAL.
READ TABLE lt_wbs_element INTO DATA(ls_wbs_element) INDEX 1.
READ TABLE it_parameter_value INTO DATA(ls_param_wbs) WITH KEY name = 'WBS Element'.

IF sy-subrc EQ 0 AND ls_param_wbs-value = ls_wbs_element-WBSELEMENTINTERNALID.
cv_is_true = abap_true.
ENDIF.
ENDIF.

SMK_Ganesh_0-1739427338551.png

 

Kindly, requesting you to help on this.

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

TakeZhou
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Please make sure below points to let the search help work:

1. Make sure the entity exist in the service path.

2. Make sure the entity (parameter entity ) , property (parameter-property) has maintaine 'Valuelist' annotation.

Please check below example:

CONSTANTS: co_id TYPE if_swf_flex_ifs_condition_def=>ty_condition_id VALUE 'CF_SWF_FLEX_IFS_BADI_COND_SAMP'.

data : ls_condition like line of ct_condition.
data : ls_parameter like line of ct_parameter.

* WBS Element Condition
ls_condition-id = 'id_WBS'.
ls_condition-subject = 'WBS Element'.
ls_condition-type = if_swf_flex_ifs_condition_def=>cs_condtype-start_step.
append ls_condition to ct_condition.

* Parameter for Workflow level condition - WBS Element
ls_parameter-id = 'id_WBS'.
ls_parameter-name = 'WBS Element'.
ls_parameter-xsd_type = if_swf_flex_ifs_condition_def=>cs_xstype-string.
ls_parameter-service_path = '/sap/opu/odata/sap/FAC_GL_DOCUMENT_POST_SRV'.
ls_parameter-entity = 'FinsPostingGLItems'.
ls_parameter-property = 'WBSElement'.
ls_parameter-mandatory = abap_false.
append ls_parameter to ct_parameter.

 

Best regard, Take

SMK_Ganesh
Participant
0 Kudos
Thank you

Answers (0)