Question:
Hi all,
I need urgent help with this problem.
I am doing the Purchase Req workflow. I need to send an email to Requistion Creator. In the Send mail step, if I use User ID, it goes to SAP Inbox. I need the mail to go his Groupwise Inbox.
If I enter userid@companyname.com, then the email goes to the Groupwise inbox. I need to read the User's email id from his User Data.
Anything I need to do in Configuration or Send Mail step to make this work.
Thanks.
Linda
Answer:
Hello Linda,
I have had the same issue with sending an email to the purchase order creator. The code attached is that of an additional attribute in a business object type. It gets the purchase order from the business object in the workflow, determines the user name of the person who created the PO and retreives the SMTP email adress from the user data in SAP. You can use this code as a template to create an attribute in your object type.
GET_PROPERTY EMAILPOCREATOR CHANGING CONTAINER.
TABLES: USR21,
ADR6.
DATA: PO TYPE EKKO-ERNAM.
SWC_GET_PROPERTY SELF 'PurchaseOrder' PO.
SELECT SINGLE * FROM EKKO
WHERE EBELN EQ PO.
SELECT SINGLE * FROM USR21
WHERE BNAME EQ ekko-ernam.
SELECT SINGLE * FROM ADR6
WHERE ADDRNUMBER EQ USR21-ADDRNUMBER
AND PERSNUMBER EQ USR21-PERSNUMBER.
object-emailpocreator = adr6-smtp_addr.
SWC_SET_ELEMENT CONTAINER 'EmailPOCreator' OBJECT-EMAILPOCREATOR.
END_PROPERTY.
The attribute 'EmailPOCreator' is virtual, with ADR6-SMTP_ADDR as field reference.
Good luck,
IJsbrand.
_________________
DRIRI
Answer:
Hi Linda,
'BAPI_USER_GETDETAIL' is a more standard way of obtaining a user's external e-Mail address, but driri's suggestion of a direct select would work too I guess.
Regards,
Tim
Answer:
Thanks driri and Max.
I used a different solution. I let the Work Item go to SAP Inbox and then used the program RSWUWFML to send e-mails to their inbox. Forwarding addresses to be maintained in SO12.
I didn't want to select e-mail ids for all as some of them are Power users (who will create most requisitions) and they will be in SAP all the time and they don't want to recieve so many emails.
Thanks anyways.
Linda