cancel
Showing results for 
Search instead for 
Did you mean: 

Sending the mail to the appropriate user in the workflow.......

Former Member
0 Kudos

Hi

I want to send the "user decision" in the workflow to the appropriate user depending on the value of a variable of the previous step.

Eg:: Say if the value of the variable after the step previous to the user decision is executed - is say CHNG then the "user decision" should go to say user X. if the value is PROC then the "user decision" should go to say user Y.. so on and so forth. Using " multiple condition" option is not serving my purpose.

Can u suggest any way to do this..

Thanks

Neeraj

Accepted Solutions (1)

Accepted Solutions (1)

martin_nooteboom
Active Contributor
0 Kudos

Hi Neeraj,

You basically want to do the agent determination based on a variable. Use a rule which uses the variable as input (and maybe some more variables) to determine the agent.

Regards,

Martin

Answers (1)

Answers (1)

former_member190818
Active Contributor
0 Kudos

Hi Neeraj,

You can create an Ztable and maintain the value and agent in tat table. And then create an FM for agent determination and use this FM in Rule.

In FM, u should not give import or export parameters. Give the tables alone as

ACTOR_TAB LIKE SWHACTOR

AC_CONTAINER LIKE SWCONT.

The tcode for rule is PFAC.

Sample Code for FM.

INCLUDE <cntain>.

tables: yfi_docamt_agent. <your table name>

data: l_amount type dmbtr.

data: ls_actor_tab type swhactor.

refresh actor_tab.

cleaR: l_amount,

ls_Actor_tab,

yfi_docamt_agent.

swc_get_element ac_container 'AMOUNTLC' l_amount. <the value which u need to pass >

select single * from yfi_docamt_agent

where fromamt <= l_amount

and toamt >= l_amount.

if sy-subrc eq 0.

ls_actor_tab-otype = yfi_docamt_agent-otype.

ls_actor_tab-objid = yfi_docamt_agent-agent.

append ls_actor_tab to actor_tab.

endif.

Former Member
0 Kudos

Hi JMB

I am relatively new to workflows so can u please detail a bit more abt the procedure..

Also how will i pass the current value of the variable to the FM if the FM has no import and export parameters..

please mention any other info or any document that i can refer to for the above scenario..

Thanks

Neeraj

former_member190818
Active Contributor
0 Kudos

Hi Neeraj,

Check in yr Business Object, tat the value u r expecting is there in the attribute. If not, create an subtype of yr BO and create an attribute and do the coding to get the value. After u have done, test the BO whether tat particular attribute contains value. Then u must delegate yr subtype with yr supertype BO. For tat, goto SWO1. In menu, Settings -> Delegate. In that go for new entries and give yr Supertype BO and delegation type as yr subtype BO. So tat the value will be available in yr workflow. U can bind workflow and yr rule container element. So tat the value will be passed to yr Rule. U need to create Rule container in PFAC before tat.