Sending email's outside SAP with grids
Hi guys,
I already use the function "SO_DOCUMENT_SEND_API1" to send emails outside SAP, but i need to insert text in to a table, format color's, letter sizes, etc
Can i send a email in html format using this function?
Can you tell me if this function can do that? If not can you tell me one that can format the text in every way that i want?
Any help would be apreciated.
Thank you all.
the below is logic for sending the salary slip to the employees email id ....
here you can replace the logic of it .
there are some internal table declared for header of the file name for the file size and for the error message and for converting it in to pdf ...etc .....
DATA W_OPTIONS LIKE ITCPO OCCURS 0 WITH HEADER LINE.
DATA : z_itcpp LIKE itcpp OCCURS 0 WITH HEADER LINE.
DATA : otfdt like ITCOO OCCURS 0 WITH HEADER LINE.
DATA : pdfdt like TLINE OCCURS 0 with header line.
DATA: NUMBYTES TYPE I.
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 i_errors occurs 0,
type(1) type c,
descr(100) type c,
End of i_errors.
w_options-tdprinter = 'POSTSCPT'.
W_options-TDRDIDEV = 'XP45'.
W_options-TDGETOTF = 'X'.
APPEND W_options.
call function 'OPEN_FORM'
exporting
device = 'PRINTER'
dialog = ' '
form = 'ZHRPAYSLIP'
language = sy-langu
options = w_options
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
exceptions
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
others = 10 .
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RDI_RESULT =
TABLES
OTFDATA = otfdt
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
OTHERS = 4.
EXPORT otfdt TO MEMORY ID 'PDFT'.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
* MAX_LINEWIDTH = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = NUMBYTES
* BIN_FILE =
TABLES
otf = otfdt
lines = pdfdt
* EXCEPTIONS
* ERR_MAX_LINEWIDTH = 1
* ERR_FORMAT = 2
* ERR_CONV_NOT_POSSIBLE = 3
* ERR_BAD_OTF = 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 .
Refresh OBJTXT. clear OBJTXT.
Refresh OBJPACK. clear OBJPACK.
Refresh objbin. clear objbin.
Refresh OBJHEAD. clear OBJHEAD.
Refresh RECLIST. Clear RECLIST.
* Creation of the document to be sent
* File Name
DOC_CHNG-OBJ_NAME = 'PAYSLIP'.
* Mail Subject
DOC_CHNG-OBJ_DESCR = 'Payslip'.
* Mail Contents
OBJTXT = 'This e-mail was sent from an automated system...'.
APPEND OBJTXT.
OBJTXT = 'Do not reply to this message.'.
APPEND OBJTXT.
OBJTXT = 'Please open the attachment to view the Payslip'.
APPEND OBJTXT.
OBJTXT = ''.
APPEND OBJTXT.
if not msgtxt1 is initial.
OBJTXT = msgtxt1.
APPEND OBJTXT.
endif.
if not msgtxt2 is initial.
OBJTXT = msgtxt2.
APPEND OBJTXT.
endif.
if not msgtxt3 is initial.
OBJTXT = msgtxt3.
APPEND OBJTXT.
endif.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
* Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
* Creation of the document attachment
CALL FUNCTION 'QCE1_CONVERT'
TABLES
t_source_tab = pdfdt
t_target_tab = objbin
EXCEPTIONS
convert_not_possible = 1
OTHERS = 2.
describe table objbin lines tab_lines.
OBJHEAD = 'Payslip.PDF'.
APPEND OBJHEAD.
** Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'Payslip'.
OBJPACK-OBJ_DESCR = 'Payslip'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
* Completing the recipient list
* Read table i_pa0105 with key pernr = pernr-pernr binary search.
loop at i_pa0105 where pernr = pernr-pernr and USRTY = '0010'.
endloop.
if sy-subrc = 0.
RECLIST-RECEIVER = i_pa0105-USRID_LONG.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
endif.
if RECLIST[] is initial.
loop at i_pa0105 where pernr = pernr-pernr and USRTY = 'MAIL'.
endloop.
if sy-subrc = 0.
RECLIST-RECEIVER = i_pa0105-USRID.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
endif.
endif.
if not RECLIST[] is initial.
* Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = ''
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.
CASE SY-SUBRC.
WHEN 0.
LOOP AT RECLIST.
* Concatenate pernr-pernr '-' RECLIST-RECEIVER(48)
into error1.
IF RECLIST-RETRN_CODE = 0.
* Concatenate error1 ': The document was sent' into
error1.
i_errors-descr = pernr-pernr.
i_errors-type = 'S'.
append i_errors.
ELSE.
Concatenate error1 ': The document could not be
sent' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
ENDIF.
ENDLOOP.
WHEN 1.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': No authorization for sending to the
recipients' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
WHEN 2.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': Document could not be sent to the
recipient' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
WHEN 4.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': No send authorization' into error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
WHEN OTHERS.
Concatenate pernr-pernr '-' RECLIST-RECEIVER(48) into
error1.
Concatenate error1 ': Error occurred while sending' into
error1.
i_errors-descr = error1.
i_errors-type = 'E'.
append i_errors.
ENDCASE.
else.
error1 = pernr-pernr.
* Concatenate error1 ': Maintain Infotype 0105.' into error1.
i_errors-descr = error1.
i_errors-type = 'M'.
append i_errors.
endif.
reward points ....
Girish
Similar Messages
-
I can't send emails off my iPad with dodo webmail??
I can't send emails off my iPad with dodo webmail??
I can't send emails off my iPad with dodo webmail??
-
Cannot send emails to .gmail address with bluewin account
My mum has an IMac (Snow Leopard) with a bluewin account and cannot send emails to a friend with a .gmail account. She gets an error message 17099, I think. Thanks for your help.
The destination of a mail message has nothing to do with locally reported errors attempting to send. If you could send, and the destination was wrong, generally all that would happen is you would get a "bounce" message that the receiver couldn't be found, and that wouldn't be instantaneous.
Real errors like you describe that occur while sending means that either there's something wrong with your SMTP configuration (settings needed to send to the SMTP server) you set up in your mail client, or the SMTP server itself has a problem.
Does this error occur with every mail you attempt to send to anyone or just that specific account? Can you send a mail to yourself? And also, which email client are you using? -
Hi, I can't send email after installed maverick with mail
hi, I can't send email after installed maverick with mail
ThanksOS X Mail: Troubleshooting sending and receiving email messages
-
Send email in html format with pdf attachment
I am trying to send an email out of SAP using an abap program in the html format with a pdf attachment. I am using the function module -SO_DOCUMENT_SEND_API1. I noticed that when i specify the body type of the message as 'RAW' I get to see the pdf attachments however when i switch it to 'HTM' I loose the attachment in the email generated. Can anyone please help me in solving this problem. Thanks!
ld_email = p_email. "All email IDs
ld_mtitle = 'Bank Statement'.
ld_format = 'PDF'. "Attachment Format
ld_attdescription = 'Statement'.
ld_attfilename = p_filename. "Name of file
ld_sender_address = p_sender_address. "Sender mail address
ld_sender_address_type = p_sender_addres_type. "INT - Internet
* 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 . "Description
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. "Description
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = 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 = 'HTM'. " THis is for BODY of mail 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. -
Cannot send email from iPad & iPhone with Virgin Media
I cannot send emails from my iPad and iPhone. I have a virginmedia.com address and I can receive but just cannot send. A message keeps saying the smpt settings are wrong. However, I have followed the tutorial on Virgin Media web site (this is how I managed to start receiving emails on my devices) but still not sending. I have looked at the settings in my MacBook Pro and all seem to be correct. Does anyone have an idea what could be wrong? I had a similar problem when I loaded Microsoft Office 365 for Mac; I had to end up calling Virgin Media (useless) and then Microsoft (useful). Anyhow I have looked at the settings on the Mac and they all seem to correspond with the ipad and iphone but still cannot send emails. V V Frustrated.
Thanks for reading.Then make sure that the settings are correct in your email account.
Check the outgoing mail server setting. Make sure that your username and password are in there.
Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional. -
Sending emails to one Contact with multiple Addresses
Hi,
I am a volunteer with youth sports, and frequently need to send emails to entire teams of kids. I have the players all listed as one contact, but have the email addresses both parents and themselves listed under their contact. When I send an email, I need it to go to all listed, Parents and Players.
Separating the contacts would be a disaster, as when I need to contact a player I always need to contact, Mom, Dad, and Player...
I did create a group for my team, thinking this was the solution to my issue. Unfortunately, when I went to send an email, it only went to one email for each player. That lead to many complaints "Why did I not get the message"...
Love everything Mac so far, but this is killing me... and may keep me away. Outllook lets me do it so easily, why not mac.
I would appreciate any help.Thanks - starting a brand new SMS rather than continuing an existing thread gave me the option of which number to choose, and the thread then switched to show all the messages related to that number.
-
Sending email from Oracle Forms with attachments
Hi,
Is there any package or option available in Oracle forms to send email with attachments?
Your reply will be highly appreciated.
Regds,
nonedaThere are a couple of ways to send email (with attachements) from Oracle Forms. Check out these links to some examples.
using OLE2 or CLIENT_OLE2 to access a mail-client via Mail-Api ( Get and set Outlook properties )
using MAILTO in conjunction with HOST or CLIENT_HOST to "start" a mail-client ( Re: Open Microsoft Outlook new massage with TO containing the email address )
using UTL_SMTP for database-side-mailing ( Re: Send mail with attachment )
Hope this helps,
Craig... -
Send Email via Outlook 2007 with "send to field" blank.
I have a simple question:
- How do I get the user's Outlook 2007 "New Email Message" box to open up when the user clicks on a button called "Send Email"?
- Outlook is the default Email client on each user
- I need the Outlook box to open, with the following values prefilled:
To: blank (so the user can type in an address)
From: [email protected]
Subject: blah, blah, blah
Body: Hello, etc...
The part I'm having trouble with is getting the Send To field to be blank or unfilled?Leonard, Thanks for the quick post..
Along with your tip, I ended up doing the following, which worked perfectly:
<cfset to_email="">
<cfset subject_text="Here is the Link to the Form..">
<cfset body_text="Welcome to the Step by Step Procedure!%0A">
<cfoutput><a href = "mailto:#to_email#?subject=#subject_text#&body=#body_text#">Click to Send Email Link to Customer</a></cfoutput>
Note: I used the %0A at the end of my Body text to help with formatting.
One other question: How do I make this code above run directly from my SPRY menu?
- Currently I have to open another form and then click on hyperlink text on the form
- I would rather bypass the new form page altogether, and just call the code from my SPRY menu?
- Here is the code behind my SPRY Drop-Down menu item:
<li><a href="form_emailLink.cfm" target="_blank">Send Form Link</a></li> -
Send Email using Second Domain with ActiveSync
Hello Apple Support!
Could you please help, we using 2x domains for our mail exchange environment.
1 domain is set as primary SMTP for mailbox, mailbox connected to Iphone with ActiveSync,
We have created possibility to send as using second domain with Distribution list in Microsoft Outlook.
Is it possible to get option on Iphone to Send As from another email address (second domain) with ActiveSync?
Thank you!
Best regards,
OscarHello, Apple Support!
Probably it is not possible, if not, can you please confirm.
Thank you!
Best regards,
Oscar -
I can't send email from my Hudl with new BT mail -...
I cannot send email since the transfer to BT mail. I can still receive but sent emails sit in my outbox. Have wasted an afternoon trying to get help from BT!
Can anyone here help please?Are you sure you have the correct settings for the outgoing SMTP server.
Server mail.btinternet.com
Port 465
SSL/TLS (always)
Authentication type Login
Username Full email address
Password email password -
Can't send email on iphone 4 with hotmail but can receive
getting an error saying no password for hotmail when i try to send email but everything works perfectly on gmail
See this discussion...
http://discussions.apple.com/thread.jspa?messageID=13031886 -
Send Email in HTML Format with Javamail.
GOD BE BLESSED!
Hello dudes,
i create a jsp page let me send emails from a database using the API Javamail.
But these emails when i send then, goes in text format only, and i want to send emails in HTML format too. Anyone can help me?
I think the Javamail API can send in HTML format.
thanks and sorry, my english is basic but i think you understand. ;)
Adler MedradoI was trying to do the same thing...I found this on the java.sun.com website somewhere. Hope it works out for you.
try {
String host = "";
String from = "";
String to = "";
String fileAttachment = fileName;
// Get system properties
Properties props = new Properties();
// Setup mail server
props.put("mail.smtp.host", host);
// Get session
Session session1 =
Session.getInstance(props, null);
// Define message
MimeMessage message =
new MimeMessage(session1);
message.setFrom(
new InternetAddress(from));
message.addRecipient(
Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("");
// create the message part
MimeBodyPart messageBodyPart =
new MimeBodyPart();
//fill message
messageBodyPart.setText("");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
// Part two is attachment
messageBodyPart = new MimeBodyPart();
DataSource source =
new FileDataSource(fileAttachment);
messageBodyPart.setDataHandler(
new DataHandler(source));
messageBodyPart.setFileName(fileAttachment);
multipart.addBodyPart(messageBodyPart);
// Put parts in message
message.setContent(multipart);
// Send the message
Transport.send( message );
}catch (Exception e){
System.err.print("Mailing error:");
System.err.println(e); -
My email was fine up until about a week and a half ago. I recieve mail, but cannot send email without the box popping up asking for a password?
Get new Mail - workaround
-
Send email to Support Team with "New" Status
Dear Expert!
My Service Desk can send email to message creator when support message have created("New" Status), but can not send email to support team. and Service Desk can send mail to Message Creator and Support Team when change Status into "IN Process". So now, I don't know why that's happen ?Please show me about that as soon as possible. Thank you very much
Thanks and Best Regards
Tru HangHi,
Please refer /people/dolores.correa/blog/2007/09/18/sending-e-mail-from-support-message .
Check the last part : Other examples Send mail to Support Team .
Hope this may help you.
Regards,
Nibu Antony
Maybe you are looking for
-
Working with .swf files in Adobe Connect
My goal is to load custom made flash (.swf) presentations into Adobe Connect and present them to an audience (not using presenter)- however I am encountering the following issues: 1. The sound within the .swfs will not play (sounds works fine everywh
-
Versions of ESS MSS business packs n about JCO jar file
Hi Frndz.. 1)I want to know the versions of ESS n MSS busines pack 2)Is there any jar file required while configuring JCO, if yes tell the name n use of that jar file Regards Rajesh 09985516859
-
Hi, I can't open my ipad. it is saying (ipad not backed up) this ipad has not been backed up, backups happen whenwhen this ipad is plugged in , locked and connected to wi-fi Ok. Iv'e connected to itunes and backed up. but It won't let me clear the b
-
When installing iTunes an error appears
My iTunes has not been able to update since late November because an error has always appeared. Then iTunes no longer recognized my iPod to I haven't been able to sync my iPod since late November either. Actually my computer started to recognize my i
-
How Jdeveloper 10g(preview) is integrated with BI Beans? What is %JDEV_HOME%/bibeans/lib/bibeans.jar? How to use it? Where I can see sample? Documentation? Thank You, sorry for bad english.