cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

email notification for PO approval going to the email of appover

Former Member
0 Kudos
2,423

Hi Gurus,

May i know what configuration or steps going to used for email notification of PO for approval going to the email of approver?

Thanks,

Marina

View Entire Topic
Former Member
0 Kudos

Hi Marina,

You need to configure (t.code is SWU3) SAP Workflow to sent mails' from SAP to to systems such as Outlook or Lotus Notes. Below links'a maybe very useful for you;

http://help.sap.com/saphelp_dimp50/helpdata/EN/92/bc26a6ec2b11d2b4b5006094b9ea0d/content.htm

http://www.sap-basis-abap.com/wf/sap-workflow-faq-techniques.htm

Cheers

Former Member
0 Kudos

thanks for the info..

what is the use of t-code so23/distribution list? how can i configure this? how it helps on how to send notification to the email of approver once they have to approved PO's?

pls. help..

thanks.

karthikreddy8174
Explorer
0 Kudos
report abc no standard page heading.
tables ekes.
*select-options so_eindt for ekes-eindt.
parameters p_eindt type ekes-eindt.
ranges Lv_eindt for ekes-eindt.
lv_eindt-low = p_eindt.
lv_eindt-option = 'BT'.
lv_eindt-sign = 'I'.
lv_eindt-high = p_eindt + 5.
APPEND lv_eindt.
*PREPARE MAIL OBJECT

class cl_bcs definition load.
*data: lo_document type ref to cl_document_bcs . "VALUE IS INITIAL. "DOCUMENT OBJECT
data : it_text type bcsy_text. "TABLE FOR BODY
data : wa_text like line of it_text. "WORK AREA FOR MESSAGE BODY
data: lo_sender type ref to if_sender_bcs. "VALUE IS INITIAL. "SENDER
data: lo_recipient type ref to if_recipient_bcs." VALUE IS INITIAL. "RECIPIENT
**SELECTION SCREEN
*parameters : p_email type adr6-smtp_addr. "EMAIL INPUT
data : p_sub type char50. "EMAIL SUBJECT
*parameters : p_send as checkbox. "SEND IMMEDIATELY FLAG
***ATTACHMENT DATA
data : lv_string type string,
lv_data_string type string,
lv_xstring type xstring.
data: lit_binary_content type solix_tab,
l_attsubject type sood-objdes.
data lv_subject type sood-objdes.

start-of-selection.
select ebeln,
ebelp,
eindt,
menge from ekes
into table @data(gt_ekes) where eindt in @lv_eindt.

loop at gt_ekes into data(gs_ekes).
concatenate gs_ekes-ebeln gs_ekes-ebelp gs_ekes-eindt into lv_string separated by
cl_abap_char_utilities=>horizontal_tab.
concatenate lv_data_string lv_string into lv_data_string separated by cl_abap_char_utilities=>newline.
endloop.

* **************************************************
data: lo_send_request type ref to cl_bcs value is initial.
class cl_bcs definition load.
lo_send_request = cl_bcs=>create_persistent( ).

*mail body and subject
data: lo_document type ref to cl_document_bcs value is initial.
data: i_text type bcsy_text.
data: w_text like line of i_text .
lo_document = cl_document_bcs=>create_document(
i_type = 'txt'
i_text = i_text
i_subject = 'PO with Attachment' ).
lo_send_request->set_document( lo_document ).
* ****************************************************
* * CREATE ATTACHMENT
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = lv_data_string
* unicode_string = lv_data_string
importing
buffer = lv_xstring.
* XSTRING_STREAM = LV_XSTRING.
data: l_zipper type ref to cl_abap_zip.
data: l_data type string.

"xstring to binary
create object l_zipper.
"add file to zip
call method l_zipper->add
exporting
name = 'po.xls'
content = lv_xstring.
"save zip
call method l_zipper->save
receiving
zip = lv_xstring.
lit_binary_content = cl_document_bcs=>xstring_to_solix( ip_xstring = lv_xstring ).
"craete att
lv_subject = 'Please find Attached File '.
********************************************************
"set body
wa_text-line = 'DEAR RECEPIENT,'.
append wa_text to i_text.
wa_text-line = 'PLEASE FIND THE PO DETAILS AS REQUESTED IN THE ATTACHMENT.'.
append wa_text to i_text.
wa_text-line = 'THANKS & REGARDS , SENDER'.
append wa_text to i_text.
clear wa_text.
lo_document = cl_document_bcs=>create_document(
i_type = 'txt'
i_text = i_text
i_subject = 'Delivery Date' ).
* *******************************************************************
lo_send_request->set_document( lo_document ).
* ********************************************************************
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = lv_data_string
importing
buffer = lv_xstring.
try.
lo_document->add_attachment(
exporting
i_attachment_type = 'ZIP'
i_attachment_subject = lv_subject
* i_attachment_size = size
i_att_content_hex = lit_binary_content ).
* CATCH cx_document_bcs INTO lx_document_bcs.
endtry.

try.
lo_sender = cl_sapuser_bcs=>create( sy-uname ).
catch cx_address_bcs.
lo_send_request->set_sender(
exporting
i_sender = lo_sender ).
  endtry.
lo_recipient = cl_cam_address_bcs=>create_internet_address( 'abc@.com' ).
try.
lo_send_request->add_recipient(
exporting
i_recipient = lo_recipient
i_express = 'X').
endtry.

try.
call method lo_send_request->set_send_immediately
exporting
i_send_immediately = 'X'.
endtry.

try.
lo_send_request->send(
exporting
i_with_error_screen = 'X').
commit work.
if sy-subrc = 0.
write 😕 'Mail sent successfully'.
endif.
  endtry.