WorkflowTips & Tricks
Ulrich MendeMende EDV Beratung
Session Code: 3206
Workflow Tips & Tricks : 3206
Deadline Calculation with SAP Calendar Functions
Deadline calculation should be based on the active factory calendar in the SAP system.Working time should be used as the Offsets in deadline calculation.Weekends and holidays have to be omitted.
Example: In case an Approver did not complete his/her workitem after 2 working days deadline processing will send a mail to a responsible person.
Workitem arrives: Monday, 4:00 p.m.Mail should arrive: Wednsday, 4:00 p.m.
Workitem arrives: Friday, 4:00 p.m.Mail should arrive: Tuesday, 4:00 p.m. (not Sunday 4:00 p.m.)
Workflow Tips & Tricks : 3206
Setup deadline calculation in activity dynpro LatestEnd
Workflow Tips & Tricks : 3206
Use radio box „Expression“ for your own calculation of deadline date and time
Expression for deadline date
Expression for deadline time
Workflow Tips & Tricks : 3206
Notes for the solution
- An agent can execute the workitem only after it arrived in his inbox a calculation regarding workitem creation time is of interest
- Workitem creation time is not known at workflow creation time deadlines can not be calculated before starting the workflow
- Deadline calculation must be carried out in the workflow at runtime ABAP coding in an BOR object type (method or virtual property) is needed
- Deadlines should be set for tasks of several BOR object types (FIPP, MARA ...), but these types should not be changed or subtyped
- Consequence: Special object type for deadline calculation
Workflow Tips & Tricks : 3206
Special BOR object type ZDEADLINE
Numerical offset relating to workitem creation time
Time unit for offset (minutes, hours, days)
Factory calendar for calculation (table TFACD)
Calculates date for deadline using factory calendar( FM END_TIME_DETERMINE)
Calculates time for deadline using factory calendar( FM END_TIME_DETERMINE)
Workflow Tips & Tricks : 3206
Definition of ZDEADLINE-elements in the workflow container
Workflow Tips & Tricks : 3206
F4
Set up key values for ZDEADLINE object by „Triggering events“ or by „Initial values“
Workflow Tips & Tricks : 3206
Use virtual properties of ZDEADLINE object as deadline expressions
Workflow Tips & Tricks : 3206
Textdatei Text file
ABAP code of object type ZDEADLINE
Workflow Tips & Tricks : 3206
Workitem Selection in a productive system
Workitems are sorted by IDLots of workflow- and object instances in the list
Workflow Tips & Tricks : 3206
F 13007STARTED
E 13008STARTED
W 13009COMPLETED
F 13234STARTED
W 13236COMPLETED
B 13413COMPLETED
W 13414READY
WI_CHCKID = 13007
WI_CHCKID = 13234
Multi step items (Subworkflows)
Single step Items
Workitem hierarchy, modelled in table SWWWIHEAD
Find a toplevel WIto a given WI going upthe hierarchy by field WI_CHECKID
Find a toplevel WI to a givenBOR object instanceIn table SWW_CONTOB
Find all WIs, relatedto a toplevel WIgoing down thehierarchy recursively
Workflow Tips & Tricks : 3206
A n y WI-ID, if not toplevel, toplevel is found
STARTED, COMPLETED, CANCELLED, ERROR
Task of Type WS or WF
BOR object type
Key of BOR object instancewildcards are allowed
Date and time of workflow creation
Selection screen of report Z_FILTER_WF
Workflow Tips & Tricks : 3206
Type is always „F“
Basic list of report Z_FILTER_WF (ALV-list of toplevel workflows)
Task and object type are corresponding
Full key of object instance
Count of WIs in the workflow
Toplevel IDs
Workflow Tips & Tricks : 3206
6 days between creation of workflow and last WI22.000 WI-IDs between
workflow and last WI
Workitem Selection for the result of report Z_FILTER_WF
Workflow Tips & Tricks : 3206
Textdatei Text file
ABAP code of filter report Z_FILTER_WF for workitem selection
Workflow Tips & Tricks : 3206
Thank you for attending!Please remember to complete and return your evaluation form following this session (session code = 3206).