cancel
Showing results for 
Search instead for 
Did you mean: 

Determine Approver for Purchase Requisition

Former Member
0 Kudos

Hi All,

Please help me. I'm new in workflow.

I'm currently enhancing a copy of standard workflow WS20000077 to have an email notification functionality,  which sents an email into the SAP Inbox and External email of the approver.

I have created a program exit where I will do the email functionality instead of the email step.


What I want to know is how could I get the name of the approver upon creation of the PR, I need to get the names of the 1st approver, 2nd approver and so on to be able to send the email.

Please do give me a sample, if its ok with you.

Thanks in Advance.

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member787072
Participant
0 Kudos

Hello Franco,

This are even not clear now,

What actually is the requirement?

  • Do you want to  do an Implicit/Explict enhancement for sending email notification to Next level of approver when a PO is created ?

         Or

  • Are you working on workflow itself and enchancing the standard workflow to do this ? If so use rule 20000026, Just run PFTC and give this rule number and click on simulate icon , pass the importing paramenters if any and you would see the agent name.

         --->Here agent name is based on Relcode and other stuff , becuse for each release code you would

              find different agent.

  • If you want to use this rule and figure out the agents based on Relcode, use RH_GET_ACTROS or search for RH* FM's and pass this rule yo would get the username and use BAPI_USER_GET_DETAIL FM and pass the user name you will get the email address.


First of all clearly let us know , what actually is the requirement and figure out how agents are maintained,

It can be through a custom table , rule, role etc...

Hope you got our point right, make the things very clear so that we can give the best

Regards,

Prasad.

Former Member
0 Kudos

Hi All,

Thanks for the initial replies.

What I would like to know is, is there an FM able to get the details of the next approver, or get the next release code of the PR and I will select the details of the approver in tables.

Currently I was only able to get the release code and details of the current approver, but not the next approver.

Rushikesh_Yeole
Contributor
0 Kudos

HI,

Please let us know how the approvers are determining or approving the PR now? without workflow?

If workflow is already establised then no need to go for approver determination.

If approval process not in place, then find the suitable workflow template and assigned.

If there is any custom approval process already in place then map in workflow and then go for email notifcation.

Email notification is not big task.

You need to integrate current approval process and Email notifcations and workflow together. Both can not be run separate.

SandySingh
Active Contributor
0 Kudos

Hello

You can get the approver of the PR from rule 20000026 (Go to Transaction PFAC) or FM ME_REL_GET_RESPONSIBLE.

Regards

Sandy

Former Member
0 Kudos

May I now how to populate ME_REL_GET_RESPONSIBLE in se37, for a sample running. I have searched the internet there werent any samples.

Thanks Sandy.

SandySingh
Active Contributor
0 Kudos

Hello

You can also test this FM via transaction PFAC

  • Go to Transaction PFAC -> enter rule no 20000026 > Hit 'Display'
  • Hit "Simulate Rule resolution' shift+F8
  • Pop up appears - enter - Release code and Purchase requisition and hit 'Execute Test'
  • You will see the agents in the pop up box - type and agent ID

Regards

Sandy

former_member787072
Participant
0 Kudos

Hello Franco Veras,

can you elaborate what kind of enhancement you did it to the Requisition release workflow?

And can you let us know how approvers are maintained?

Please post the information so that we can help you better..

Regards,

Prasad

Former Member
0 Kudos

Hi Prasad,

Thanks.

My requirement in the enhancement is to create an email notification, that will be sent to the approvers of the purchase requisition. Emails should be sent to SAP inbox and the external email of the user and emails should only be sent once the PR is release or save.

So I need to determine the name of the next approvers, to get their details.

Is there any ways to get those details in program exit?

Regards,

Franco

Rushikesh_Yeole
Contributor
0 Kudos

There are many ways to sned notification for approval:

1. Through workflow

2. Through custom programs

3. Through standard scheduled programs

4. Customizing

Please describe in detail. If you are going to continue with workflow, then please avoid custom programs.

If you want to change email subject, body completely then go for

1. Program RSWUWFML2 OR

2. Add custom task/activity background method for business object and send email. You will get approver names from workflow directly

anjan_paul
Active Contributor
0 Kudos

Hi,

  I think best way will check the table EBAN, CDHDR and CDPOS to get the approver name.