Show TOC Start of Content Area

Process documentation Workflow for Approving Condition Change for Master Data  Locate the document in its SAP Library structure

Purpose

This process triggers a workflow if an employee creates or changes pricing conditions in master data. A supervisor will then either approve the condition or reject it by deleting it.

If a condition is not approved, it remains inactive and is not considered during price calculation.

Prerequisites

You need to set up the authorization objects as described in note 986344.

Process Flow of Workflow WS52600001 (Approving Condition Change for Master Data)

Implementation CRM_CND_APPROVE of BAdI /SAPCND/DBA_SAVE_WS checks whether inactive conditions have been saved. In this case, the implementations of BAdI CRM_CNDCHG_APPROVAL_WF can trigger a workflow.

The workflow sends a work item to the supervisor to ask for approval of the pricing conditions. As soon as the conditions have been approved, they are activated and taken into consideration during price calculations.

The supervisor has the option of rejecting the condition. If he does this, they are permanently deleted.

Technical Execution

The following information is of a technical nature. You need this information if the implementation details are relevant for you, or if you wish to make your own enhancements.

Triggering Events for the Workflow Template

The BAdI implementation CRM_CND_APPROVE checks whether all inactive conditions to be processed can be maintained in the standard pricing condition maintenance UI (Maintenance context GCM).
In this case, the BAdI implementation for GCM is called.

If some conditions cannot be maintained in GCM, an alternative maintenance context is calculated and the corresponding BAdI implementation will be called to trigger another workflow.

Rule

Agent assignment for the approval task is done using the rule Superior (as user) for

BAdIs Used

Definition: /SAPCND/DBA_SAVE_WS

Implementation: CRM_CND_APPROVE

This BAdI finds the maintenance context for inactive conditions and triggers the workflow.


Definition: CRM_CNDCHG_APPROVAL_WF

Implementation: CNDCHG_APPROVAL_GCM

Implementing Class: CL_CRM_IM_CNDCHG_APPROVAL_GCM

This BAdI finds the inactive conditions to a workflow event that triggers the CNDAPPR workflow.

Further Implementation Details

The workflow is controlled by ABAP 00 class CL_CRM_CNDCHG_WORKFLOW. This is a simple class used to generate a workflow task. The workflow task is mapped to the CL_CRM_CNDCHG_UI_MAPPER class, which prepares the condition maintenance UI for the approval workflow.

This means it passes the workflow GUID, the IDs of the conditions to be approved and the name of the maintenance group and context to the inbound plug of the condition maintenance UI.

The condition maintenance UI sends a workflow event when all conditions have either been approved or rejected. The event terminates the work item.

 

End of Content Area