Show TOC

 Workflow for Approving Condition Change for Documents

Purpose

A workflow is triggered whenever an employee creates or changes manual pricing documents in an order.

A supervisor then decides if the conditions are acceptable or if reworking is required. Without their approval, the order cannot be shipped or billed.

Prerequisites

Action profile STOP_BILLING must be assigned to a transaction type. This action will set system status Cnd Change Approval (Bill Blk) and the blocking reason at header level .

Alternatively, you can use the action STOP_SHIPPING to set the system status and delivery block.

The scheduling condition schedules assigned to both STOP_SHIPPING and STOP_BILLING controls the execution of the actions.

The scheduling condition schedules check two conditions before triggering the STOP_BILLING or STOP_SHIPPING action:

  • The user is not authorized to add or change manual pricing conditions or

  • The user has added or changed manual pricing conditions in an order document.

Actions are executed once an order is saved.

Process Flow

The actions STOP_SHIPPING or STOP_BILLING trigger an event for the workflow.

The workflow sends a work item to the supervisor asking for approval of the document. If the supervisor approves the document, the system statuses and the blocking reason preventing the items being billed or shipped are removed from the order and the order can then be processed.

If the supervisor rejects the task, a new work item is generated for the workflow initiator. As soon as they adjust the pricing conditions, the supervisor will be asked for approval again.

The supervisor will also be informed if there are any further changes to the pricing conditions.

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.

Workflow Template

Triggering Events for the Workflow Template

The workflow reacts on two events from BOR object BUS2000115 (Sales Order):

  • ToBeApproved Approval of Price Changes is Required

  • UpdateApprovalReq Conditions Changed for Blocked Document

  • The STOP_SHIPPING or STOP_BILLING actions have four pre-configured parameters. These parameters are responsible for setting/deleting the system statuses of the order documents.

  • The parameters for STOP_SHIPPING are as follows:

  • BLOCKINGTA=ASPB

  • RELEASETA=ASPR

  • APPRREQSTATE=I1152

  • BLOCKING_REASON=30

The parameters for STOP_BILLING are as follows:

  • BLOCKINGTA=ANVB

  • RELEASETA=ANVR

  • APPRREQSTATE=I1153

  • BLOCKING_REASON=30

  • If the APPREQSTATE system status is not set, a new workflow is triggered by raising the ToBeApproved event, otherwise the UpdateApprovalReq is raised to update an existing workflow.

Rule

The agent assignment for the approval task is done using rule Superior (as user) for…

Used BAdIs

Definition: EVAL_SCHEDCOND_PPF

Implementation: CRM_CND_APPROV_SCHED

Implementing Class: CL_IM_CRM_CND_APPROV_SCHED

This BAdI checks the CNDDAPPR authorization object and determines whether manual conditions have been added to the document.

If the user does not have authorization to make manual changes without prior approval and manual conditions have already been touched, the corresponding action is scheduled.

Definition: EXEC_METHODCALL_PPF

Implementation: ORDER_APPROVE_WF

Implementing Class: CL_CRM_IM_ORDER_CNDCHG_APPROVE

The execute method of this class passes the following information to the workflow event:

  • Item prices

  • Tracked information about manual conditions

  • System status name and business action for approval of the task

General behavior is described in the chapter Triggering events for the workflow template .