Changing SENDER in FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' ?
hi,
i am using call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
for sending emails in plenty of abaps.
Now i have a problem with one abap: i want to change the SENDER of the email, depening on the clerk, to which a customer belongs.
BUT: i can't find the point where i can change the sender of the email, it is always the user who is running the abap.
Any ideas ?
regards, Martin
Hi Martin,
You can pass the old FM and change the FROM name.
tale a look at the code.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = x_doc_data
put_in_outbox = c_x
<b> sender_address = l_it_support_email</b> sender_address_type = c_smtp
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
* SENDER_ID =
TABLES
packing_list = it_packing_list
* OBJECT_HEADER =
contents_bin = it_content
contents_txt = it_body_content
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
receivers = it_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
l_message = c_send_mail_error.
ENDIF.
Check the highlighted line.
Hope this helps.
Cheers
VJ
If it helps dont forget to mark points
Similar Messages
-
How to change sender's name in FM SO_NEW_DOCUMENT_ATT_SEND_API1
Hi Friends ,
I am using FM "SO_NEW_DOCUMENT_ATT_SEND_API1"
I want to change sender's name in this Fm. Actully when i am using this FM , in place of sender my name is goign but i want to send system name.
Please help in this.
point will be assign,Hi,
Have a look on the following code,it sends an email with attachment to the SAP inbox
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
w_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
w_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZCS_FORM6'
importing
fm_name = v_form_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
Replacing space by ~
TRANSLATE i_tline USING '~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~'.
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Refresh: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear w_objhead.
Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES v_lines_bin.
Object with main text of the mail.
i_objtxt = 'Find attached the output of the smart form.'.
APPEND i_objtxt.
i_objtxt = 'Regards,'.
APPEND i_objtxt.
i_objtxt = 'Chandu Valluri'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
Document information.
w_doc_chng-obj_name = 'Smartform'.
w_doc_chng-expiry_dat = sy-datum + 10.
w_doc_chng-obj_descr = 'Smart form output'.
w_doc_chng-sensitivty = 'F'. "Functional object
w_doc_chng-doc_size = v_lines_txt * 255.
Pack to main body as RAW.
Obj. to be transported not in binary form
CLEAR i_objpack-transf_bin.
Start line of object header in transport packet
i_objpack-head_start = 1.
Number of lines of an object header in object packet
i_objpack-head_num = 0.
Start line of object contents in an object packet
i_objpack-body_start = 1.
Number of lines of the object contents in an object packet
i_objpack-body_num = v_lines_txt.
Code for document class
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Smartform_output' '.pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = sy-uname.
i_reclist-express = 'X'.
i_reclist-rec_type = 'B'. "SAP User
APPEND i_reclist.
Sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = w_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc = 0.
write:/ 'This is successful'.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward,if useful.
Thanks,
Chandu -
How to change Sender mail addres in sapconnect.
Hi,
I have searched this and i have found a thread, but i cant see it because when i click the link, giving a message "No message Found". Can you open this thread?
https://forums.sdn.sap.com/click.jspa?searchID=738174&messageID=1287908
Anyway, is it possible to change sender address when i am sending mail with FM SO_NEW_DOCUMENT_SEND_API1 ? How ?
I looked at fields of structures, but i haven't found a field to change sender addres.
Thanks
IbrahimHi Ibrahim,
i can't also use the Link.
I use for sending this FM:
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_DATA
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
SENDER_ADDRESS = 'SAP_USER' "Your SAP User
SENDER_ADDRESS_TYPE = 'U'
TABLES
PACKING_LIST = OBJ_PACK
CONTENTS_TXT = OBJ_TXT
CONTENTS_BIN = OBJ_BIN
RECEIVERS = REC_LIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
Perhaps you can use this FM
Regards, Dieter -
Change sender e-mail notification
HI.
I implement Service Desk E-Mail Functionality.
How can I change Sender this e-mail notification to constant address (support @ myconpany.com for example)?
At present Sender is the Person who make change in support notification.
Thank you.Hey,
In order to do that you ll have to do a specific processing method - default method is if i remember well CRM_SRVORDER_EXEC_SMART_FORM of class CL_DOC_PROCESSING_CRM_ORDER
So you ll have to copy class (takes time and energy from solman) and create your specific method that you ll replace in sppfcadm transaction.
In this method instead of using received parameter IS_MAIL_SENDER; create your own one for example
// data ls_mail_sender type SWOTOBJID.
assign the sender that you want to it, for example: support @ myconpany.com
don t forget to replace is_mail_sender by ls_mail_sernder when calling module function
//* call function to process smart form (new forms)
// CALL FUNCTION function_name
that should be fine
Good luck
Khalil -
Mail arbitrarily changes sender or recipient names!!!
I have realized that Mail 4.0 changes sender and/or recipient names on a lot of my emails under SL: if I check the actual email address it is the correct, intended one, but the associated name is taken randomly from address book!!!
I was wondering if anyone has been experiencing similar issues.Ok, even more info: My actual Address Book is perfectly fine. But if I hit the "Address" button in Mail.app, thats when I get the corrupt/mismatched list of e-mail addresses. This is strange as I would think this list would pull from the same place the actual Address Book application pulls from. Perhaps there is some sort of cache that can be reset or something? Clearing "Previous Recipients" did not work.
-
Change sender address when use function SO_NEW_DOCUMENT_SEND_API1
The requirement need change the sender address when use function SO_NEW_DOCUMENT_SEND_API1.
for example,the fixed sender is '[email protected]'. how to change the sender address. could you please
provide a instance?Hi 莫言,
As explained in mail home wiki here, this function module is obsolete and complex to use, please use CL_BCS instead. You can find lots of example there. And it is pretty easy to change sender address using CL_BCS instead.
Best regards,
Jerry -
Hi All,
I have a requirement of sending the data available in an internal table via email. I need to populate this content into excel sheet and send it as an attachment to recipients. I am using the following code for that.
REPORT z51515t_doc_att.
DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA : BEGIN OF itab OCCURS 0,
pernr LIKE p0001-pernr,
name LIKE p0002-vorna,
END OF itab.
Creation of the document to be sent
File Name
doc_chng-obj_name = 'SENDFILE'.
Mail Subject
doc_chng-obj_descr = 'Delivered Mail'.
Mail Contents
objtxt = 'My Content 1 '.
APPEND objtxt.
objtxt = 'My Content2'.
APPEND objtxt.
DESCRIBE TABLE objtxt LINES tab_lines.
Creation of the entry for the document
CLEAR objpack-transf_bin. "Will get content from content_text
objpack-head_start = 1. "Reads given row number in object header
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
Prepare content for attachment
DO 3 TIMES.
itab-pernr = 182.
itab-name = 'Prasath'.
APPEND itab.
itab-pernr = 1000.
itab-name = 'Praveen'.
APPEND itab.
ENDDO.
Populate attachment content
LOOP AT itab.
CONCATENATE itab-pernr itab-name INTO objbin-line.
APPEND objbin.
ENDLOOP.
DESCRIBE TABLE objbin LINES tab_lines.
Creation of the entry for the compressed attachment
objpack-transf_bin = 'X'. "Will get content from content_bin
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'EXT'.
objpack-obj_name = 'WEBSITE'.
objpack-obj_descr = 'MyFile.XLS'.
objpack-doc_size = tab_lines * 255.
APPEND objpack.
target recipent
CLEAR reclist.
reclist-receiver = '[email protected]'.
reclist-express = 'X'.
reclist-rec_type = 'U'.
APPEND reclist.
copy recipents
CLEAR reclist.
reclist-receiver = '[email protected]'.
reclist-express = 'X'.
reclist-rec_type = 'U'.
reclist-copy = 'X'.
APPEND reclist.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
Now using this code i am able to send out the file but the data in the XL file is not aligned properly. When i open the attachment that i receive the contents of itab appear inside the same cell - A1 of the XL sheet. I want the data to be available in different rows and columns. How do i achieve this?
Thanks,
Prasath NSee the below program it was sending the file as attach in XLS format by column and rows are properly placed ... see the
<b>Code in my program :
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode</b>
REPORT ZEMAIL_ATTACH .
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '[email protected]'.
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
wa_ekpo TYPE t_ekpo.
TYPES: BEGIN OF t_charekpo,
ebeln(10) TYPE c,
ebelp(5) TYPE c,
aedat(8) TYPE c,
matnr(18) TYPE c,
END OF t_charekpo.
DATA: wa_charekpo TYPE t_charekpo.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
* Retrieve sample data from table ekpo
PERFORM data_retrieval.
* Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
* Populate message body text
perform populate_email_message_body.
* Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'XLS'
'filename'
changing gd_error
gd_reciever.
* Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp aedat matnr
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekpo.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
* Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
* con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
* con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT it_ekpo INTO wa_charekpo.
CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
* Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
* Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
* Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
* Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Please find attached a list test ekpo records'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY
reward points if it is usefull ....
Girish -
Change sender Address when using SAP Mail via Exchange
Hi,
I'm using FM ZSO_DOCUMENT_SEND_API1 to send email with .pdf attachment. all works fine but the recipient sometimes replies to the email which I dont want to happen, so I need the email to appear to have come from an alternative address than mine.e.g. from 'saphelpdeskatxxx.com'
....code I have tried to change is Originator here...
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
EXTERN_ADDRESS = ' '
FOLDER_ID = ' '
FORWARDER = ' '
OBJECT_FL_CHANGE = OBJECT_FL_CHANGE
OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
OBJECT_ID = ' '
OBJECT_TYPE = OBJECT_TYPE
OUTBOX_FLAG = PUT_IN_OUTBOX
ORIGINATOR = ORIGINATOR <----
ORIGINATOR_TYPE = ORIGINATOR_TYPE
OWNER = ' '
STORE_FLAG = ' '
IMPORTING
OBJECT_ID_NEW = OBJECT_ID_NEW
SENT_TO_ALL = SENT_TO_ALL
ORIGINATOR_ID = SENDER_ID
but that doesnt work.
Is this something I need to do with Exchange and not SAP?
Any help appreciated.
SteveHi Aditya,
I took a copy of the SOI1 function group, called it ZSOI1. Copied Function SO_NEW_DOCUMENT_ATT_SEND_API1 to Z version. In there there's a call to FM ZSO_DOCUMENT_SEND_API1
In call arguments set SENDER_ADDRESS to desired static email address, then set SENDER_ADDRESS_TYPE = 'SMTP' - it was that statement that I was stuck on for months
Hope that helps,
Steve -
I cannot change send emails from iOS5
Hi all,
I have an old "mac.com" userID Apple and I made a new "me.com" email address that I use on iCloud.
Everything works fine, except on my iPhone 4. I cannot send email from my me.com address from the phone.
I found out that in "Preferences>iCloud>Account" my email is the mac.com userID and not the me.com email address.
I think the phone tries to send emails using "mac.com" account, therefore the SMTP doesn't match.
I checked on the iCloud Account Informations on my preference pane of my iPhone and the "mac.com" email address in written in light grey, which means that I am not able to change it.
Any suggestions?
Thank you
G.S.Hello,
Who is your eMail provider, the part after the @ sign?
In Mail's Window Menu, choose Connection Doctor, any red dots for status, if so what is the message?
Then click the Show Details button & Check again. -
Hi experts,
I m using SO_NEW_DOCUMENT_ATT_SEND_API1 function moduel for sending mails to dealers. That is, whenver i execute a Z transaction, the customer invoice details are getting displayed in report output. At the same time, the same output data is sent as mail to the respective dealers.
Now teh user is asking whether there is any possiblity for the end users to have a proof of the mail which is being sent from the Z transaction. If the mail is sent, the end user who executes the Z transaction (mail sending transaction) should have that mail in his/her SENT ITEMS. If the mail not reaches the dealer, then the user must identify the mail bounce identification.
Pls tell me how to achve the same..
Regards,
ShanthiHi,
Yes it is possible..
Just pass 'X' to the exporting parameter 'put_in_outbox'. The user can check the send mail in 'sost'. All the details of the mail will be there. This will be the proof that the mail was sent.
Reg the 2nd part of your query, if the mail is not delivered to any reciepent or to particular recipient, the details will be there in the SAP outbox, that also you can see through transaction 'sost'.
Thanks & Regards
Rocky -
Mail Send Functionality using SO_NEW_DOCUMENT_ATT_SEND_API1
hi,
i m using Fn Module "SO_NEW_DOCUMENT_ATT_SEND_API1" to send email with attachment.
I have written a program which will fetch data in excel format . this excel should be sent as attachment to specified receiver. however i m having difficulties adding attachment to function module.
I specified under parameter "contents_bin" but its giving some error message related wth structure.
I chkd SDN and wasnt able to find any resolution yet.
Any suggestion or idea which can be useful on this.
Thanks.REPORT zsendemail .
PARAMETERS: psubject(40) type c default 'Hello',
p_email(40) type c default 'write email address' .
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
*START-OF-SELECTION.
START-OF-SELECTION.
Perform populate_message_table.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*& Form POPULATE_MESSAGE_TABLE
Adds text to email text table
form populate_message_table.
Append 'Email line 1' to it_message.
Append 'Email line 2' to it_message.
Append 'Email line 3' to it_message.
Append 'Email line 4' to it_message.
endform. " POPULATE_MESSAGE_TABLE
*& Form SEND_EMAIL_MESSAGE
Send email message
form send_email_message.
Fill the document data.
gd_doc_data-doc_size = 1.
Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Add the recipients email address
clear it_receivers.
refresh it_receivers.
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
append it_receivers.
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
endform. " SEND_EMAIL_MESSAGE
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM -
Change Sender of Mail for PO pdf layout
Dear All,
We send PO layout via mail to the vendors .For this process , we use standard program SAPFM06P .
According to standard program , the sender of mail is creation of PO ,however , We need to change the sender . Is there any way to change the sender as user-exit or any way ?
Thanks ,
Best Regards
DashHello,
do you find a sollution for this problem?
We have the same problem.
regards! -
Workflow changes - send reminder email on X - 1 days ... based on Molga
Hello Everyone,
I new to workflow and I came across a workflow scenario where I am confuse, that what should I do in order to make it work. Luckily we are running only one workflow in the system which is time off request, We copied standard workflow class u201CCL_PT_REQ_WF_ATTRIBSu201D to Z version and introduced some new method to send email to employees managers as well as employee and HR .
We also have something called workflow item cancel thing . Lets say if workflow is not approved by manger within X bossiness days it got cancel and employee has to submit the new time off request again. After doing a little bit research I came to know that there is standard job which checks and calculate the X days thing. Work flow is running fine from last 1 year.
Last week, we been asked to create reminder from X-1 day and sends to employee manager saying u201C This is a reminder and one day is left u201C .
I wanted to know how I can achieve that, I have to filter the employee by reading employeeu2019s molga as we want to do it for specific countries then I have to read employee manager which I can do using different FM and then I have to send email to employee's manager .
Like I said It should happen BEFORE x-1 business days when employee submits the time off u2026
Here what I am thinking , I can read table u201CSWWWIHEADu201D with field WI_TYPE = u2018Wu2019 . and pass work_id to FM " SWW_WI_CONTAINER_READ " and read the container like the INCLUDE MWS20000081HO01
CALL FUNCTION 'SWW_WI_CONTAINER_READ'
EXPORTING
wi_id = wi_id
READ_FOR_UPDATE = ' ' *
TABLES
wi_container = wi_container
EXCEPTIONS
container_does_not_exist = 1 "message from function
others = 99.
IF SY-SUBRC = 0.
SWC_GET_ELEMENT WI_CONTAINER 'ACTUALSTATE' ACTUALSTATE130100.
ELSE.
CLEAR ACTUALSTATE130100.
ENDIF.
IF ACTUALSTATE130100 = 'N'.
CALL TRANSACTION 'WS20000081M'.
LEAVE PROGRAM.
ENDIF.
From container I can read employee number and approver . Get molga via pernr and can filter the employee ..who ever submits the request system date u2013 4 .. I can send out the reminder email u2026
Is there any other way around or any other efficient way of doing that u2026 I hope you understand this thing is conditional u2026 As far as I am concern I new to workflow so please bear with me ..
Waiting
Khan
FYI- I have gone through several post which task about deadlines monitoring Etc .. using fork & wait blah blah .. but It didnu2019t get any clue where to start and how to start u2026Mike,
I think I am following you so for .. so here what I did ... I opened the "approve process" and slap in the same refer date/time in "Requested end date " with variables "&WFDATA.DEADLINEDATE&" "&WFDATA.DEADLINETIME&" with 1- DAY . I didnu2019t find this what it says in help " It is possible to specify a negative time interval. Negative time intervals should only be used in connection with an expression as a reference date/time. You then have the option of "backward deadlines"
Any way after that I changed action to "modeled" and say "outcome "reminder from UK " .
it creates a node with clock sign , now like you said , I can do many things here .. and I really need to do something for example , I need to check the employee if he/she is from UK , after that reads his/her manager and send an email to mangeru2019s outbox . UK gave us an email format which I have created in t-code SE60 - with Document Class "Dialog Text".
How to proceed further. Thanks for baby sitting me.
What I am thinking , I need to create a new activity as well as new method in my Zclass, in which I will check employee Molga i.e. U.K and I have to send out email based on my email text which I have created in SE61.
Iu2019m able to write code in existing method , being on the safe side I copied the existing workflow and made changes in to it . Now it comes to debugging part , Iu2019m able to find posts on SDN talks about workflow debugging . When I am entering time off request from ESS , and it is not stopping at external breakpoint , Also when I am looking at "PTARQ" to see submit WF items . It is showing me the old task "w90000012" which is original one and I copied it and my task is "w90000022" . What I have to do so when I submit time off request via ESS it calls my task . I created Task in PFTC . But nothing is happening . Please let me know what I am missing ..
I found the table for ESS leave request and able to see my task , Table name is "u2022 V_T554S_WEB"
But still waiting for answers the of above questions ...
Edited by: Saquib Khan on May 27, 2008 9:36 AM -
[Email] Change sender name
Hello,
I'm using the Email package for sending emails. In the
XSL-Transformation I have to insert a valid email adress
into the field <FROM>. It works fine, but as sender the
email adress is displayed. Can I change this into another
name??
Thanks
chrisSet sender as:
Your name &lt;email@address&gt;
Regards
Stefan
Message was edited by:
Stefan Grube -
Hi,
I am converting a smartform to PDF and then sending it as an attachment to email using FM SO_NEW_DOCUMENT_ATT_SEND_API1.
But I am getting this error. 'Error calling FM <SBCOMS_SEND_REQUEST_CREATE> in <SO_DOCUMENT_SEND_API1> with SY-SUBRC <1>'
I am passing below entries to packaging list table.
Packing list for Email Text
ls_packing_list-head_start = 1.
ls_packing_list-head_num = 1.
ls_packing_list-body_start = 1.
ls_packing_list-doc_type = 'RAW'.
Packing list for PDF
ls_packing_list-transf_bin = 'X'
ls_packing_list-head_start = 1.
ls_packing_list-head_num = 1.
ls_packing_list-body_start = 1.
ls_packing_list-doc_type = 'PDF'.
Please let me know if I am missing anything.
Regards,
NishantHi Nishant,
Please refer my below code last week only i have implemented this logic.
call function 'CONVERT_OTF'
exporting
format = 'PDF'
max_linewidth = 132
importing
bin_filesize = w_bin_filesize
tables
otf = t_otf
lines = t_pdf_tab
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4.
pdf_output[] = t_pdf_tab[].
loop at pdf_output.
translate pdf_output using ' ~'.
concatenate gd_buffer pdf_output into gd_buffer.
endloop.
translate gd_buffer using '~ '.
do.
it_mess_att = gd_buffer.
append it_mess_att.
shift gd_buffer left by 255 places.
if gd_buffer is initial.
exit.
endif.
enddo.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
*#Fill the document data.
w_doc_data-doc_size = 1.
*#Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
*#Fill the document data and get size of attachment
clear w_doc_data.
read table it_attach index w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + strlen( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
clear t_attachment.
refresh t_attachment.
free t_attachment.
t_attachment[] = it_attach[].
clear it_attach[].
refresh it_attach[].
free it_attach[].
*#Describe the body of the message
clear t_packing_list.
refresh t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
describe table it_message lines t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
append t_packing_list.
*#Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
describe table t_attachment lines t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
append t_packing_list.
*#Add the recipients email address
clear t_receivers.
refresh t_receivers.
free t_receivers.
clear : email.
select single usrid_long into email from pa0105 where pernr = wa_pernr-pernr
and subty = '0010' and seqnr = ''.
t_receivers-receiver = email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
append t_receivers.
ld_sender_address = 'HRD1'.
ld_sender_address_type = 'B'.
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
importing
sent_to_all = w_sent_all
tables
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
*#Populate zerror return code
ld_error = sy-subrc.
*#Populate zreceiver return code
loop at t_receivers.
ld_receiver = t_receivers-retrn_code.
endloop.
check it and Revert back .
Regards,
Thangam.P
Maybe you are looking for
-
HR ABAP: report catagory
Hi, How can we create or change existing report catagory? Thanks, Madhu
-
I try to 'Print booklet' and receive an eror that "the active document uses multiple page sizes..." but all the pages on my document are in the same size (as far as I know) How can I deal with this eror?
-
Query Result with pagination problem
I have a region that has a search field with a "Go" button which runs a report based on a SQL Query(PL/SQL function body returning SQL query). Works great and displays the default of 15 rows with a pagination scheme of "Row Ranges X to Y of Z(with pa
-
Hi, is there any way to installing ASM executable and database executable by diffrent operating system user. It means that there are two user one of them [tuba@pttstgen24 ~]$ id uid=500(tuba) gid=500(dba) groups=500(dba),501(oinstall) and the other o
-
I updated software but can't get my apple id to work.
I have updated and it will not let me use my apple id to start up. I did reset password but it still won't work.