Anda di halaman 1dari 8

Workflow Development for PITNEY BOWES

Travel & Expense Management System

Workflow Template originally designed and developed by CGEY-Mumbai.

Workflow template : WS91000040


Sub-Workflow : WS91000044
Transaction code : TRIP for SAP GUI,
TRIP_EWT for Portals( HRAccess)
Report/Prog Name : SAPMP56T
User-Exit : ZTRAVEL
Enhancement : FITR0005 (User Exit: Save Trip (TRIP, PR01, PR04, PR05) )
Function Exit : EXIT_SAPMP56T_003
Include : ZXTRVU05

R/3 System : HRD-010

CGEY - ADR10482:

1. Call function module POPUP_TO_CONFIRM to display the Save and Submit


buttons.
2. When the user clicks SAVE, the Travel Expense Report (Trip) is simply saved
in SAP.
3. When the user clicks SUBMIT, the workflow is triggered.
4. Create the object key concatenating the trip number and the employee
number and export to memory (as perform on commit cannot have
using/changing parameters.)
5. Initiate the workflow when a COMMIT work is executed by the TRIP
transaction. Use function SWE_EVENT_CREATE for this purpose.
6. Call function module POPUP_TO_INFORM to display the disclaimer text.

Custom Business Object


Custom business object needs to be created as events for sending email to lotus
notes and sending email to manager need to be incorporated.

1. Copy the standard Business Object BUS2089 for Trip Created in transaction
SWO1 and name it is ZBUS2089.
2. Create Method SEND_MAIL_TO_MANAGER.
3. Pass the employee number, Organizational Unit & Position as the import
parameter.
4. Derive the manager for the Employee number, which is passed. Use ORGEH
and tables HRP1001 for this purpose.
5. Create Method SEND_MAIL_TO_NOTES.
6. Using the import parameters, create the body header and body text and call
the function 'SO_NEW_DOCUMENT_SEND_API1' to send email to Lotus Notes.

Workflow Template
1. Create a new workflow template 91000044.
2. The container will contain the parameters that are exported from ZBUS2089.
I.e. all text parameters
3. Add ZBUS2089 as the expression.
4. Set the Triggering event as ZBUS2089 on SUBMIT.
5. Set up the steps that the workflow would follow.
6. Create the step Derive Manager
Create a task TS91000038 and add object ZBUS2089 and event
SEND_MAIL_TO_MANAGER
7. Create the step Send email to Lotus Notes
Create a task TS91000037 and add object ZBUS2089 and event
SEND_MAIL_TO_NOTES
8. Create the decision step Approve Travel Request
Create a task TS91000029 which uses Rule 00000168 and Parameter
&EXPENSE.TRAVELERNAME& from the Expense Container Element.
9. The possible outcomes for the decision task being Approve, Return for
Correction, Reject Reimbursement of Travel & Latest End Reached.
10. Case 1: If the Expense report is to be approved, the following tasks are
executed
Task TS20000130 - Trip Approved. Object: BUS2089 & Method:
APPROVE
Task TS91000037 - Send email to lotus Notes
Workflow completed
11. Case 2: If the Expense report is to be returned for correction, the following
tasks are executed
Task TS91000037 - Send mail to Lotus Notes (of submitter), stating
that expense report is returned for correction.
Task TS91000030 Change Trip - allows the initiator to change the
expense report. Object: object BUS2089 & Method:
CHANGEINTERACTIVE.
Workflow completed
12. Case 3: If the Expense report is to be rejected, the following tasks are
executed
Task TS91000036 uses rule 00000168 - allows the user to open the
item and enter a short message for rejection while the name of the
submitter is populated. The user then needs to explicitly send the
message. Object: SOFM & Method: COMPOSE
Workflow completed
13. Case 4: If no decision on the Expense report is taken within 5 days after the
mail is received, emails are sent to both to the submitter and the manager
informing of the approval of the expense report.
A new Workflow with Template WS91000040 is initiated in this case.
A replica of the parent workflow template is created, except with the
Latest End condition in the possible outcomes
Original Expense manager Screen

Expense manager Screen after Modification


1. When an employee creates an ER then the User-Exit is triggered. Inside the user-
exit the Employee Number (PERNR) of the employee is obtained from PA0105
passing SY-UNAME. This is then checked with Submitter PERNR. If both are same
then the system allows the employee to go ahead with submission of the ER else
error message is displayed and the ER is saved.
The changes were done in include ZZTRAVELU02 of FM YSAPMP56T_003.

