Dynamic Agent Assignment ?
Márton Zsolt
Zsolt.Marton at t-systems.co.hu
Wed Jun 20 10:38:26 EDT 2007
Hi,
1. You need only the invoice number (IncomingInvoice) as an import and obligatory element.
You can try in this way:
FUNCTION Z_GET_ACTOR.
*"----------------------------------------------------------------------
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
*"----------------------------------------------------------------------
INCLUDE <cntain>.
DATA: object TYPE swc_object.
DATA: h_object_ext LIKE rhobjects-object.
DATA: l_belnr LIKE bkpf-belnr,
l_gjahr LIKE bkpf-gjahr,
l_bukrs LIKE bkpf-bukrs.
REFRESH actor_tab.
CLEAR actor_tab.
swc_get_element ac_container 'IncomingInvoice' object.
IF sy-subrc EQ 0.
swc_get_property object 'SourceCompanyCode' l_bukrs.
swc_get_property object 'DocumentNo' l_belnr.
swc_get_property object 'FiscalYear' l_gjahr.
ENDIF.
* Select your profit center here Make sure, that only one profit center exists per invoice.
SELECT SINGLE otype
objid
INTO (actor_tab-otype,
actor_tab-objid)
FROM ZCUSTOM_TABLE
WHERE
Profit center EQ profit_center.
IF sy-subrc NE 0.
RAISE nobody_found.
ELSE.
APPEND actor_tab.
EXIT.
ENDIF.
LOOP AT actor_tab.
h_object_ext = actor_tab.
CALL FUNCTION 'RH_WF_OBJID_UNPACK'
EXPORTING
act_object_ext = h_object_ext
IMPORTING
act_object_ext = h_object_ext.
actor_tab = h_object_ext.
MODIFY actor_tab.
CALL FUNCTION 'RH_CHECK_ORG_OBJECT_EXISTS'
EXPORTING
act_object_ext = h_object_ext
authority_check = ' '
EXCEPTIONS
no_active_plvar = 1
no_org_object = 2
org_object_not_found = 3
OTHERS = 4.
IF sy-subrc <> 0.
RAISE nobody_found.
ENDIF.
ENDLOOP.
ENDFUNCTION.
________________________________
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Priya Sharma
Sent: Wednesday, June 20, 2007 4:05 PM
To: SAP Workflow Users' Group
Subject: RE: Dynamic Agent Assignment ?
Hi Marton,
Thanks a lot . At least i have got some idea how to start solving my issue.
But it will be great,if u can help me out in these queries as well:
1)Correct me if i m wrong , I need to take profit center code and WF initiator as elements in my rule container .
2)While making FM in rule ,do I need to use import parameter as profit center code and export parameter as manager.
3)Since I am not much familiar with creation of rules , it will really be helpful to me ,if u can please send me some code for rule creation similar to my scenario .
Regards
Priya
Tata Consultancy Services
Mailto: priya.sharma at tcs.com
Márton Zsolt <Zsolt.Marton at t-systems.co.hu>
Sent by: sap-wug-bounces at mit.edu
06/20/2007 07:00 PM
Please respond to
"SAP Workflow Users' Group" <sap-wug at mit.edu>
To
"SAP Workflow Users' Group" <sap-wug at mit.edu>
cc
Subject
RE: Dynamic Agent Assignment ?
Hi,
I have faced same problem a few months ago.
In your case I'll try to use a custom table with profit center and the managers (user name, position, etc) and create a rule for the agent assignement using your invoice profit center and the specified custom table.
Have fun
Zsolt
________________________________
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Priya Sharma
Sent: Wednesday, June 20, 2007 2:57 PM
To: sap-wug at mit.edu
Subject: Dynamic Agent Assignment ?
Hi All,
I am designing a WF for 2 step approval of parked invoice,tcode-FV60.
In FV60,there is a field (profit center ) to be filled. I need to use dynamic agent assignment in the approval/rejection task .
with respect to profit center code ,we have different managers who will approve the invoice.i.e-- w.r.t profit center code - 1 ,approver- maanger1 and w.r.t profit center code - 2 ,approver - manager2 and so on.
Please suggest how to go about this scenario.How can I make my workitems move to the inbox of respective managers in accordance with profit center code.
It will be great , if someone has already implemented such scenario in any WF.
Any help will be highly appreciated ..
Thanks n Regards
Priya Sharma
Tata Consultancy Services
Mailto: priya.sharma at tcs.com
Website: http://www.tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug
ForwardSourceID:NT00006466
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20070620/b2d2051a/attachment.htm
More information about the SAP-WUG
mailing list