Hi hi everyone, my name is Artur. I'm a certified ABAP developer and workflow specialist from over 16 years. In this video I'm going to show you how to create your basic first workflow process. That's the simplest process that came to my mind. I'm going to teach you how to create it, how to test it and read workflow logs.
Please follow me and in just 15 minutes you will be able to create your own workflow process on SAP system. I hope you find that workflow is not so difficult as it looks like. So, let's start. Let's check first the business process. Let's imagine a company where the boss chooses every week the best employee of the week.
He used to congratulate the chosen person every Friday and gives an expensive gift. The boss wants to show his generosity. Because of some financial problems of the company, he decided to change the expensive gift to...
Pizza. Maybe he's not the most generous boss I can imagine, but let's use that crazy example as a simple business case. Normally, business process looks as follows.
The company informs the employee that he won that week, congratulates and asks if he wants a pizza. If the answer is yes, the secretary calls the pizzeria and orders a pizza for that person. If not, nothing more happens. Just congratulations! Our smart boss decided to automate the process a bit and give the secretary some more productive things to do.
Because of the fact that the company used SAP, he required SAP workflow to cover that one process. IT department came with a nice idea of automating congratulations and the pizza order process. The boss will have a small program with one input field who's the employee of the week and one huge button send congrats.
After pressing the button the event to start workflow will be generated. IT department will create the workflow process that will react on that one event and that time the workflow process will be started. The workflow consists from one dialogue task.
That is decision task in this case. Here we congratulate the employee and offer a pizza. Potential user can answer in two ways. First one is yes.
After that, background task to send email to pizzeria will be generated and executed. After that, workflow will be finished. If user answers no, Email will be not sent and workflow will be finished as well.
Now let's turn to the system and we will try to do this. There are two transactions to access the workflow builder. The workflow builder is the tool to create workflows on SAP system.
First one transaction is PFTC. The second one more popular is transaction SWDD. Let's check the first transaction code.
P F T C. Here it's very important to choose in task type workflow template. And we press here create button. Okay.
In the first field, abbreviation, we should enter the technical name of the workflow. Let's say first Z underscore first underscore workflow. And later we press button workflow builder and we access the workflow builder. I will go back right now.
Now I want to show you the next one transaction SWDD which is much more popular. When we are in this transaction first we should do is to press button create because in fact right now we can see last created workflow and we want to create the new one. You can see that right now workflow field is empty.
and we are going to create new workflow process. Please notice that in the workflow builder we have certain areas. I will make bigger this area because this area is not visible.
This is the main area where we are designing the workflow process. Here we add steps and we model the process. On the right hand side we can see workflow overview. So here we can see how our workflow looks right now. On the left hand side we have information area.
Here is technical name of the workflow, version and status. In status we can see if workflow was saved already or not. Next one area is navigation area.
Here we can see all steps which are in the workflow process and we can easily access them by clicking on the steps we want to check. Here down on the bottom we have message area and during saving or during activation of our workflow process we will see here if it was updated successful or we have some errors. This one area is dynamic. That's very important area Right now we can see here workflow container. So global data of workflow process.
But using the context menu, we can change dynamically this area to other information. Like for example, step types that can be inserted. Workflow container, it is set right now.
But we can change it to this. We can change it to... my workflows and tasks right now probably it will be empty workflow wizard or others in this process we will need workflow container as you can see right now workflow was not created in workflow field there is no technical name so i would suggest you first to save the workflow process even though it is empty So I press the button Save.
Right now, system asks me about abbreviation and name of the workflow. We approve with Continue button. Now system asks us about package to assign the workflow process and I have created before package ZTR underscore workflow underscore course. I save it in this package.
System asks us about request assignment, transport assignment. I have created one transport as well. I continue.
you can see that right now technical number of workflow was generated we can write down this number somewhere because this is the number of the process we have created and we can refer to this when we want to change something in the workflow or display or test or whatever as you remember our boss will give the chosen employee name on the form to start workflow process So this value will be transferred to our workflow. We have to create place to store this value. Workflow container is something like global data of the whole process. So when the value will be transferred to our workflow process, we have to store this value in workflow container to be able to use it in other parts of the process.
When we want to... add the element to workflow container we double click on double click to create now system asks us about element name and description in element we enter technical name of the workflow container element i name it g underscore employee g just to show you that this is global element Now we have to choose type of element. In our case, we will use data element SWP underscore agent.
This is data element for storing users in SAP system. On tab properties, we should decide parameter settings. I will check import and export. Import is because we will transfer the data to this element and later we will use it in the process itself so we have to check export as well i approve and we can see that our parameter was created now we should create our dialogue task our decision dialogue task i click here and from context menu i choose create It appeared pop-up with all step types that we can use.
In our case, we will use decision task, user decision. In the title, we enter question to potential user who will get this step. Congrats employee of the week!
Do you want pizza? Possible answers are yes and no. There are a lot of possibilities to assign agent to this dialogue task. It can be role, rule, organizational unit, job, position, work center, user, expression.
Theoretically we could choose user. to assign it to the certain user in sap system but in our case we have dynamic value that will store the user who will be transferred from execution program that's why we choose expression and here we can see our workflow container and we choose our created before element g underscore employee There is one more very important thing when we are talking about agent assignment. Please go to Control Tab and here we can see Tab Properties. When we press this yellow button, this is agent assignment of the task.
Here we define who is possible agent of this workflow task. In attributes we should choose general task and press transfer. This means that this task is available for all SAP users. Theoretically we could narrow possible agents just to only managers or only employees but for this certain test case we will use general task. We press transfer.
and update index. Index was generated. We can see this message there and I go back. Very very important is that this one assignment is configured. That one bullet point must be green.
Otherwise, our workflow will not work. Now I come back to decision task. We did it. Right now we approve our dialog step.
You can see that dialog step was assigned to the process. We did two possible answers, yes and no. That's why we can see two routes, yes. and no. Theoretically, we could give more than two answers, like no idea.
In that case, we would have three routes but we want only two we have to delete no idea one okay again we have two routes yes no as you can see system created that one step this is just a step to double click on it and create new one step i will just delete it Please notice that our decision step appeared in navigation area. We can see new step with technical number 00004 Congrats employee. Now we should model our background step email sending. I use context menu on the yes root because in case of no email will be not sent. I press create.
And here I choose email sending, send mail, approve. First of all, we should design who is recipient of the email. In recipient type, we choose just email address.
In that case, it will be not an expression or something. We will use constant email of pizzeria. Of course, I don't want to send email to any pizzeria right now. That's why I will use our office email just to test. We design subject.
Subject will be pizza order and content of the email. We can mark sendExpress. It means that it will be sent automatically just after execution. Otherwise, it will wait for a periodical job to send it out.
I approve the background step. Here system asks about task name. I give name like z underscore mail. and approve of course package assignment the same the same transport our process is designed we just press activate please notice that status of workflow was changed to active saved okay now the most enjoyable part of workflow programming we test our process to test the process we press button test. In test environment of the workflow we are able to give some test data.
So in fact we are able to fill in some global workflow container data. In our case we fill in only the element we have created g underscore employee. So we will fill in that value with user wfts1 but it's very important that here We will add US as a prefix. It means that this is user because later we are using this parameter to agent assignment and in agent assignment we have to use prefix to tell to the system if it's user or group of users or an organizational unit or something. OK. data are filled in, we can start the process.
We can see below the message task started under work item ID 1734830. Now I will log in to SAP system with user WFTS1. We open inbox. You can see that here we have emails and workflows.
Now I will click on workflow. There is only one workflow task. Congrats, employee of the week. Do you want a pizza? I double click on it and we can see two buttons with designed indecision task.
Yes and no. In this case, I will answer no. Now I go to transaction SWIA to check workflow log. The first log entry is log for workflow for the whole workflow process. Every workflow starts with WS and this is basic workflow process.
We can see that whole workflow status is completed. The only dialog task status is completed as well. What means that the user answered the question and process is finished. Now we will do the test, the same test, but we will answer Yes, we go to transaction SWDD, enter.
Last workflow is our workflow. We go to test. We set the container data, enter.
Execute. Work item was created. We can shortly look in SWAI transaction. We can see that workflow is in status started and our dialog task is in status ready. What means it waits for any user to do some action.
We log in as workflow agent and we will right now answer yes. We go to SAP business workplace. Again, workflow is waiting for us. Double click. Congrats, employee of the week.
Do you want pizza? Yes, sure. Now I refresh SWIA transaction.
And what happened? We can see that dialogue task with question was completed. And later, another one task.
This is the grand step was executed and it is completed right now as well. What means that workflow finished successfully? I can see a new email in my email box pizza order. When I double click, I can see the content we have created.
Workflow was finished completely. Workflow was finished successfully. Email was sent. Great.
we have created our first workflow. It's done. We can just go for beer.
Thanks for watching. If you're interested in more such a content like ABAP programming, workflow designing or general SAP consulting work, please consider subscribing this channel. Share this video with other people that would benefit this type of content.
If you have some comments or maybe any questions, Suggestions what we should record more? Just put it in the comment area below. I hope you have learned something new. See you in the next video.