Skip to Content

Objective:

To trigger workflow from Dynamic Action. We will consider a scenario in which during Org. Reassignment, based on Action Type and Reason for Action, we want to trigger mail to specific user.

Prerequisite:

1.      Basic knowledge in Dynamic Action

2.      Basic knowledge in Workflow

Procedure:

1.      Create object type in SWO1

2.      Building workflow using SWDD and linking from SWE2

3.      Writing code in Dynamic Action view V_T588Z

Step 1: Create object type in SWO1

Create object type as ZZZ_JLINK1 with event Trigger and create a parameter in event as mentioned below.

Refer the below link for more details for basic idea in workflow.

http://scn.sap.com/docs/DOC-58404

WF1.JPG

Step 2: Building workflow using SWDD and linking from SWE2

Create new workflow from SWDD and create workflow container PERNR as below with properties checked for import and export.

WF2.JPG

Ensure Binding as below.

WF3.JPG

Add step for sending mail and then inside task, make sure you have container element WF_PERNR.

WF4.JPG

Mention the user and then specify subject and contents accordingly in Mail tab.

WF5.JPG

Do the linking as below in SWE2.

WF6.JPG

Step 3: Writing code in Dynamic Action view V_T588Z

Write the below code in v_T588Z for Infotype 0001. Here P refers checking the condition and we are checking MASSN for ‘02’ value and MASSG for ‘03’ value.

F refers calling subroutine. TRIGGER_WORKFLOW is the subroutine in ZZZ_JAYTEST1 program which holds the triggering part. In program, we are triggering workflow. We are using PERNR as container element which will be populated with values in workflow.

WF7.JPG

Output:

Do the action for Org. reassignment in PA40. You can see mail getting triggered in SBWP.

WF7a.JPG

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply