Triggering Workflow from Dynamic Action
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.
1. Basic knowledge in Dynamic Action
2. Basic knowledge in Workflow
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.
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.
Ensure Binding as below.
Add step for sending mail and then inside task, make sure you have container element WF_PERNR.
Mention the user and then specify subject and contents accordingly in Mail tab.
Do the linking as below in SWE2.
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.
Do the action for Org. reassignment in PA40. You can see mail getting triggered in SBWP.