2006 Sep 20 8:03 AM
Hi all,
Please solve this problem in workflow. I have a set of possible agents for a Manager to whome he should be able to forward his workflow items. This is maintained in customized table. I want to dynamically fetch these agents for the manager so that he should only be able to forward the work item to certain people (whom he is configured in the Z table).
Please tell how to achieve this run time determination of forwarding agents.
Thanks
Nagraj
Hi all,
Please solve this problem in workflow. I have a set of possible agents for a Manager to whome he should be able to forward his workflow items. This is maintained in customized table. I want to dynamically fetch these agents for the manager so that he should only be able to forward the work item to certain people (whom he is configured in the Z table).
Please tell how to achieve this run time determination of forwarding agents.
Thanks
Nagraj
2006 Sep 20 8:16 AM
You can do this by creating your own rule and linking it to the task container.You can use the SAP FM RH_GET_ACTORS to get all the possibleagents and copy and modify it to suit it as per your conditions.
2006 Sep 20 8:20 AM
You can have a look at this function developed by me for dynamic determination of agents.rules can be created using transaction PFAC.
FUNCTION Z_FIND_SUPERIOR.
*"----
""Local interface:
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
*"----
INCLUDE <CNTN01>.
TYPES : BEGIN OF TY_USERS.
INCLUDE STRUCTURE ZUSERS.
TYPES : END OF TY_USERS.
DATA : ORG_AGENT LIKE WFSYST-AGENT,
LT_HOLDERS TYPE STANDARD TABLE OF SWHACTOR,
LWA_HOLDERS TYPE SWHACTOR,
LT_USERS TYPE STANDARD TABLE OF TY_USERS,
LWA_USERS TYPE TY_USERS,
V_LEN TYPE I,
V_BNAME LIKE ZUSERS-BNAME,
NUM_LINES TYPE I.
*Read values assigned to the rule criteria
SWC_GET_ELEMENT AC_CONTAINER 'ORG_AGENT' ORG_AGENT.
*Get the length
CLEAR: V_LEN,V_BNAME.
V_LEN = STRLEN( ORG_AGENT ).
V_BNAME = ORG_AGENT+2(V_LEN).
*Get the superior
SELECT SINGLE * FROM ZUSERS INTO CORRESPONDING FIELDS OF LWA_USERS
WHERE BNAME = V_BNAME.
IF NOT LWA_USERS IS INITIAL.
REFRESH LT_HOLDERS[].
LWA_HOLDERS-OTYPE = 'US'.
LWA_HOLDERS-OBJID = LWA_USERS-ZSUPERIOR.
APPEND LWA_HOLDERS TO LT_HOLDERS.
APPEND LINES OF LT_HOLDERS TO ACTOR_TAB.
ENDIF.
DESCRIBE TABLE ACTOR_TAB LINES NUM_LINES.
IF NUM_LINES IS INITIAL.
RAISE NOBODY_FOUND.
ENDIF.
ENDFUNCTION.
2006 Sep 20 8:20 AM
hi chk thsi.
a sample
***************
data : lt_act_container type standard table of swcont,
lt_actor_tab type standard table of swhactor,
l_act_role type hrobjec_14.
READ ACTORS
call function 'RH_GET_ACTORS'
exporting
act_object = l_act_role
ACT_TASK =
ACT_WI_ID =
ACT_PLVAR =
SEARCH_DATE = SY-DATUM
ACTOR_CONTAINER_OO =
tables
actor_container = lt_act_container
EXCLUDED_AGENTS =
actor_tab = lt_actor_tab "will be cleared
ERROR_TAB =
exceptions
no_active_plvar = 1
no_actor_found = 2
exception_of_role_raised = 3
no_valid_agent_determined = 4
no_container = 5
others = 6.
if sy-subrc <> 0
and lt_actor_tab2[] is initial.
raise nobody_found.
endif.
rgds
anver
if helped amrk points
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |