Obtain all Approvers in FM and store them in WF main container
I need a help to format a container via FM(abap code).
I already searched at forum but I am not able to solve this situation.
The steps below already works fine.
1 – I need to send Mail to all approvers stored in specific rule (OOCU_RESP). To do this I created a SendMail step. It is OK. I have a specific area(multiline container) to receive all approvers (import/export/multiline) is checked. Next step: To get all approvers.
2 – To get them, I created a dummy previous step and assigned a Z… Function Module. Inside FM I called the RH_GET_ACTORS FM that return the actor_tab table. It is OK.
3 - I am not getting to transfer the actor_tab neither to main container nor container of actual rule. I used the SWC_SET_TABLE but no success yet.The approvers’s data are format OK in actor_tab and administrators tables. I just need to transfer them to a specific container.
4 - The specific step where I call the FM has a General Step property. The containers has the same ref structure (TSWHACTOR).
See my FM abap code below:
CALL FUNCTION 'RH_GET_ACTORS'
act_object = object
actor_container = ac_container1
actor_tab = administrators
no_active_plvar = 0
no_actor_found = 0
exception_of_role_raised = 0
no_valid_agent_determined = 0
no_container = 0
OTHERS = 0.
actor_tab = administrators.
SWC_SET_TABLE ac_container1 'Actor_tab_r' administrators.
Thanks in advance for help.
Rob Dielemans replied
You're asking technical questions to which the answer is "Yes that is possible".
Could we go back a bit? What is the functional requirement or what is the business process. If you have an approval step which can be executed by anyone conforming to an HR rule and you also want them to be notified that an approval is pending and additionally you want them to go to the approval process from within the notification email then you simply need to model the workflow as if it only happens in SAP (so no additional mail steps!!!) and then use extended notification to notify approvers and to allow approval using urls accessible from the notifications.
The above scenario does not need additional coding.
Kind regards, Rob Dielemans