on 01-23-2012 4:27 PM
HI All,
I need to use SAP standard rule 75700139 in my fucntion module for determininig user id and based on user id for task user details are fetched.
When the rule is executed from PFAC values are entered and a key is generated wirh fetches required agents.
But i want to use function modulwe in rule directly.
PArameters are -
TABLES
ACTOR_TAB STRUCTURE SWHACTOR
AC_CONTAINER STRUCTURE SWCONT
Can anybody guide how function module can be directly used and what and how values are to be filled in these parameters.
Thanks.
You say that you want to use a standard rule inside your function module. You can simply call function module RH_RESOLVE_RESPONSIBILITIES and pass the rule number along with the needed parameters and it will execute that rule for you. Keep in mind that this function module only works if the rule uses "responsbilities." If the rule itself uses a function module, then you can call the function module directly. The AC_CONTAINER internal table is similar to a name-value pair. Look inside function module USMD5_CREQUEST_ROLE_DET which is called from within the rule you need. Instead of the macro swc_get_element, just use swc_set_element to insert values into the internal table. Make sure you add the statement "INCLUDE <cntain>." at the beginning like that function module does. The other internal table ACTOR_TAB is a simple internal table in which the first field is an object type: O for org unit, US for user, P for personnel number, etc. The second field is the object key; so if the type is US then the key is the user ID you want to assign as an agent and if the type is O then the key is the org unit number you want to assign as an agent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sanj,
If you want to see the data passed into your function at runtime then set a breakpoint in your function and in the same session open PFAC and test the rule with the Simulate button. Execution should stop at the breakpoint and you can see the data held in the parameters. If it does not stop at the breakpoint then create an SAP shortcut on your desktop with:
Type: System Command
Command: /h
When you simulate the ruleyou get the popupand enter the test data. Now drag the shortcut over the 'Continue' button and now you are in de mode.Now just set a breakint in your function and it will stop there and you can check the data.
Regards,
Eddie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sanj,
ACTOR_TAB will be the table returned from the Function Module. It will contain the Agents determined from the Rule.
AC_CONTAINER is the Container from your Workflow/task.
It should contain entries for elements CHANGE_REQUEST, APPSTEP, SINGLE_PROC and AGENT_FILTER.
AGENT_FILTER is optional.
You can execute the FM in SE37 Test mode and fill the values and test.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.