attendance.approved vs attendance.created (40B)

Danny Kelly danielmkelly at optushome.com.au
Thu Jun 21 21:31:56 EDT 2001


Hi Michel,
 
The following might help explain what is happening with REQUESTCANCELLED and
APPROVED events being published in HR.
 
If you have been entering multiple attendance records for the same day (ie.
Three records, same day different hours) you will find that the
REQUESTCANCELLED event is triggered if the records are approved out of
sequence (ie. not in the sequence they were entered). This is more likely to
happen using PA71 as more records appear on the screen and approvals can be
more easily done in any sequence. It probably hasn't happened yet via the
workflow process as they just happen to approve them in the sequence they
appear in the in-box.  The code that triggers the events checks a before
image with the after image of the request. While the SPRPS field will be
different (the code caters for this) it doesn't allow for the sequence
number being different.  When the sequence number changes the before and
after image keys don't match (after allowing for a change in the lock
indicator). Therefore, if they don't match the request must now not exist!!
Not quite correct, but this assumption means the REQUESTCANCELLED event is
published instead of the APPROVED event.
 
Eg.     If you have three records:
             PERNR      SUBTY   OBJPS  SPRPS   ENDDA         BEGDA
SEQNR    BEGUZ   ENDUZ
             00000001    0800                       X        21.06.2001
21.06.2001     000         12:00      13:00
             00000001    0800                       X        21.06.2001
21.06.2001     001         15:00      17:00
             00000001    0800                       X        21.06.2001
21.06.2001     002         21:00      23:00
 
            after approving the second record the system will delete the
record and create a new record and they will now look like the following:
 
             00000001    0800                                 21.06.2001
21.06.2001     000         15:00     17:00
             00000001    0800                       X        21.06.2001
21.06.2001     000         12:00      13:00
             00000001    0800                       X        21.06.2001
21.06.2001     002         21:00      23:00
 
              because it is the first record approved it is a completely new
record it gets sequence number '000', all subsequent approved records will
get the next sequence number. This is also why when entering multiple
attendance records and approving them out of sequence the approval message
does not always appear to be sent. If you have a WAIT step to trap when a
request is deleted the workflow will go down the WAIT step and complete the
workflow before the message is sent.
 
I originally discovered this in a 3.1 system and have worked on the theory
it hasn't changed in subsequent releases and so I code around it by checking
sequence numbers. This problem is also true for info types which allow
multiple records for the same date.
 
If you have only been entering a single attendance record and still getting
the problem then there's another problem and the above doesn't apply but
might be useful for future reference.
 
Regards
 
Danny
 
 -----Original Message-----
From:   SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU]  On Behalf Of
Michel Laviolette
Sent:   Thursday, June 21, 2001 11:49 PM
To:     SAP-WUG at MITVMA.MIT.EDU
Subject:        Re: attendance.approved vs attendance.created (40B)
 
Thanks for your quick responce Jocelyn.
 
My analysis of the event logs concluded the following:
- Record created in "Unlocked" raises CREATED
- Record created in "Locked" raises REQUESTED
- "Locked" record deleted raises REQUESTCANCELLED
- "Unlocked" record deleted raises DELETED
- "Unlocked" record changed back to "Locked" raises
     APPROVALCANCELLED & DELETED
... and here's the weird one:
- "Locked" record changed to "Unlocked" (basic approval process)
     REQUESTCANCELLED & CREATED  ***OR***
     APPROVED & CREATED
 
Our attendance workflow works without an hitch if the supervisor approves
the request via the workflow process. The 'left hook' comes when the
supervisor bypasses the workflow process and goes directly in the HR Fast
Entry mode (PA71). Doing so **** sometimes **** raises and event (APPROVED)
which I never encountered through the normal workflow process (who would
have thought that the APPROVED event would be raised in the approval
process... got me!). I've inconsistently been  able to reproduce the problem
in our dev environment. Unfortunatly inconsistent enough not to be able to
tell when it really happens.
 
Thanks again,
Michel Laviolette
 
 
 
>From: "Dart, Jocelyn" <jocelyn.dart at sap.com>
>Reply-To: SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: Re: attendance.approved vs attendance.created (40B)
>Date: Wed, 20 Jun 2001 22:43:57 +0200
>
>Hi Michel,
>I won't give you my personal opinion of the HR events because language that
>strong
>should never be put in an email, but I can perhaps give you a few clues
>based on my
>own experience with HR events.  If there's an HR person out there perhaps
>they can
>elaborate....
>
>The problem stems from the "lock indicator" field, which is used to
>indicate
>whether or
>not an HR record is active.  Some *expletive deleted* put the lock
>indicator
>in the key
>of the HR record.  So when you are going through the approval process what
>can happen is
>this:
>
>User creates original locked record: CREATED event is raised for the new
>locked record.
>Locked record is approved: APPROVED event is raised for the locked record.
>The locked
>record is then "unlocked" - because this is a change in key, this means the
>locked
>record has been deleted and a new record is created - raising the CREATED
>event.
>An unlocked record is locked again - i.e. the approval has been cancelled,
>therefore
>a REQUESTCANCELLED event is raised for the unlocked record, and the record
>is then
>locked - because this is a change in key, this means the locked record has
>been deleted
>and a new record has been created - raising the CREATED event and so on and
>so forth.
>
>If you think this is *expletive deleted* confusing you are absolutely
>correct.  I was working
>across several types of HR records - I can't remember if ATTENDANCE was one
>of them but
>the behaviour seemed to be common to a  lot of HR records.
>
>In the end for my HR workflows, I ended up using the HR event tables and
>the
>option of using
>HR event function modules to control the events to try and make sure the
>following was happening:
>
>If a record is created "locked" - raise REQUESTED event (not CREATED)
>If a record is created "unlocked" - raise CREATED event
>If a locked record is unlocked - raise APPROVED event for old record,
>CREATED for new record
>If an unlocked record is locked - raise REQUESTCANCELLED event for old
>record, REQUESTED for new record
>
>At least that way I had a consistent behaviour going that I could workflow
>against.
>But I'll admit that as a non-HR person I did get the help of some friendly
>HR folk to help
>me sort this out, and I had some HR event function module examples to work
>from.
>
>Hope that helps a little anyway.
>
>If anyone else in the SAP-WUG has some better way of handling it, I'd love
>to know it myself for future
>reference.
>Regards,
>
>Jocelyn Dart
>Consultant (BBP, Ecommerce, Internet Transaction Server, Workflow)
>SAP Australia
>Email  <mailto:jocelyn.dart at sap.com> jocelyn.dart at sap.com
>Tel: +61 412 390 267
>Fax: +61 2 9935 4880
>
>-----Original Message-----
>From: Michel Laviolette [mailto:michel_laviolette at hotmail.com]
>Sent: Thursday, 21 June 2001 5:31 AM
>To: SAP-WUG at MITVMA.MIT.EDU
>Subject: attendance.approved vs attendance.created (40B)
>
>
>Hi,
>I've been experiencing discrepancies with some of the events raised
>(created) through the HR attendance approval process. I have event traces
>(logs) indicating that the attendance approval sometimes (???) raises the
>ATTENDANCE.CREATED followed by ATTENDANCE.REQUESTCANCELLED... Some other
>times, the event ATTENDANCE.APPROVED is followed by ATTENDANCE.CREATED.
>These inconsistencies seam to originate behind the 'Fast Entry' (PA71)
>approval process. My Attendance workflow has a wait for event
>REQUESTCANCELLED which needless to say only traps half of the conditions
>listed above.
>
>My Questions:
>1) Can anyone explain why the REQUESTCANCELLED & APPROVED events are
>interchanged?
>2) If I include a wait for event APPROVED, what other processes could be
>impacted?
>
>Many thanks,
>Michel Laviolette
>Workflow Developer
>Hull Quebec Canada
>
>
>
>
>
>
>
>
>   _____
>
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
><http://www.hotmail.com> .
>
>
>
>
 
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 


More information about the SAP-WUG mailing list