Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
18,844

Dear SAP Communities,

Welcome to my blog post where we dive into the essential aspects of sales document approval processes. In this comprehensive guide, I’ll make you explore the significance of efficient approval workflows, provide practical tips to streamline your sales document approval journey.

In this blog, we will see the below cases:

Case – 1: Sales Approver approves the Sales document type ZOR.

Case – 2: Finance Approver request for rework of Sales Document type ZSCR.

Case – 3: Finance Approver rejects the Sales Document type ZSCR.

Below are the key steps involved in setting up Standard Workflow for Sales Documents:

  1. Introduction
  2. User Role Assignment
  3. Activate Workflow Scenarios
  4. Activate and Maintain Services
  5. Define and Assign Approval Reasons
  6. Maintain Task names and Decision Options
  7. Define and Assign Reasons for Rejection
  8. BADI Implementation
  9. Manage Teams and Responsibilities
  10. Manage Sales Document Workflow
  11. My Inbox App

1. Introduction:

Sales documents needs to be approved under certain conditions, which can be easily enabled in SAP’s Standard Workflows. I’ll be explaining based on the Sales Order types. Any combination of condition that satisfies the business requirements may be used. After setting up the configurational steps, the approver can view it on the My Inbox Fiori app and decide whether to accept or reject or rework the sales order. In the same way, workflows can be created for Sales Contracts, Sales Quotation, Customer Returns, Credit Memo Requests, and Debit Memo Request.

Case Scenario:

If a sales order type ZOR is created, it is relevant for approval from Sales Approver. If a sales order type ZSCR is generated, Finance Approver approval is relevant. No approvals are required if a sales order type other than ZOR and ZSCR is created. Note that I created the custom order types of ZOR and ZSCR. You can utilize your own sales document types in this instance.

The following figure illustrates the decision logic:

Picture1.png

2. User ROLE Assignment

User Roles

Flexible Workflow relies on SAP Fiori to be set-up and performed on SAP S/4HANA. Apps like Manage Teams and Responsibilities, Custom Fields and Logic and My Inbox will be used later in this blog to show you how to set-up and perform a demo scenario.

Most of the apps required are already part of standard roles you can find on your SAP S/4HANA system. The first two roles in the following table have been used to set up this scenario. The next two were used to perform the scenario in which the Sales Flexible Workflow is used. The standard roles can be assigned to the users in the development environment for testing, and then the users will require the specific role permissions that will be used effectively in a Quality and Production environment.

Role

Description

SAP_BR_BPC_EXPERT

Configuration Expert – Business Process Configuration

SAP_BR_BUSINESS_PROCESS_SPEC

Business Process Specialist

SAP_BR_INTERNAL_SALES_REP

Internal Sales Representative

SAP_BR_SALES_MANAGER

Sales Manager

3. Activate Workflow Scenarios

Run the transaction spro and go to below mentioned path:

ABAP Platform -> Application Server -> Business Management -> SAP Business Workflow -> Flexible Workflow -> Scenario Activation

 Picture2.png

Picture3.png

Make sure that the specific workflow is active. If not, click on new entries and add the Workflow ID -WS02000006 (for sales orders)

Picture4.png

4. Activate and Maintain Services

Go to spro path-> ABAP Platform -> SAP Gateway -> OData Channel -> Administration -> General Settings -> Activate and Maintain Services or put the TCode - /IWFND/MAINT_SERVICE

Picture5.png

Click on Add Service

Picture6.png

Enter the service name SD_F3014_SALESORDER_WORKFLOW_SRV in technical Service Name and click on Get Services and add Selected Services.

Picture7.png

Similarly add the below mentioned services as well.

  • C_SALESDOCUMENTWORKFLOWVH_CDS (for sales documents workflow value help)
  • SWF_FLEX_DEF_SRV (for flexible workflow definition)
  • /IWPGW/TASKPROCESSING (for task gateway service version 2.0)

5. Define and Assign Approval Reasons

5.a Define Approval Reasons:

Go to spro path -> Sales and Distribution -> Basic Functions -> Document Approvals -> Define Reasons for Approval Requests

Picture8.png

Picture9.png

Click on New entries and add Approval Request reason ID as ‘Z000’, ‘Z001’ and provide the Approval Request Reason. Make sure to not enable the check box for External Workflow and Defer Purchase Requisition.

Picture10.png

5.b Assign Approval Reasons:

Go to spro path -> Sales & Distribution -> Basic Functions -> Document Approvals -> Assign Reasons for Approval Requests.

Picture11.png

Click on New Entries and select the document category as ‘C’ for Sales Order and choose Approval Request Reason as ‘Z000’and ‘Z001’ which was defined in the previous step.

Picture12.png

Note: Approval Reason defined here will be used in Custom fields and Logic App to assign it to a specific document.

6. Maintain Task Names and Decision Options

Go to spro path -> ABAP Platform -> SAP Gateway Service Enablement -> Content -> Workflow Settings -> Maintain Task Names and Decision Options

Picture13.png

Make sure that the Workflow ID - WS02000006 is assigned to Step ID – 000000009. If not, click on New Entries and create as mentioned below.

Picture14.png

Click on the workflow ID created and select the Decision keys. Click on New Entries and input the key as mentioned below:

Picture15.png7. Define and Assign Reasons for Rejection

7.a Define Reasons for Rejection 

You can define rejection reasons in the Define Reasons for Rejection Customizing activity under: Sales and Distribution -> Sales -> Sales Documents -> Sales Document Item 

Picture16.png

Define the Rejection Reason as 77 and Statistics as X and Description as Rejected by Approver.

Picture17.png

7.b Assign Rejection Reasons

Go to spro path -> Sales and Distribution -> Sales -> Sales Documents -> Sales Document Item-> Assign Rejection Reasons to Sales Document Types and Sales Organizations

Picture18.png

Create New Entries and input Sales Document type as ‘ZOR’, Sales Organization as ‘1010’ and rejection reason as ‘77’ which was defined in the previous step.

Picture19.png

8. BADI Implementation

8.a BADI Implementation for Approval Request Reasons for Sales Documents

Open the Custom Logic App in Fiori and create the following custom logic.

Select Sales: Sales Document in the Business Context dropdown.

Input the BADI Description as Set Approval Request Reasons for Sales Documents

Enter Implementation Description as Flexible Workflow for Sales and click on Create.

Picture20.png

Enter the logic as mentioned below and click on Save Draft and test it and click on Publish.

Note: Approval reason was already defined in the spro configuration. That needs to be added in the logic here.

Picture21.png

Note: Use Sales document type TA instead of OR for standard order type in the logic.

8.b BADI Implementation for Rejection Reasons

To determine which rejection reason is used for the items of a sales document when an approval request is rejected by the approver, you must use the BAdI Set Sales Document Rejection Reasons for Rejected Approval Requests.

You can find this BADI in SPRO path: Sales & Distribution -> Sales -> Sales Documents -> Business Add-Ins (BADIs) -> BAdI: Set Sales Document Rejection Reasons for Rejected Approval Requests

Picture22.png

Input Enhancement Implementation as ‘ZZ_SD1’ and create the BADI.

Picture23.png

Implement the following code:

cv_sdoc_rejection_reason = ‘77’.

Click on Activate.

Picture24.png

Note: Here ‘77’ indicates the Rejection reason defined in the spro configuration.

9. Manage Teams and Responsibilities

With this app, you can manage teams, responsibility definitions, and team member functions.

Open Manage Teams and Responsibilities - App in Fiori and click on Create.

P1.png

Create a team Name and Type as SALES and Status as Enabled.

P2.png

Add Team Owners and Team Members as mentioned below:

Business Partner: Sales Employee (Business Partner should be created with Employee role)

Functions: Sales Document Approver – Level 1

Business Partner: Finance Approver

