Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CGEY - ADR10482:
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
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 Bodytext:
Container Elements:
1. DEADLINE1
2. DEADLINE2
3. DEADLINE3
4. DEADLINE4
Changed Bodytext:
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.
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.
Solution
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.
1. Saved
2. Submitted for Approval
3. Approved
4. Rejected
5. Sent back for correction
6. Paid