📝

Creating a Basic Workflow in SAP

Jul 22, 2024

Creating a Basic Workflow in SAP

Presenter: Artur - Certified ABAP Developer & Workflow Specialist

Overview

  • Objective: Learn to create, test, and read workflow logs in SAP
  • Business Case: Automate selecting the "Employee of the Week" where the boss congratulates them and offers a pizza.

Steps to Create Workflow

Business Process Description

  1. Scenario: Boss announces Employee of the Week and offers pizza.
    • Congratulates the employee and asks if they want pizza.
    • If yes, secretary orders pizza.
    • If no, simple congratulations.
  2. Objective: Automate the process using SAP Workflow.

Workflow Builder

  • Tools to Use: Transactions PFTC and SWDD
  • Key Tasks:
    1. Initiate Workflow:
      • First transaction code PFTC
      • Choose task type as workflow template; create technical name.
    2. Second Transaction Code SWDD (More popular):
      • Navigate various areas (main design, overview, info area, navigation, messages, dynamic area).
      • Save the workflow with an abbreviation and description.
      • Assign package and transport request.
    3. Workflow Container:
      • Used for storing global data (employee name in this case).
      • Create element g_employee to store the employee's name.

Dialogue Task Creation

  • Decision Task: Ask employee if they want pizza.
    • Assign task to specific user stored in g_employee.
    • Steps in Decision Task:
      • Title: "Congrats Employee of the Week! Do you want pizza?"
      • Possible answers: Yes and No
      • Assign agents via expression (g_employee).
      • Ensure general task in attributes so task is available to all users.
      • Save and confirm.

Email Sending Task

  • For 'Yes' Response:
    • Use 'send mail' to order pizza.
    • Enter recipient type, email address, subject, and content.
    • Save in the same package and transport system.
    • Activate workflow.

Testing and Verification

  • Test the Process:
    • Fill in test data for workflow container (g_employee).
    • Start process and check messages.
    • Log into SAP as workflow agent and check inbox.
    • Respond to dialogue task (Yes or No).
    • Verify via transaction SWIA to see workflow status.

Workflow Log

  • Check logs to verify workflow status: WS code for the entire process.
  • Ensure status is completed for both dialogue and background tasks.
  • Verify email is received after choosing 'Yes'.

Conclusion

  • Successfully created, tested, and verified the workflow process.
  • To learn more, subscribe to the channel, share, and comment for further content suggestions.