Functions: Sales Document Approver – Level 2

p5.png

p4.png

Once the required fields are added, save this.

10. Manage Sales Document Workflows

This app allows you to define preconditions under which a sales document should be approved and to select the recipients who should approve it. If a workflow is activated and the configured preconditions are fulfilled, the workflow is initiated. Approvers receive the sales documents for approval in the My Inbox app and as notifications.

Open Manage Sales Document Workflows app and select Workflow for Sales Orders and click on Create.

A1.png

Input the Workflow Name as ‘SALES DOCUMENT APPROVAL’.

A2.png

Input the Valid from and Valid to date for which the workflow will be active.

A3.png

Create the Step, it will take you to the below page.

Input the Step Name and Step Type.

A4.png

Select the assignment by Role and then enter the Role – Sales Document Approver Level 1 as the recipient.

A5.png

Set the Preconditions for Sales Order Type - ZOR

A6.png

Under Exception Handling, for the Rework of Sales Order exception, set the required action to Rework of Sales Order and the action result to Restart workflow.

B1.png

B2.png

Similarly create another Step for Finance Approver for Order type ZSCR.

B3.png

B4.png

B5.png

Once both the steps are created, Click on Save.

B6.png

Click on Create and activate it. The status of the workflow should be in active so that the workflow will be triggered.

B7.png

During this step, all sales orders from sales document type ‘ZOR’ are sent for approval to Sales Approver. And sales order from sales document type ‘ZSCR’ are sent for approval to Finance Approver.

NOTE: Once the workflow is activated, you cannot edit the workflow you have created. If you want to change/edit, you need to deactivate the workflow and edit it.

11. My Inbox

CASE 1: Sales Approver approves the Sales Document for ZOR Order Type

Workflow configuration is all set up. Newly created Sales Order with Sales document type ‘ZOR’ has the approval status ‘In Approval’. While the status is In Approval, you cannot change/edit the sales document. Once approved/rejected/rework is given by the approver, changes can be made to that sales order.

B8.png

The approval request will be displayed through My Inbox App. Here the approver will receive the notification and check basic data from the Sales Document such as Partner Functions, Amount, etc.

The approver can also navigate to the Sales Document if further information is required, and is given the option to Approve, Request to Rework, or Reject the Sales Document.

B9.png

Once the approver clicks on Approve, the sales order is approved and thus the subsequent delivery creation can be done. Now the Approval Status is changed to ‘Released’.

B10.png

Note: Workflow cannot be triggered to the same user ID if you are creating a sales order from the same user ID that was an approver. Create a sales order using a different user ID that is not an approver.

CASE 2: Finance Approver chooses Rework for Sales Document type ZSCR.

Another sales order of sales document type is created which is In Approval status.

B11.png

The approver selects Rework which means the sales representative must do the rework to the sales document and again the sales order will go for approval. The approver then approves/reject the sales order.

B12.png

In the sales order screen, the approval status got changed as to be reworked.

B13.png

Once the necessary changes have been done and saved, again the sales order will be In Approval Status.

B14.png

CASE 3: Finance Approver rejects the Sales Document for Sales Order type - ZSCR.

The sales order which was in approval is displayed to the Finance Approver ‘My Inbox’ screen. Here the Approver clicks on Reject as the sales order has some minor corrections.

b15.png

In the display sales order screen, Approval Status has been changed to Rejected status.

b16.png

In the Reason for rejection, you can see ‘Rejected by Approver’.

b17.png

You can manually change the necessary corrections for that sales order and remove ‘Rejected by Approver’ in the Reason for Rejection field and save the sales order. This will again go for approval to the Finance Approver and the Approver may approve/reject the sales order. You can set more than 1 level of approval for the same sales order also.

Conclusion:

I hope this blog post helps you in configuring the sales order workflow. Thanks for joining on this exploration of SAP Workflow and looking forward to continuing this journey towards operational excellence. 

 

 

 

3 Comments
Labels in this area