cancel
Showing results for 
Search instead for 
Did you mean: 

Send mail for PO Approval - Workflow.

kalpeshkaran09
Explorer
0 Kudos

Hi All,

          I am a newbie in workflow and have got a requirement for sending mail to approve PO (Multiple Approval) when PO is created.  The mail content and subject for the mail would be fetched from SO10. I found from SWEL that the worflow triggered is WS20000075. I am planing to take a copy of the standard workflow WS20000075 (not sure if i need to create a new workflow) and delegate the business object BUS2012 and create the method inside it.  Now what i want to understand is

1. How do i get the list of approvers in the workflow.

2. how do i get the SO10 value in the subject of the mail?

Br,

Kalpesh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can read the text maintained with SO10 for example with function READ_TEXT. There should be lot of examples of this if you just use search.

Anyhow, I would question that why do you want to use text(s) maintained in SO10? Why don't you just use the standard email sending step and use the task editor? Is there a specific reason for this? Sure the standard email sending step has its limitations, but if you are sending just some simple plain text emails, there first choice should be the standard email step.

Regards,

Karri

kalpeshkaran09
Explorer
0 Kudos

The user wants to have the control on the text. Thus he can change the text in SO10 (Mail body & Subject) up on his wish. In this case do i need to create a method to achieve the requirement?

Br,

Kalpesh.

Former Member
0 Kudos

I have no idea how you are eventually going to send the email. Most probably you will need to develop your own method for this part. So I would add the logic for reading the text from SO10 to the same code that actually sends the email. So, yes, you need to develop a custom method for at least some of the functionality. Whenever you need to add some custom code to the solution, you need to do the delegation etc. to create custom method. (Well, you can also just create a new class with SE24, add IF_WORKFLOW interface to it, and add your coding to a static method, and then call this method from your workflow/task. This might be a good approach if you are not that familiar with the business objects.)

Regards,

Karri

kalpeshkaran09
Explorer
0 Kudos

If i am not wrong my approach should be Copy the the std workflow WS20000075, create a new task and assign it with the custom method (Method in the delegated  BO BUS2012). This custom method will hold the logic for sending mail for multiple approval and importing the text (SO10). Rite?


Br,

Kalpesh.

Former Member
0 Kudos

That sounds a correct approach.

Regards,

Karri

kalpeshkaran09
Explorer
0 Kudos

Also could you please let me know the way to get the approver list in the custom method?

Br,

Kalpesh.

Former Member
0 Kudos

You need to find out that how the approvers are found in the actual workflow itself (=what kind of agent determination it has). Then you can probably have the same logic in the method. Or if the approvers are available in the workflow container, you could just deliver them to the method through binding.

To be honest, I am not sure how easy everything is going to be. If I remember correctly the workflow that you are talking about is for the PO release. And you will have sequential workflow instances. First approver A approves the PO, then another workflow instance starts for approver B, etc. I am not sure if it works like this, but worth to check. You might run into problems, if you send the email to all approvers at once - what if approver A rejects the PO => B got is mail already, etc.

Regards,

Karri

Answers (2)

Answers (2)

kalpeshkaran09
Explorer
0 Kudos

Thanks Karri and Murali for you valuable answers.

Thanks & Regards,

Kalpesh Mehta

Former Member
0 Kudos

Hi Kalpesh,

For this, the workflow WS20000075 will suitable for your requirement and you no need to change/ custom this.

PO for multilevel --> it is based on the "Release Strategies", these configs will done by MM consultant, based on that, a PO will go for levels. To determine the agents the standard task TS20000166 will call the default rule.

Contact your MM Consultant to maintain Release strategies.

If you want to change the standard task text, you need to copy this task to a custom one and do your changes ( do not touch/change any other things, like default rules ).

Best Regards,

Murali Krishna.

kalpeshkaran09
Explorer
0 Kudos

Hi Murali,

              I believe i might have to copy the workflow WS20000075 and delegate BU2012  and create a method to get the Email subject from SO10 but then my doubt is whether i need to create one more method to send mail for multi level approval???