
Define reasons that are displayed in sales documents or preliminary billing documents to let the business user know why these documents need to be approved.
You must define at least one reason for approval requests to set up the approval workflow for sales documents.
Assign the approval request reasons that you have defined to document categories.
Once you have defined approval request reasons, you specify which documents these reasons are valid for by assigning them to one or more document categories.
Once you have created the role in the User from the Manage Workforce App, it will be shown in the Maintain Business Partner App with the Personnel Number.
A very nice video to watch: Learn about Responsibility Management.
The above figure provides an overview of the approval workflow, starting with the creation of a sales document.
The above screenshot provides an overview of the BAdI, Check this SAP Help
Setup Example: Approval Workflows in Your System.
*trigger a workflow by setting approval request reason ZOR1.
if salesdocument-sddocumentcategory = 'C' and "Sales Order document category is "C"; Beware Sales Order without charge is "I"
salesdocument-salesdocumenttype = 'TA' and "Internal Key values are available in the Badi (TA and not OR)
salesdocument-salesorganization = '5910'.
salesdocapprovalreason = 'ZOR1'.
return.
endif.
Order Category | Order Category Code |
Sales Quotation | B |
Sales Contract | G |
Sales Order | C |
Sales Order Without Charge | I |
Customer Return | H |
Credit Memo Request | K |
Debit Memo Request | L |
Sales Document Type | Internal Key |
QT (Quotation) | AG |
CR (Credit Memo Request) | G2 |
DR (Debit Memo Request) | L2 |
OR (Standard Sales Order) | TA |
** Example 2: All sales quotations containing a customer with a specific customer abc classification
** shall trigger a workflow by setting approval request reason ZQT1.
*
* data lv_customerabcclassification type if_cmd_validate_customer=>ty_bp_sales-customerabcclassification.
* if salesdocument-sddocumentcategory = 'B'. "Sales quotations
** As the customer abc classification is not availble directly in the importing parameter we need to
** select the customer classification from released CDS view I_CustomerSalesArea
* select single customerabcclassification from i_customersalesarea into @lv_customerabcclassification
* where customer = @salesdocument-soldtoparty and
* salesorganization = @salesdocument-salesorganization and
* distributionchannel = @salesdocument-distributionchannel and
* division = @salesdocument-organizationdivision.
* if lv_customerabcclassification = 'A'.
* salesdocapprovalreason = 'ZQT1'.
* return.
* endif.
* endif.
** Example 3: All sales orders with order type “Standard Order”, for which the terms of payment have been changed
** from a non-initial value shall trigger a workflow by setting approval request reason ZOR2.
** As you already see here the Example 1 and Example 3 could intersect in conditions.Kindly take care
** of this in the real implementation.
*
* data lv_customerpaymentterms type dzterm.
*
* if salesdocument-sddocumentcategory = 'C'. "Sales Orders
* select single customerpaymentterms from i_salesorder into @lv_customerpaymentterms where salesorder = @salesdocument-salesdocument.
* if lv_customerpaymentterms is not initial and "Check for non-initial
* lv_customerpaymentterms ne salesdocument-customerpaymentterms. "Check for value change
* salesdocapprovalreason = 'ZOR2'.
* return.
* endif.
* endif.
** Example 4: All sales documents of type credit memo request independent of the credit memo request data
** like credit memo request type, sold-to party, order reason, etc. shall trigger a workflow by setting
** approval request reason ZCR1.
*if salesdocument-sddocumentcategory = 'K'. "Credit Memo request
* salesdocapprovalreason = 'ZCR1'.
* return.
*endif.
** Example 5: A sales quotation which is status "not relevant" could be approval relevance because of some changes;
** like the net amount is decreased signficiantly and the sales manager needs to be made aware of the change.
** Here we have approval process for 2 scenarios. Either incase the sales quotation net amount is greater than
** 10000 EUR or 12000 USD (assuming business is done only in these currencies) or incase the the net value
** reduces by 50%. These cases shall trigger a workflow by setting approval request reason ZQT2 (NetValue related approval)
*
* data lv_totalnetamount like salesdocument-totalnetamount.
* if salesdocument-sddocumentcategory = 'B'. "Sales quotations
* select single totalnetamount from i_salesquotation into @lv_totalnetamount where salesquotation = @salesdocument-salesdocument.
* if sy-subrc = 0.
* if lv_totalnetamount > 0.
* if ( ( lv_totalnetamount - salesdocument-totalnetamount ) / lv_totalnetamount ) * 100 > 50. " Reduced greater than 50%
* salesdocapprovalreason = 'ZQT2'.
* return.
* endif.
* endif.
* else. " New Quotation.
* if ( salesdocument-totalnetamount > 10000 and salesdocument-transactioncurrency = 'EUR' ) or
* ( salesdocument-totalnetamount > 12000 and salesdocument-transactioncurrency = 'USD' ).
* salesdocapprovalreason = 'ZQT2'.
* return.
* endif.
* endif.
* endif.
The above screenshot provides an overview of the creation of Sales Order Workflow such as Name and Conditions and Description.
The above screenshot provides an overview of the creation of Step One of the User Assignment.
The above screenshot provides an overview of the Define Action Result for Workflow when the Approver Requests a Rework of the Sales Order.
The above screenshot provides the last step of the Workflow Creation and Activation.
Creation of the Sales Order, After Activating the Workflow.
Once the Sales Order (6) is Saved, the Approval Reason will Appear means the Workflow is Started.
Once the Workflow is Started, No Changes are Allowed.
Request Rework for this Workflow Task.
Rework will Trigger the Creator of the Sales Order, with Comments Shown to User, and the Edit Option will be Allowed.
Rejecting a Sales Order will Reject all Items with Rejection Reason: Rejected by Approver (77).
Approved Sales Order Status.
Issue 1:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |