Anda di halaman 1dari 11

3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

Getting Started  Store

Community WIKI  SAP Community Welcome, Guest  Login  Register Search the Community  

ABAP Development /  ABAP Development /  SAP Business Workflow

Workflow Scenario for PO Change
Created by Former Member, last modified by Former Member on Mar 17, 2016

1. INTRODUCTION TO WORKFLOW SCENARIO 

This scenario is based on Purchase Order Change. This scenario will prove helpful to all those people who are absolutely new to WORKFLOWS in SAP. 
 There are 4 conditions to be followed in this scenario.  
Condition 1: The workflow should trigger on PO change. 
Condition 2: The PO type should be NB <standard type>. 
Condition 3: If the PO changer and the PO creator are different then, send a mail to PO creator with the subject line as follows:<PO number> is changed by <PO changer> 
Condition 4: If the PO creator does not check the mail in 10 minutes, send a Reminder Mail. As per the very first condition, the workflow should trigger on PO change that is whenever a PO is changed;
this Workflow should trigger automatically.As per the second condition, the PO that is changed should always be NB type. On any other kind of PO change, this Workflow should not trigger.As per the third
condition, who so ever changes the PO, if it is not the one who has created it, a mail should go to the PO creator to inform him that his this PO number is changed.As per the fourth condition, if the PO
creator does not checks the original mail, a reminder mail should go to him after 10 minutes, informing him about the status of the earlier mail. 
  There are some transactions that need to be used and are as follows:­ 

2. TRANSACTIONS TO BE USED SWDD ­ Workflow Definition 
(here the workflow creation will take place) 
SBWP ­ SAP Inbox 
(here we can check both the mail and the reminder mail) 
ME22N ­ Purchase Order Change 
(this is used to change the purchase order) 
PFTC ­ Task Maintenance 
(here we create a task) 
SWO1 ­ Object Builder 
(transaction used to create, display and modify business objects) 
For a beginner, the following concepts used in this scenario will prove helpful.Start ConditionDeadline MonitoringStep Types <Condition, Activity, Mail> 
 3. THE STEP­BY­STEP PROCEDURE:­ 

 The Workflow is actually built in SWDD transaction called The Workflow Builder. When we open SWDD the recently used workflow opens up, existing workflow.

 Click the create button and you will see a new workflow.

     

3.1 ­ Create 2 container elements in the Workflow container, since the values need to be transferred into those container elements. Double click on the Workflow Container Window and create. The data
transfer takes place from event ­> workflow ­> task ­> method.

3.1.1 ­ Create the first container element as creator14 of the type Workflow Initiator with table name as WFSYST and field name as INITIATOR. 

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 1/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

     

Go to the Properties Tab and in the parameter settings check the Import checkbox for both the container elements.

  3.1.2 ­ Create another container element of BOR type and name it as BUS2012 and using Business Object<BO> 2012. BO BUS2012 is used for Purchase Order.

     

Ø  3.2 ­ Click on the HAT, in the left top of screen, known as the Start Condition.

 3.2.1 ­ The tab with basic data opens up. Enter the Workflow name and Workflow Description and change the release status to Released.

     

Click on the Start Events tab ­ here we will give our start conditions.

  3.2.2 ­ Give the category as BO...object type as BUS2012 and event as Changed.<Because WF should trigger on PO change>.

Now press active and click √, the Active button goes GREEN.

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 2/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

     

3.2.3 ­ Now click the Binding button. Drag and Drop the elements from the container and equate them. Click "√" and the binding button goes GREEN.

     

 3.2.4 ­ Now click the Condition Tab. Here we have to specify the condition of PO type should be NB...NB type PO's are standard PO. Click the _EVT_OBJECT

     

 Click on the PurchasingDocType container Element and equate it to NB. We will get a condition in the last Rectangular Window. 

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 3/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

     

Ø  Click "√" and this completes the Start of the Condition..!! 

 Now SAVE and go back. The workflow now should look like this.  

     

 3.3 ­ Now double click on the un­defined step, create a Condition step since we have to put a condition of checking where creator and changer are not­equal/equal. Creator14 will contain the value of
one who has created that PO and _Wf_Initiator will contain the value of the one who has changed that PO. 
 Click on "Click here to create new condition" and give the following condition. 

     

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 4/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki
Click "√" and the following screen appears. 

     

Ø  Click "√" and the following screen appear.

     

NOW IF BOTH <creator and changer> ARE SAME, WE DON'T HAVE TO DO ANYTHING.BUT IF BOTH ARE DIFFERENT WE HAVE TO SEND A MAIL WITH DEADLINE MONITORING OF 10
MINS.

  Ø  3.4 ­ Go to that "both are different line" and then create an ACTIVITY.

  Ø  The screen asks for a task, we have to create a new task now.

     

Ø  3.4.1 ­ Go to transaction PFTC, select STANDARD TASK from task­type.

  Ø  Click on create and the following screen appears.

  Ø  3.4.1.1 ­ Fill in the following details and save the task.Here ABBR is the name of the task.NAME is the description of the task.RELEASE STATUS should always be released so that we can use the
task after releasing only.WORK ITEM TEXT will act as the subject line of task, as we have to send a mail with this description as the subject line.  The OBJECT CATEGORY/METHOD/TYPE are the ones
that we have already used.

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 5/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

     

Ø  3.4.1.2 ­ Click the Binding Button and press Transfer, and with that Automatic binding will take place. After that the binding will show Green.

     

After that the task will be created. Now simply we have to use this task name in that activity and then press Enter. You will see some buttons going GREEN.  Now assign the agents. Select the option user
and give the server name of the creator. Since the recipient of the mail is the creator.  The screen appears like this.

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 6/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

     

Ø  3.4.2 ­ Now clicks the LATEST END tab for DEADLINE MONITORING of 10 minutes and insert the following values.

     

Ø  Click "√" and Go back to the main screen.

     

Ø  3.5 ­ Now on the Reminder mail branch create a SEND MAIL <reminder mail> step type.

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 7/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki
 Ø  Now Insert the following values in the Mail Step Type. In ABBR and NAME give any Z name of your choice.   

     

Ø  Now Click "√" and the screen appears like this.

     

Now the scenario portion is complete as of now. The thing is that we have to complete the workflow after sending a reminder mail. 

Ø  3.6 ­ For that we use a Step Type called as PROCESS CONTROL. After the send mail activity create the process control step type to end the workflow.

  Ø  Now insert the following values in the process control.

     

Ø  4.0 ­ THE COMPLETE WORKFLOW SCENARIO IS LIKE THIS..

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 8/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

     

Ø  Now once the WORKFLOW is complete, SAVE & ACTIVATE the workflow. Remove all errors and warnings. It should activate with 0 errors and 0 warnings..!!

   5.0 ­ NOW COMES THE CONCEPT OF HOW TO CHECK THE FOLLOWING

1>   How to trigger the Workflow?

2>   How to change the Purchase Order?

3>   How to check for the EVENT TRACE?

4>  Where to check whether Workflow has started or not?

5>  Where to check for the actual Mail and the Reminder Mail?

    Ø  5.1 ­ Now go to transaction SWE4 ­ EVENT TRACE SWITCH ON/OFF. Click on SWITCH ON.

   Ø  5.2 ­ Now go to transaction ME22N ­ The Transaction for PO Change. Choose a standard PO <NB Type>. Change any value, like Quantity, description and simply Save the PO.

   Ø  5.3 ­ Now go to Transaction SWEL ­ DISPLAY EVENT TRACE.Click EXECUTE.  

   Ø  Now we can see here the BO used is shown and the Workflows that are associated with it are also there. The status of workflow is also shown with being active/error. The Date and Time of the
Workflows is also shown.

     

Now we know that our workflow has triggered, that means our purchase order has changed and the PO is of NB type. Now the issue is that we have to check whether the person who has created or
changed the PO are same or different. If they are different, we should get a mail.  For this what we have done earlier is that, on the server which we are working, we have created the 2 users. One user is
to create the PO and other user to change the PO. So that they both can be different and we can get a mail. Another thing that we can do is that go to the condition step type and change the condition
from equal to not­equal, and use the same server without any user.This will be simply for checking if other users on server are not available, as this is not the correct method. 
    Ø  5.4.1­ Now we move to Transaction SBWP ­ SAP INBOX. Click OUTBOX and Click STARTED WORKFLOWS. There we can see our Workflow being started.

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 9/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

     

Ø  5.4.2 ­ Now go to INBOX ­> WORKFLOWS, here you can see your mail being sent as an activity to the PO Creator.

     

Ø  Do not double click on this activity and do not Confirm Work Item. As doing this would mean PO creator has checked the mail and there is no need of reminder mail.

     

In case if YOU choose to click Complete Work Item, This would remove the activity from the workflows and hence, no reminder mail would be there.

Ø  5.4.3 ­ To check for the Reminder Mail, wait for 10 minutes. Go to INBOX ­> UNREAD DOCUMENTS. Here we can see the Reminder mail.  

      
Here we find that our Workflow Scenario is complete.     
 
 
No labels

1 Child Page
  Brief Overview of Workflow Step­Types

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 10/11
3/5/2019 Workflow Scenario for PO Change - ABAP Development - SCN Wiki

9 Comments
Former Member
Hi Kanika,

 I followed your helpful wiki but i'm having issue during the check phase. I created a PO with user X then I changed the PO with user Y, but the workflow states that creator and initiator are the
same user so no message is triggered.

Luca

Former Member
Hi Luca, Thats because in step 3.2.3, EVT_CREATOR is mapped to both the WORKFLOW_INITIATOR and CREATOR14 making them same user. The PO creator should have been
mapped to CREATOR14 actually. Regards.

Santosh Sharma
Nice document..

Thanks

Santosh Sharma

Former Member
Thank you @Kanika Chopra ! It was excellent guide to create the first Workflow.

Former Member
Very useful demo, thankyou Kanika

Former Member
Dear Kanika Mam

                                         In BUS2012  Object PO Doc type is not Coming when Using It for Condition for Standard PO type NB . Kindly Help 

Former Member
Hello,

I too not find In BUS2012  Object PO Doc type is not Coming when Using It for Condition for Standard PO type NB.

Please help.

Former Member
I too had same issue.,try with some other fields. I tried with field from Pur.Org object→Pur. Group. It helps your learning phase for time being. Hope you like the solution.

Former Member
Dear Ms. Kanika.,

It was really useful guide. Thank you sharing. Well explained. I have a dount in the Task creation. You have mentioned the modifier name from the BUS2012. But from the screenshot the
object field is not completely visible. I tried with few other fields by guessing., It didnt show any value for modifier. Still able to create workflows with 2 different accounts. thanks again.

Contact Us   SAP Help Portal
Privacy   Terms of Use   Legal Disclosure   Copyright   Cookie Preferences       Follow SCN

https://wiki.scn.sap.com/wiki/display/ABAP/Workflow+Scenario+for+PO+Change 11/11

Anda mungkin juga menyukai