Send mail step

Mike Pokraka wug at workflowconnections.com
Thu Mar 6 07:37:02 EST 2008


Hi,

Avoid exits for anything that cannot be easily accomplished by other means
unless you have a high volume WF and performance issues. I'd certainly not
recommend it for sending mails. Your visibility is gone and it becomes
impossible to debug in production.

This is just my opinion, but I happen to be dealing with this exact
problem at the moment. Actually... it's keeping me employed for another
couple of weeks, so maybe I should just shut up :-)

Cheers,
Mike


On Sat, March 1, 2008 11:59 am, Philip Kisloff wrote:
> Hi Ashish
>
> I understand your requirement is to send e-mails to people attached to a
> particular position or work center, retrieved from a custom table. You've
> successfully created a method to retrieve the email address to be used
> with
> a subsequent sendmail step's import elements ADRESSSTRINGS with TYPEID set
> to "U".
>
> All I was doing was pointing out that a separate background step is not
> necessary if you use a workitem exit in the sendmail step. The example
> code
> I gave uses as import element the user ID (called Recipient), but you
> should
> change the code to use the import element(s) of the method you created.
> The
> call to BAPI_GET_DETAIL also needs to be change to what you have in custom
> method, but with the same end result (email address) exported to import
> element ADDRESSSTRINGS.
>
> It's more efficient this way, but if I've come too late with the
> suggestion,
> using a prior background step as you've done already is cool.
>
> Phil
>
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of
> Ashish Nagpal
> Sent: 01 March 2008 07:16
> To: SAP Workflow Users' Group
> Subject: Re: Send mail step
>
> hi philip
>
> well like your idea...but to tell you first i had the necessity of
> identifying the person at run time to whom i was trying to send the
> mail..may be if i knew the person before hand then it would have been
> perfect to call from workflow container and just send the mail to an
> id.
>
> what say??????
>
> On 2/29/08, Kisloff, Philip B <Philip.Kisloff at astrazeneca.com> wrote:
>> Hi Ashish
>>
>> Have you thought of using a workflow exit? It saves creating a step.
> Here's
>> an example that takes "Recipient" as a userID from the workflow
>> container
>> element, but you can use something else to cross check your custom
>> table.
>>
>> Regards
>>
>> Phil
>>
>> method if_swf_ifs_workitem_exit~event_raised .
>>
>>  constants:
>>    c_pos_ref_element_name type swfdname value 'Recipient'.
>>
>>  data: lh_container type ref to if_swf_ifs_parameter_container.
>>
>>  data:
>>    ws_return type bapiret2,
>>    lt_return type standard table of bapiret2.
>>
>>  data:
>>    ls_userid    type xubname,
>>    ls_address   type bapiaddr3,
>>    ls_retcode   type i.
>>
>>  case im_event_name.
>>
>>    when if_swf_ifs_workitem_exit~c_evttyp_before_create.
>>
>> * Get WorkFlow container
>>     lh_container = im_workitem_context->get_wf_container( ).
>>
>>      try.
>>          call method lh_container->get
>>            exporting
>>              name  = c_pos_ref_element_name
>>            importing
>>              value = ls_userid.
>>
>>        catch cx_root.
>>      endtry.
>>
>>      call function 'BAPI_USER_GET_DETAIL'
>>        exporting
>>          username = ls_userid
>>        importing
>>          address  = ls_address
>>        tables
>>          return   = lt_return.
>>
>>      read table lt_return into ws_return index 1.
>>      check ws_return-type <> 'E'.
>>
>> * Get WorkItem container
>>      lh_container = im_workitem_context->get_wi_container( ).
>>
>>      try.
>>          call method lh_container->set
>>            exporting
>>              name       = 'AddressStrings'
>>              value      = ls_address-e_mail
>>            importing
>>              returncode = ls_retcode.
>>
>>        catch cx_swf_cnt_cont_access_denied.
>>        catch cx_swf_cnt_elem_access_denied.
>>        catch cx_swf_cnt_elem_not_found.
>>        catch cx_swf_cnt_elem_type_conflict.
>>        catch cx_swf_cnt_unit_type_conflict.
>>        catch cx_swf_cnt_elem_def_invalid.
>>        catch cx_swf_cnt_container.
>>      endtry.
>>
>>      call method lh_container->set
>>        exporting
>>          name       = 'TypeID'
>>          value      = 'U'
>>        importing
>>          returncode = ls_retcode.
>>  endcase.
>> endmethod.
>>
>> -----Original Message-----
>> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]On Behalf
>> Of
>> Ashish Nagpal
>> Sent: 29 February 2008 12:02
>> To: SAP Workflow Users' Group
>> Subject: Re: Send mail step
>>
>>
>> hi vindo
>>
>> problem solved,i created my own method and call custom fm in it and it
>> solved my entire purpose
>>
>> thanks for helping out
>>
>> regards
>> ashish
>>
>>
>> On 2/29/08, Vinod Viswanathan < Vinod.Viswanathan at in.fujitsu.com> wrote:
>>
>> Hi Ashish,
>>
>>     Its a custom FM and not a standard FM so it wont make sense for me
>> to
>> give to the name of the FM because I created it and will not be
>> available
> in
>> your system.  You have to create a Function Module using SE37 instead of
>> your report and add your logic for fetching email addresses.  Then
>> create
>> your BOR method using this FM.
>>
>>     I think you must go through some basic documentation of how to use a
> BOR
>> method and how to bind values from the workflow to the method.  As of
>> now,
>> Create input and output parameter for the method linked to the FM and
>> then
>> pass values from and to the Standard Task by binding the variables.
>>
>>
>> Best Regards,
>> Vinod Viswanathan
>> Workflow Consultant
>> Fujitsu Consulting - Pune
>> Phone: +91 20 40722000 Extn:2370
>>
>>
>>
>>   _____
>>
>> From: sap-wug-bounces at mit.edu [mailto: sap-wug-bounces at mit.edu] On
>> Behalf
> Of
>> Ashish Nagpal
>> Sent: Friday, February 29, 2008 7:43 AM
>>
>> To: SAP Workflow Users' Group
>> Subject: Re: Send mail step
>>
>>
>>
>>
>> HI Vinod
>>
>> thanks once again for the reply,can you please tell me which custom FM u
>> used for ur purpose,in my case i have enhanced my object type and
>> created
> a
>> new method which will serve my purpose and rest of the part is same as u
>> r
>> saying,in my case i am retrieving email id from table AD_SMTPADR,but i
> have
>> one problem with the method i have created ,i get the value into the
>> container of method,but can u please tell me how should i set the value
>> which i am getting when giving the input.
>>
>> i am using a report in the method so that whenever i give customer id i
> will
>> get his/her email id ,the entries of which i have maintained in my Z
> table.
>>
>> please clear as much as possible
>>
>> thanks once again
>> best regards
>> ashish
>>
>>
>> 2008/2/26 Vinod Viswanathan < Vinod.Viswanathan at in.fujitsu.com>:
>>
>>
>> Hi Ashish,
>>
>> 1.  I have been using a custom FM so far.  May be relevant for you too
>> because i believe these email ids are being stored in some custom table
>> in
>> your case.
>>      Do let me know if there is a method that works better and gives
> better
>> efficiency.
>>
>> 2.  u need to create a BOR method using this FM... bind the import
>> export
>> parameters of the method. Create a task. Then bind the workflow and the
> task
>> parameters.
>>
>> Hope this helps.
>>
>> Best Regards,
>> Vinod Viswanathan
>> Workflow Consultant
>> Fujitsu Consulting - Pune
>> Phone: +91 20 40722000 Extn:2370
>>
>>
>>
>>   _____
>>
>>
>> From: sap-wug-bounces at mit.edu [mailto: sap-wug-bounces at mit.edu] On
>> Behalf
> Of
>> Ashish Nagpal
>>
>> Sent: Tuesday, February 26, 2008 1:32 PM
>>
>> To: SAP Workflow Users' Group
>> Subject: Re: Send mail step
>>
>>
>>
>> hi vinod
>>
>> thanks for the reply,yeah it was relevant ,one more thing i want to ask
>> if
>> you could please explain:
>>
>> 1. how to fetch those email ids to internal table,do i need to make my
>> own
>> function module
>>     or is there any standard like rh_get_structure i can use.
>>
>> 2. secondly,how to pass this internal table to workflow container.
>>
>> if you can please explain these steps,i have a little confusion over it
>> .
>>
>> thanks a lot
>>
>> regards
>> ashish
>>
>>
>> On 2/26/08, Vinod Viswanathan < Vinod.Viswanathan at in.fujitsu.com> wrote:
>>
>> Hi Ashish,
>>
>> give the recipient type as U (email address) in the mail tab of the send
>> mail step.
>>
>> you can fetch email addresses in an internal table and pass it to the
>> workflow container.
>>
>> this table can be passed as expression and the email will go to the
> external
>> email ids.
>>
>> please let me know if this solution was relevant to your question.
>>
>>
>>
>>
>> Best Regards,
>> Vinod Viswanathan
>> Workflow Consultant
>> Fujitsu Consulting - Pune
>> Phone: +91 20 40722000 Extn:2370
>>
>>
>>   _____
>>
>> From: sap-wug-bounces at mit.edu [mailto: sap-wug-bounces at mit.edu] On
>> Behalf
> Of
>> Ashish Nagpal
>> Sent: Tuesday, February 26, 2008 7:33 AM
>> To: SAP Workflow Users' Group
>> Subject: Re: Send mail step
>>
>>
>>
>> hi vinod
>> can you please elaborate on what u said "Change the type to 'U' in the
> send
>> mail step"
>>
>> it will be so nice of you
>>
>> thanks a lot
>>
>> regards
>> ashish
>>
>>
>> On Tue, Feb 26, 2008 at 5:43 AM, < kaukabr at yahoo.com> wrote:
>>
>>
>> Depends on your address strings, notification is an
>> e-mail FYI hope you will be using send description
>> method.
>> Regards
>> AZ
>> --- "Devireddy Swathi (Dataflo)"
>>
>> < devireddy.swathi at dataflo.co.za> wrote:
>>
>> > Hi,
>> >
>> > My requirement is to send e-mails to people attached
>> > to a particular
>> > position or work center.
>> >
>> > And I retrieve them from a custom table.
>> >
>> > Can I use a standard mail step to send e-mails by
>> > giving an expression
>> > and sending it to them.
>> >
>> > But this actually sends a notification and not an
>> > e-mail.
>> >
>> > Is there a background job which converts these
>> > notifications to e-mails
>> > by fetching corresponding users attached to the
>> > position/workcenter
>> >
>> >
>> >
>> >
>> >
>> > Thanks & Regards
>> >
>> > Swathi Devireddy
>> >
>> > Coke SCALE
>> >
>> > Satyam Computer Services Ltd
>> >
>> > * : +27 745024070
>> >
>> >
>> >
>> >
>> >
>>
> ----------------------------------------------------------------------------
> ----
>> >
>> > This email and all contents are subject to the
>> > following disclaimer:
>> >
>> > " http://www.dataflo.co.za/emaildisclaimer.htm"
>> >
>> >
>> >
>>
>>
> ----------------------------------------------------------------------------
> ----
>> > > _______________________________________________
>> > SAP-WUG mailing list
>> > SAP-WUG at mit.edu
>> > http://mailman.mit.edu/mailman/listinfo/sap-wug
>> >
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>>
>>
>>
>>
>> --
>> life is all about the moments that take ur heart away
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>>
>>
>>
>>
>>
>> --
>> life is all about the moments that take ur heart away
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>>
>>
>>
>>
>>
>> --
>> life is all about the moments that take ur heart away
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>>
>>
>>
>>
>>
>> --
>> life is all about the moments that take ur heart away
>>
>>
>
>
> --
> life is all about the moments that take ur heart away
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>





More information about the SAP-WUG mailing list