on 11-05-2007 6:35 PM
Hi experts
I'm trying to develop a workflow that sends out email(outlook) to creator of timesheet in case his timesheet gets rejected.
Following are the steps that I did
Custom business object ZCATS which is subtype of CATS.
In ZCATS I've a background method called STATUS with reads status field in table CATSDB.
Workflow gets triggered with 'completed' event. Since 'completed' event is the only event that generates for both approval and rejection, I check using background method STATUS if field 'status' in catsdb holds value '40'(rejected). In that case I sends out a email.
Now my problem is Key field in business object CATS is different from that in CATSDB. Key field of CATSDb is COUNTER while that of business object CATS is workitem id.
I'm able to trigger my workflow but fails when it reaches the background method
How do I proceed? Any better ideas? I will make sure that I award points to any useful hints
Thanks
Jomy Joseph
Here you have the workitem Id. as the key fields now try to retrieve the Personnel number from it you can retrieve this by reading the Workflow Container using FM
SAP_WAPI_READ_CONTAINER
From the PERNR you get Counter I feel.
I also found a standard Wflow Template WS40001001 but it seems to have some issue. Make use of attribute coding in Custom Business Object to get the Counters.
Thanks
Arghadip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this link
http://help.sap.com/saphelp_erp2005vp/helpdata/en/04/928adf46f311d189470000e829fbbd/content.htm
It might be of help
make use of the Created event of CATS Business Object it passes all the Personnel number that is required in your devt.
May be youi can use SHWEHR3 to trigger this event. Also try to search the forum U will get ur answer.
Thanks
Arghadip
Hi Jomy
The key field for CATSDB is the same as the WI number, you can confirm this by either checking for an entry in CATSDB for the workitem number or through SWO1 tring to instantiate your BO.
Let me know how you go.
Regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> The key field for CATSDB is the same as the WI number, you can confirm this by either checking for an entry in CATSDB for the workitem number or through SWO1 tring to instantiate your BO.
>
I think your memory is fooling you this time, Ravi. The work item number is found in the field WORKITEMID in CATSDB - which allows the solution to reference several timewriting entries in the same approval.
If it weren't so (if the work item ID was the same as the CATS counter) the managers would be overloaded.
<i>Message was edited by Kjetil Kilhavn:</i>
Jomy, I have never set up the standard solution for approval of timewriting - so I don't know if a rejection is for all timewriting entries, or if it is possible to reject only some of those you receive for approval.
In any case, the foolproof solution is to check all the entries. You can even count the number of approved and rejected entries, and send a message to the person with specific information.
SELECT *
INTO l_catsdb
FROM catsdb
WHERE workitemid = l_cats_object_key.
* count rejections and approvals by checking l_catsdb-status
ENDSELECT.
IF l_count_rejections > 0.
PERFORM send_email
USING some_data.
ENDIF.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.