Skip to Content
0
May 22, 2008 at 01:51 PM

Workflow changes - send reminder email on X - 1 days ... based on Molga

523 Views

Hello Everyone,

I new to workflow and I came across a workflow scenario where I am confuse, that what should I do in order to make it work. Luckily we are running only one workflow in the system which is time off request, We copied standard workflow class u201CCL_PT_REQ_WF_ATTRIBSu201D to Z version and introduced some new method to send email to employees managers as well as employee and HR .

We also have something called workflow item cancel thing . Lets say if workflow is not approved by manger within X bossiness days it got cancel and employee has to submit the new time off request again. After doing a little bit research I came to know that there is standard job which checks and calculate the X days thing. Work flow is running fine from last 1 year.

Last week, we been asked to create reminder from X-1 day and sends to employee manager saying u201C This is a reminder and one day is left u201C .

I wanted to know how I can achieve that, I have to filter the employee by reading employeeu2019s molga as we want to do it for specific countries then I have to read employee manager which I can do using different FM and then I have to send email to employee's manager .

Like I said It should happen BEFORE x-1 business days when employee submits the time off u2026

Here what I am thinking , I can read table u201CSWWWIHEADu201D with field WI_TYPE = u2018Wu2019 . and pass work_id to FM " SWW_WI_CONTAINER_READ " and read the container like the INCLUDE MWS20000081HO01

CALL FUNCTION 'SWW_WI_CONTAINER_READ'

EXPORTING

wi_id = wi_id

  • READ_FOR_UPDATE = ' ' *

TABLES

wi_container = wi_container

EXCEPTIONS

container_does_not_exist = 1 "message from function

others = 99.

IF SY-SUBRC = 0.

SWC_GET_ELEMENT WI_CONTAINER 'ACTUALSTATE' ACTUALSTATE130100.

ELSE.

CLEAR ACTUALSTATE130100.

ENDIF.

IF ACTUALSTATE130100 = 'N'.

CALL TRANSACTION 'WS20000081M'.

LEAVE PROGRAM.

ENDIF.

From container I can read employee number and approver . Get molga via pernr and can filter the employee ..who ever submits the request system date u2013 4 .. I can send out the reminder email u2026

Is there any other way around or any other efficient way of doing that u2026 I hope you understand this thing is conditional u2026 As far as I am concern I new to workflow so please bear with me ..

Waiting

Khan

FYI- I have gone through several post which task about deadlines monitoring Etc .. using fork & wait blah blah .. but It didnu2019t get any clue where to start and how to start u2026

.