l_uname = sy-uname.
SELECT SINGLE pernr INTO l_pernr FROM pa0105
WHERE usrid = l_uname AND
subty = '0001' AND
endda = '99991231'.

IF trip_header-pernr = l_pernr.
Submit code.
ELSE.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = l_title
txt1 = l_txt1
txt2 = l_txt2.
ENDIF.
2. For emails triggering when approver does not take action after 5 days the subject
line and body text (excluding image of ER) is changed as follows.

Original subject: Container Element : SUB_DEADLINE

Employee cannot be paid Please Resolve

Changed Subject: Container Element : SUB_DEADLINE

Expense Report Awaiting Approval - Action Required.

Original Bodytext:
Container Elements:
1. DEADLINE1
2. DEADLINE2
3. DEADLINE3
4. DEADLINE4

An expense report was submitted by xxx on mm/dd/yyyy in the amount of $$$$.


Employee cannot be reimbursed; please resolve.

Changed Bodytext:

Travel expense report # 999999 was submitted by xxx on mm/dd/yyyy in the


amount of $$$$.

The Approving Manager is expected to take appropriate action on this expense report
immediately, and should contact the T&E Support Line if further assistance is
required.

Traveler should also follow up with the Approving Manager on this notification.

In order to get the above messages/texts the following container elements of


workflow WS91000048 were changed from their initial value.

Container Element Initial Value


SUB_DEADLINE Expense Report Awaiting Approval - Action Required.
Travel expense report * was submitted by xxx on mmddyy in the
DEADLINE1
amount of $$$$.
The Approving Manager is expected to take appropriate action on
DEADLINE2
this expense report immediately,
and should contact the T&E Support Line if further assistance is
DEADLINE3
required.
Traveler should also follow up with the Approving Manager on this
DEADLINE4
notification.
Inside the method SEND_MAIL_TO_LOTUSNOTES of BO Z_BUS2089 the
corresponding special characters are replaced by the actual values as follows:

IF l_body4 = 'CREATEDATE'.
CLEAR: l_pdate, l_body4.
swc_get_element container 'CreationDate' l_pdate.
l_body4 = l_pdate.
l_yr = l_body4+0(4).
l_mth = l_body4+4(2).
l_day = l_body4+6(2).
CLEAR l_body4.
CONCATENATE l_mth l_day l_yr INTO l_body4 SEPARATED BY '/'.
IF l_body1 CS '*'.
REPLACE '*' IN l_body1 WITH l_trip.
REPLACE 'xxx' IN l_body1 WITH l_body2 IGNORING CASE.
l_amount = l_trip_total.
SHIFT l_amount LEFT DELETING LEADING space.
CONCATENATE l_amount l_body7 INTO l_amount SEPARATED BY space.
REPLACE '$$$$' IN l_body1 WITH l_amount IGNORING CASE.
REPLACE 'mmddyy' IN l_body1 WITH l_body4 IGNORING CASE.
CONDENSE l_body1.
ENDIF.

Requirement # 4 mailed by Sudhir Rao on 03/08/2004

The following development needs to be taken up at the earliest.

1. Upload program for Infotype-17 : Gopi


2. Upload program for Infotype-105(Credit card details) : Gopi
3. Upload program for Infotype-105(Lotus Notes IDs) : Gopi
4. Populate trip number ranges : Chenna
5. To prevent duplicate entry of receipts in an expense report : Chenna

Solution

1. Report ZHTEC00001 has been developed for Uploading Infotype 17.


Transaction code : ZHTE01
2. Report ZHTEC00002 has been developed for Uploading Infotype 105
Subtype 0010 ( Email ID ).
Transaction code : ZHTE02
3. Report ZHTEC00003 has been developed for Uploading Trip No. Ranges.
Transaction code : ZHTE03
4. Report ZHTEC00004 has been developed for Uploading Infotype 105
Subtype : 0011 ( Credit Card ).
Transaction code : ZHTE04
5. This requirement is cancelled/delayed until further notice.
Requirement # 5 mailed by Sudhir Rao on 11/08/2004

The subsequent activities column in the trip expense manager screen will have the
status of the expense report.

A typical scenario for the subsequent activities column against the trip expense
report will look as below.

Display / Change Trip Expense report # 123456


Status : Saved

The following will be various statuses that are relevant.

1. Saved
2. Submitted for Approval
3. Approved
4. Rejected
5. Sent back for correction
6. Paid

Anda mungkin juga menyukai