cancel
Showing results for 
Search instead for 
Did you mean: 

No agent found for workitem (PFAC)

glauco
Active Contributor
0 Kudos

erro-agents-5.png

erro-agents.png

erro-agents-2.png

erro-agents-4.png

erro-agents-3.png

Hi.

I created a PFAC rule which has a function module that append the agents in actor_tab.

I copyied that standard general decision task to new one and configured it im my workflow task.

Now I forced the append command for my SAP user, inside the function called by PFAC, and when I test it in PFAC transaction it works fine.

But when triggering workflow, it shows error messages in the log which says no agent found.

But the work item has READY status.

Yesterday, the workflow was working fine and determining agents and it was configured to that standard general decision task.

It stoped working when I configured my new one decision task (because I must use variables in work item body when it is in SBWP).

I've changed it to general task but even this way, it is not determining agents.

Tryied SWU_OBUF, SWI1_RULE (to redetermine), but it is not working anymore.

Sumankalyan17
Participant

Can you please provide some snapshots of the rule from PFAC and the rule FM code?

glauco
Active Contributor
0 Kudos

Hi.

Yes, but I just can do this in 7 hours from now ok.
I'll try to add it here for you.

glauco
Active Contributor
0 Kudos

Sorry @suman1717.

I forgot to take screenshots for you.

Only tonight. ok ? more 7 hours. unfortunatelly.

Accepted Solutions (1)

Accepted Solutions (1)

glauco
Active Contributor
0 Kudos

Solved.
I did not executed SCC1, to transfer the configuration to the test mandant, after setting as general task. 😕

Answers (2)

Answers (2)

former_member186746
Active Contributor

Hi,

For transporting agent assignments of tasks you can use report RHMOVE30.

Kind regards, Rob Dielemans

glauco
Active Contributor
0 Kudos

Hi. here you are.

Our workflow is based on ZTABLE for configure approvers by werks, etc.

So the functional inserted information for sap users by werks in this table.

With the sales -order (from BUS2032 BO), we search for correct users to approve this sales document.

I copyed a standard function to mine (this forum has examples to copy functions to be used in PFAC rules or I can search here in my history in se37 if it wasn't already deleted).

The actor tab here is passed back to the workflow task (from PFAC and from function) automatically.

So. no need to bind ACTOR_TAB to WF to here.

Just bind the fields you use for your search, coming from WF if you have some.

But the sales order is needed in my case as main key to search for sales order though.

My workflow has a global variable called nivel_atual (current_level for approve)

Inside the workflow I add 1 to this level, after each approve .

images and code bellow.

pfac1.png

pfac2.png

pfac3.png

pfac4.png

pfac5.png

pfac6.png

FUNCTION z_sd_search_aprov_sales_order.
*"----------------------------------------------------------------------
*"*"Interface local:
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
*"----------------------------------------------------------------------
INCLUDE <cntain>.

DATA: * current approve level (wf flow count it until last level) lv_nivel_atual TYPE char2, " e.g 01, 02, 03 " e.g. lv_workflow WS90000010
* wf id used in a ZZ table of configuration by workflows ids
 lv_workflow TYPE zsdconfig-id_workflow, 
lv_ordem_venda TYPE vbak-vbeln.


swc_get_element ac_container 'workflow' lv_workflow. swc_get_element ac_container 'nivel_atual' lv_nivel_atual. swc_get_element ac_container 'sales_document' lv_ordem_venda. " sales document
SELECT SINGLE * FROM vbak INTO ls_vbak WHERE vbeln = lv_ordem_venda.
IF sy-subrc = 0. SELECT * FROM vbap INTO TABLE lt_vbap WHERE vbeln = lv_ordem_venda. IF sy-subrc = 0. ENDIF.
SELECT SINGLE * FROM kna1 INTO ls_kna1 WHERE kunnr = ls_vbak-knkli. IF sy-subrc = 0. ENDIF.
ENDIF.
"...(some searchs in Ztables of approvers user sap names type US) " for current level " WF flow send current level by container " based on sales order werks, etc. " fill ACTOR_TAB here for work item approvers for this current level
loop at Zapprovers.
MOVE 'US' TO actor_tab-otype. MOVE ztable-usuario TO actor_tab-objid. APPEND actor_tab.
endloop.
SORT actor_tab BY objid. DELETE ADJACENT DUPLICATES FROM actor_tab COMPARING ALL FIELDS.
IF actor_tab[] IS INITIAL. RAISE nobody_found. ENDIF.
ENDFUNCTION.