Email with excel attachment...strange....
My mother is trying to send me an Excel file that she received in another email (she can't open it-doesn't have Excel). She's tried forwarding the whole email to me, dragging just the wanted file to a new email and also saving the file to her desktop and attaching to a new email. Her "sent" box says it was sent-all times. The emails never arrive. I've checked my webmail folders and nothing. She sent a straight test email with nothing attached and it arrives fine. I'm stumped....
Is your mom also using a Mac? If so, what OS is she using?
Your mom can download the freeware NeoOffice http://download.neooffice.org/neojava/en/index.php
NeoOffice is equivalent to Microsoft Office. It can open Excel files, Word files & PowerPoint files. You can also create these types of files that can be opened by PC users.
NeoOffice 2.2.5 will operate on OS 10.3 & higher
NeoOffice 3.0 requires OS 10.4
Cheers, Tom
Similar Messages
-
Send Email with Excel attachment with formatting(bold, color) in Background
Hi,
I have requirement wherein I have to send an email with excel attachment with proper formatting of certain fields in the excel sheet like making it bold or setting different color. The data is available in an internal table. Just to to format it and send an email when the program is executed in background mode.
Any pointers on this would be highly appreciated!
Thanks,
Anil.I resolved my own problem using the BCS_EXAMPLE_7 program as sample.
-
Sending an Email with Excel Attachment from Local directory
Hi,
I have a requirement : I want to send an email with an attachment which is exist on local directory and currently I am using
cl_bcs classes
Thanks,
Moderator message: Welcome to SCN!
Moderator message: please do more research before asking, show what you have done yourself when asking.
[Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
Edited by: Thomas Zloch on Aug 4, 2011 5:15 PMHi,
I have a requirement : I want to send an email with an attachment which is exist on local directory and currently I am using
cl_bcs classes
Thanks,
Moderator message: Welcome to SCN!
Moderator message: please do more research before asking, show what you have done yourself when asking.
[Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
Edited by: Thomas Zloch on Aug 4, 2011 5:15 PM -
Issue in Sending email with EXCEL attachment
Hi,
Im using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 for sending emails to a list of recipients with an excel attachment. In the attachment data, as the field length is 255 for the structure SOLISTI1, for the records having more than 255 characters, data is being truncated. I did a search in this forum and done some changes , still it is not working properly.
I have used SCMS_TEXT_TO_XSTRING, SCMS_XSTRING_TO_BINARY FMs for converting the data to hexa format. This case, records having more than 255 are displayed properly in the attachment, but there are blank lines inserted between two records.
Please suggest me to resolve this isssue.
Thanks in advance.
JayashreeHi Jayashree,
you might want to check out the example link by Saso in his post Send external email from within ABAP program to xls.
For the rest I can only guess that there might be some issues with the format you use for Excel. In case of empty lines and using a text format for Excel the issue is in most cases that there are too many carriage return line feeds in the text fiel (cl_abap_char_utilities=>cr_lf).
Hope that helps.
Best Regards
Michael -
Send email with excel attachment in outlook structure - SAP 6.0
Hello experts..
I need send a email with a excel attachment and use the signature in outlook to send.
The attachment will be create in the process of send email program.
Is it possible?
How can I created and attach in the same process?
How can I use the outlook strutucture to send a email?I resolved my own problem using the BCS_EXAMPLE_7 program as sample.
-
Send email with excel attachement
I'm using SO_DOCUMENT_SEND_API1 function to send a scheduled email with attachment.
But the problem is that the length of the string that I'm appending to the excel exceeds 256 characters.
So, the final excel file has trimmed values. Meaning only the first 255 characters are displayed.
I hope you guys understand what i'm saying.
So as I found out it seems that the above function can't be used in my case.
Do you know any other way of sending an email with attachment that meets my requirements.
Thanks,
Thilanka.Hi Buddy,
I also came across the same problem once. The only solution to this is tell your client to reduce the fields lenght which are not require.
Only 255 Char can be send on mail as per the fun Mod.
you have to reduce the length or display some data in the body of mail.
Hope this will solve your worry...
Thanks,
Krishna.. -
Hello,
I have to send an email in a workflow step with a excel attach from an internal table, Does anyone have any sugestion ?
Thanks,
DiegoHi,
Check this [thread1|send excel attachment as email; [thread2|Re: Excel attachment in SO_DOCUMENT_SEND_API1; & [thread3|Help needed for the Excel attachment to mail;.
Regards,
Surjith -
Hello friends,
I'm having an issue with excel attachmnet which is being genetaed through email using function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'...issue is getting more space on first column of the data...not header column, only space on data column. Do you have any idea what might be the reason? Thanks in advance.
Regards,
SatyaHI
Implemented this idea . Problem is while generated the excel file That is
Suppose 5 field in ur internal table then but dont want display all 5 fields
just all add ' ' if you dont want column then alignment will ready
for example
CONCATENATE CON_NEW ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' INTO IT_ATTACH SEPARATED BY CON_TAB. "***
APPEND IT_ATTACH.
with regards
anand kumar -
Sending email with excel attachment from an ABAP report
Hello All,
I am using the function module SO_DOCUMENT_SEND_API1 to send an e-mail with an excel attachment.
The code works fine for less than 255 characters in each row of excel file.But for more than 255 characters , the excel file received has data upto 255 characters only.
Can someone please suggest how to send excel file with more than 255 characters in each row ?
Regards,
KKcheck below code
FORM excelrep .
DATA :l_syuzeit TYPE sy-uzeit,
l_time(5) TYPE c,
l_ampm(2) TYPE c,
l_subject(255) TYPE c.
CLEAR t_xls.
REFRESH t_xls.
l_syuzeit = sy-uzeit.
IF t_final_data1[] IS NOT INITIAL.
PERFORM fill_header.
LOOP AT t_final_data1 WHERE status NE space.
t_xls-jobname = t_final_data1-jobname.
WRITE t_final_data1-act_start_date TO t_xls-act_start_date.
WRITE t_final_data1-est_start_time TO t_xls-est_start_time.
WRITE t_final_data1-act_start_time TO t_xls-act_start_time.
WRITE t_final_data1-est_end_time TO t_xls-est_end_time.
WRITE t_final_data1-act_end_time TO t_xls-act_end_time.
t_xls-est_duration = t_final_data1-est_duration.
t_xls-act_duration = t_final_data1-duration.
t_xls-status = t_final_data1-comment.
t_xls-process = t_final_data1-desc.
t_xls-fill10 = c_0d.
t_xls-fill1 = c_09.
t_xls-fill2 = c_09.
t_xls-fill3 = c_09.
t_xls-fill4 = c_09.
t_xls-fill5 = c_09.
t_xls-fill6 = c_09.
t_xls-fill7 = c_09.
t_xls-fill8 = c_09.
t_xls-fill9 = c_09.
APPEND t_xls.
CLEAR t_xls.
ENDLOOP.
l_ampm = c_am.
IF l_syuzeit GT c_125959.
l_syuzeit = l_syuzeit - c_120000.
l_ampm = c_pm.
ELSEIF l_syuzeit GT c_120000.
l_ampm = c_pm.
ELSEIF l_syuzeit LT c_010000.
l_syuzeit = l_syuzeit + c_120000.
l_ampm = c_am.
ENDIF.
WRITE l_syuzeit TO l_time USING EDIT MASK c_edmask.
CONCATENATE text-070 l_time l_ampm INTO l_subject
SEPARATED BY space.
CLEAR w_doc_chng.
w_doc_chng-obj_name = l_subject.
w_doc_chng-obj_descr = l_subject.
CLEAR t_objtxt.
REFRESH t_objtxt.
t_objtxt = text-068.
APPEND t_objtxt.
CLEAR t_objtxt.
t_objtxt = space.
APPEND t_objtxt.
CLEAR t_objtxt.
t_objtxt = text-069.
APPEND t_objtxt.
CLEAR t_objtxt.
t_objtxt = space.
APPEND t_objtxt.
CLEAR t_objtxt.
MOVE w_sysinfo TO t_objtxt.
APPEND t_objtxt.
CLEAR t_objtxt.
t_objtxt = space.
APPEND t_objtxt.
CLEAR t_objtxt.
CLEAR w_tab_lines.
DESCRIBE TABLE t_objtxt LINES w_tab_lines.
w_doc_chng-doc_size = w_tab_lines * c_255.
CLEAR t_objpack.
REFRESH t_objpack.
t_objpack-body_start = c_1.
t_objpack-body_num = w_tab_lines * c_255.
t_objpack-doc_type = c_txt.
APPEND t_objpack.
CLEAR t_objpack.
CLEAR t_objbin.
REFRESH t_objbin.
LOOP AT t_xls.
t_objbin = t_xls.
APPEND t_objbin.
CLEAR t_objbin.
ENDLOOP.
CLEAR w_tab_lines.
DESCRIBE TABLE t_objbin LINES w_tab_lines.
CLEAR l_subject.
CONCATENATE text-083 sy-datum l_time l_ampm INTO l_subject
SEPARATED BY c_uscore.
CLEAR t_objhead.
REFRESH t_objhead.
t_objhead = l_subject.
APPEND t_objhead.
CLEAR t_objhead.
t_objpack-transf_bin = c_x.
t_objpack-head_start = c_1.
t_objpack-head_num = c_1.
t_objpack-body_start = c_1.
t_objpack-body_num = w_tab_lines.
t_objpack-doc_type = c_xls.
t_objpack-obj_name = text-070.
t_objpack-obj_descr = text-070.
t_objpack-doc_size = w_tab_lines * c_255.
t_objpack-mess_type = space.
APPEND t_objpack.
CLEAR t_objpack.
CLEAR t_reclist.
REFRESH t_reclist.
IF s_email[] IS NOT INITIAL.
LOOP AT s_email.
t_reclist-receiver = s_email-low.
t_reclist-rec_type = c_u.
APPEND t_reclist.
CLEAR t_reclist.
ENDLOOP.
ENDIF.
PERFORM mail_report.
ELSE.
MESSAGE e015 WITH text-072.
ENDIF.
CLEAR : w_doc_chng,
t_objpack,
t_objhead,
t_objbin,
t_objtxt.
REFRESH : t_objpack,
t_objhead,
t_objbin,
t_objtxt,
t_reclist.
ENDFORM. " excelrep_criticaljobs
*& Form mail_report
text
--> p1 text
<-- p2 text
FORM mail_report .
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
commit_work = c_x
TABLES
packing_list = t_objpack
object_header = t_objhead
contents_bin = t_objbin
contents_txt = t_objtxt
receivers = t_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 NE 0.
CASE sy-subrc.
WHEN 1.
MESSAGE i015 WITH text-071.
WHEN 2.
MESSAGE i015 WITH text-072.
WHEN 4.
MESSAGE i015 WITH text-073.
WHEN OTHERS.
MESSAGE i015 WITH text-074.
ENDCASE.
ELSE.
MESSAGE s015 WITH text-081.
ENDIF.
ENDFORM. " mail_report -
Sending with email with excel attachment.
I am using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' . Its is working fine but I want display header on the top of list in excel.
I tried with inserting a row in the Internal Table (obviously the first row with index 1) with all the header contents. And after that I appended the desired data to the Internal Table. But this column taking 255 character in excel sheet. how to delete this extra space
Please help me how to add header in excel sheet.
Thanks in advance.Hi Ramu,
U can try This.
1 - Go to Tools -> Macro -> Macros. Specify any name for the macro (let's say "NoSpaces") and click "Create"
2 - Copy-paste the following code in the editor:
Sub NoSpaces()
Dim c As Range
For Each c In Selection.Cells
c = trim(c)
Next
End Sub
3 - Close the editor and come back to your excel workbook
4 - Select the cell-range and go to Tools -> Macro -> Macros. Select "NoSpaces" and then click "Run".
This will help you get rid of all the unwanted trailing spaces.
Regards. -
Problem in excel format while sending mail with excel attachment.
Hi Gurus ,
I am sending a email with Excel attachment using FM SO_DOCUMENT_SEND_API1 or SO_NEW_DOCUMENT_ATT_SEND_API1.
I am able to send a mail with excel attachment with a piece of code which I got from SDN itself.
But the problem is when I am trying to open the attachment, <b>A pop up comes which says that it is not in recognizable format. Would you like to open it?
and several other lines of caution.</b>
When i choose to open it, i get the correct data in one excel sheet. Certain vertical lines of the excel sheet is missing. <b>But no data is missing. </b>
I am attaching the code below. Can any one please tell me where is the problem in this code ?
Thanx in advance
types: begin of t_mara,
matnr type mara-matnr,
matkl type mara-matkl,
mtart type mara-mtart,
meins type mara-meins,
end of t_mara.
data: gt_mara type table of t_mara,
wa_mara like line of gt_mara,
it_packing_list type table of SOPCKLSTI1,
wa_packing_list like line of it_packing_list,
it_receivers type table of SOMLRECI1,
wa_receivers like line of it_receivers,
it_mailbody type table of SOLISTI1,
wa_mailbody like line of it_mailbody,
it_attachment type table of SOLISTI1,
wa_attachment like line of it_attachment.
data: la_doc type SODOCCHGI1.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
* get material
select matnr matkl mtart meins
into table gt_mara
from mara
up to 25 rows.
* Populate the subject/generic message attributes
la_doc-obj_langu = sy-langu.
la_doc-obj_descr = 'Material Details' . "Mail Header
la_doc-sensitivty = 'F'.
la_doc-doc_size = 1.
* Add the recipients email address
CLEAR wa_receivers.
REFRESH it_receivers.
wa_receivers-receiver = 'PCSDEVL'.
wa_receivers-rec_type = 'U'.
wa_receivers-com_type = 'INT'.
wa_receivers-notif_del = 'X'.
wa_receivers-notif_ndel = 'X'.
APPEND wa_receivers to it_receivers.
* Mail Body
CLEAR wa_mailbody.
REFRESH it_mailbody.
wa_mailbody-line = 'Please find the attachment'.
APPEND wa_mailbody to it_mailbody.
* Mail attachmwnt
CLEAR wa_attachment.
REFRESH it_attachment.
CONCATENATE 'MATNR' 'MATKL' 'MTART' 'MEINS'
INTO wa_attachment SEPARATED BY con_tab.
CONCATENATE con_cret wa_attachment INTO wa_attachment.
APPEND wa_attachment to it_attachment.
LOOP AT gt_mara INTO wa_mara.
CONCATENATE wa_mara-matnr wa_mara-matkl
wa_mara-mtart wa_mara-meins
INTO wa_attachment SEPARATED BY con_tab.
CONCATENATE con_cret wa_attachment INTO wa_attachment.
APPEND wa_attachment to it_attachment.
ENDLOOP.
* Describe the body of the message
CLEAR wa_packing_list.
REFRESH it_packing_list.
wa_packing_list-transf_bin = space.
wa_packing_list-head_start = 1.
wa_packing_list-head_num = 0.
wa_packing_list-body_start = 1.
wa_packing_list-body_num = 1.
wa_packing_list-doc_type = 'RAW'.
APPEND wa_packing_list to it_packing_list.
* Create attachment notification
wa_packing_list-transf_bin = 'X'.
wa_packing_list-head_start = 1.
wa_packing_list-head_num = 1.
wa_packing_list-body_start = 1.
DESCRIBE TABLE it_attachment LINES wa_packing_list-body_num.
wa_packing_list-doc_type = 'XLS'. " To word attachment change this as 'DOC'
wa_packing_list-obj_descr = ' '.
concatenate wa_packing_list-doc_type 'file' into wa_packing_list-OBJ_DESCR
separated by space.
wa_packing_list-doc_size = wa_packing_list-body_num * 255.
APPEND wa_packing_list to it_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = la_doc
PUT_IN_OUTBOX = 'X'
* SENDER_ADDRESS = SY-UNAME
* SENDER_ADDRESS_TYPE = 'B'
COMMIT_WORK = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
* SENDER_ID =
tables
packing_list = it_packing_list
* OBJECT_HEADER =
CONTENTS_BIN = it_attachment
CONTENTS_TXT = it_mailbody
* 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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.REPORT Zex5 LINE-SIZE 255 LINE-COUNT 255 .
class CL_ABAP_CHAR_UTILITIES definition load. "-->
TABLES : vbap.
SELECT-OPTIONS: s_vbeln FOR vbap-vbeln.
DATA : BEGIN OF itab OCCURS 1,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr,
END OF itab.
parameters : p_email like somlreci1-receiver
DATA: tlines type i.
DATA: itmessage LIKE solisti1 OCCURS 1 WITH HEADER LINE. "Ok
DATA: itattach LIKE solisti1 OCCURS 2 WITH HEADER LINE. "Ok
DATA: itpacklist LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA: itreclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
data: itattachment like solisti1 OCCURS 2 WITH HEADER LINE.
start-of-selection.
SELECT vbeln posnr matnr
FROM vbap
INTO TABLE itab
WHERE vbeln IN s_vbeln.
**Make the internal table data to be compatible in excel format .
PERFORM BUILD_XLS_FORMAT.
**Populate message of body text.
clear itmessage.
refresh itmessage.
itmessage = 'Please find attached Excel file'.
append itmessage.
PERFORM send_mail_as_xls_attachment tables itmessage
itattach
using p_email 'Excel Attachment' 'TXT' " 'XLS'
using p_email 'TEXT Attachment' 'TXT' " 'XLS'
'TestFileName'
'SalesOrders' .
*& Form BUILD_XLS_FORMAT
text
--> p1 text
<-- p2 text
form BUILD_XLS_FORMAT.
previosuly we were using for unicode ..now replaced
**Declare constants for the spacing .
*Constants : con1 type x value '0D',
con2 type x value '09'.
Constants : con1 type c
value CL_ABAP_CHAR_UTILITIES=>CR_LF,
con2 type c
value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
**For the Header descriptions.
Concatenate 'SalesORdNo'
'Item'
'Materialno' into itattach separated by con2.
Concatenate con1 itattach into itattach.
Append itattach.
**Now align the items in the itab as above .
Loop at Itab.
concatenate itab-vbeln
itab-posnr
itab-matnr into itattach separated by con2.
concatenate con1 itattach into itattach .
Append itattach.
endloop.
endform. " BUILD_XLS_FORMAT
*& Form send_mail_as_xls_attachment
text
-->P_ITMESSAGE text
-->P_ITATTACH text
-->P_P_EMAIL text
-->P_0116 text
-->P_0117 text
-->P_0118 text
-->P_0119 text
form send_mail_as_xls_attachment tables p_itmessage
p_itattach
using p_email
p_mtitle
p_format
p_filename
p_attdescription.
Data : xdocdata like sodocchgi1,
xcnt type i.
*Fill the document data.
xdocdata-doc_size = 1.
*Populate the subject/generic message attributes.
xdocdata-obj_name = 'SAPRPT'.
xdocdata-obj_langu = sy-langu.
xdocdata-obj_descr = p_mtitle.
*Fill the document data and fetch size of attachment.
clear xdocdata.
read table itattach index xcnt.
xdocdata-doc_size = ( xcnt - 1 ) * 255 + strlen( itattach ).
xdocdata-doc_size = ( xcnt - 1 ) * 255.
xdocdata-obj_name = 'SAPRPT'.
xdocdata-obj_langu = sy-langu.
xdocdata-obj_descr = p_mtitle.
clear itattachment. refresh itattachment.
itattachment[] = p_itattach[].
*Describe the body of the message.
clear itpacklist. refresh itpacklist.
itpacklist-transf_bin = 'X'.
itpacklist-head_start = '1'.
itpacklist-head_num = '0'.
itpacklist-body_start = '1'.
describe table itattachment lines itpacklist-body_num .
itpacklist-doc_type = 'TXT'.
itpacklist-doc_type = 'XLS'.
append itpacklist.
*Create attachment notification.
itpacklist-transf_bin = 'X'.
itpacklist-head_start = '1'.
itpacklist-head_num = '1'.
itpacklist-body_start = '1'.
describe table itattachment lines itpacklist-body_num .
itpacklist-doc_type = p_format.
itpacklist-obj_name = p_filename.
itpacklist-obj_descr = p_attdescription.
itpacklist-doc_size = itpacklist-body_num * 255 .
append itpacklist.
*FIll the receivers list.
Clear itreclist. refresh itreclist.
itreclist-receiver = p_email.
itreclist-rec_type = 'U'.
itreclist-com_type = 'INT'.
itreclist-notif_del = 'X'.
itreclist-notif_ndel = 'X'.
*itreclist-notif_read = 'X'.
append itreclist.
*CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = xdocdata
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
SENDER_ADDRESS = SY-UNAME
tables
packing_list = itpacklist
CONTENTS_BIN = itattachment
CONTENTS_TXT = itmessage
receivers = itreclist
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = xdocdata
PUT_IN_OUTBOX = 'X'
TABLES
packing_list = itpacklist
CONTENTS_BIN = itattachment
CONTENTS_TXT = itmessage
receivers = itreclist
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " send_mail_as_xls_attachment
Just execute the above code and let me know.
What is the sap version u r using .
Vijay -
can anyone help me... since i downloaded mountain lion when i try and forward a email with an attachment pdf or excel it will tell me in a yellow box above my recievers email address " ID problem with files" or something like that.. HELP...... thanks
Let me guess: you're using a Hotmail account.
Look what I've found, it seems to have to do with MS Silverlight. Update that, and all should be good. -
Issue in sending the email with XL attachment in ECC version
Hi,
I have an issue with sending the email with XL attachment. My program is sending a mail to the receiver with XLS as attachment. Recently we have migrated from 4.6B to ECC version. Same code was worked in 4.6B.But it is not working in ECC version.When i try to open the attachment, i get a Dialog Box with the following message
"The file is not in a recognizable format.
1. if you know the file is from another program whih is incompatible with Microsoft excel,click cancel,then open this file in its original application
2.If you suspect the file is damaged, click help for more information about solving theproblem.
3.if you still want to see what text is contained in the file, click OK.Then click the text import wizard. "
when i click OK, the excel sheet is opening with all required data.
Can anyone kindly tell me why this is happening.
I am also attaching part of the coding related to this requirement.
*& Form BUILD_XLS_DATA_TABLE
text
--> p1 text
<-- p2 text
FORM build_xls_data_table.
DATA: w_total(13),
w_clabs(13),
w_cinsm(13),
w_ceinm(13),
w_cretm(13),
w_cspem(13),
w_cumlm(13),
w_exp_date(8),
w_v_totalp(13),
w_min_rem(8),
w_ersda(10),
w_hsdat(10),
w_vfdat(10),
w_ship_date(10),
w_plnmg(13),
w_mhdrz(4).
CLEAR: w_total, w_clabs, w_cinsm, w_ceinm, w_cspem, w_exp_date,
w_v_totalp, w_min_rem, w_ersda, w_hsdat, w_vfdat, w_ship_date,
w_plnmg, w_mhdrz.
w_total = it_batch1-total.
w_clabs = it_batch1-clabs.
w_cinsm = it_batch1-cinsm.
w_ceinm = it_batch1-ceinm.
w_cspem = it_batch1-cspem.
w_cumlm = it_batch1-cumlm.
w_cretm = it_batch1-cretm.
w_exp_date = it_batch1-exp_date.
w_v_totalp = it_batch1-v_totalp.
w_min_rem = it_batch1-min_rem.
w_plnmg = it_batch1-plnmg.
w_mhdrz = it_batch1-mhdrz.
CONCATENATE it_batch1-ersda6(2) it_batch1-ersda4(2)
it_batch1-ersda+0(4) INTO w_ersda SEPARATED BY '.'.
CONCATENATE it_batch1-hsdat6(2) it_batch1-hsdat4(2)
it_batch1-hsdat+0(4) INTO w_hsdat SEPARATED BY '.'.
CONCATENATE it_batch1-vfdat6(2) it_batch1-vfdat4(2)
it_batch1-vfdat+0(4) INTO w_vfdat SEPARATED BY '.'.
CONCATENATE it_batch1-ship_date6(2) it_batch1-ship_date4(2)
it_batch1-ship_date+0(4) INTO w_ship_date SEPARATED BY '.'
CONCATENATE
it_batch1-werks it_batch1-mtart it_batch1-matnr it_batch1-maktg
it_batch1-prdha it_batch1-prctr it_batch1-ktext it_batch1-dispo
it_batch1-charg it_batch1-lgort it_batch1-herkl w_clabs
w_cinsm w_ceinm w_cretm w_cspem
w_cumlm w_total it_batch1-meins it_batch1-v_spr_unit
w_v_totalp it_batch1-waers w_plnmg it_batch1-meins
w_ersda w_hsdat w_vfdat w_exp_date
w_ship_date w_mhdrz w_min_rem it_batch1-zlifer
it_batch1-doknr it_batch1-dokar it_batch1-doktl it_batch1-dokvr
INTO L_STRING SEPARATED BY CON_TAB.
INTO l_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
WHILE l_string <> space.
CALL FUNCTION 'TEXT_SPLIT'
EXPORTING
length = 255
text = l_string
as_character = 'X'
IMPORTING
line = it_attach
rest = l_string.
IF l_string = space.
CONCATENATE IT_ATTACH CON_CRET INTO IT_ATTACH.
CONCATENATE it_attach cl_abap_char_utilities=>cr_lf INTO it_attach.
APPEND it_attach.
CLEAR it_attach.
ELSE.
APPEND it_attach.
CLEAR it_attach.
ENDIF.
ENDWHILE.
move l_string to it_attach .
CONCATENATE it_attach cl_abap_char_utilities=>cr_lf INTO it_attach.
APPEND it_attach.
CLEAR it_attach.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
text
--> p1 text
<-- p2 text
FORM send_file_as_email_attachment.
DATA:w_length TYPE i.
DATA: 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,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE.
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 = text-034 .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
DESCRIBE TABLE it_attach LINES w_cnt.
DESCRIBE TABLE it_message LINES w_cnt.
READ TABLE it_message INDEX w_cnt.
w_length = STRLEN( it_attach ).
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_message ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = text-034.
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.
***Start of changes by 501507008 on 29.01.2009
t_packing_list-obj_descr = 'MAIL BODY'.
***End of changes by 501507008 on 29.01.2009
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 = 'XLS'.
t_packing_list-obj_descr = text-034.
t_packing_list-obj_name = 'filename'.
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.
LOOP AT it_adr6.
t_receivers-receiver = it_adr6-smtp_addr.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
ENDLOOP.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ' '
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.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
commit_work = ' '
IMPORTING
sent_to_all =
new_object_id =
tables
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
contents_hex =
object_para =
object_parb =
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.
ENDIF.
ENDFORM. " SEND_FILE_AS_EMAIL_ATTACHMENTHi,
could you tell me which opeion should i select in SCOT under INT node. I have tried with diffrent options. but no luck.
SAPscript/Smart Forms - No Conversion
ABAP List - No Conversion
Business Object/Link - No Conversion
RAW Text - No Conversion -
Sending mail with excel attachment-improper format
Dear experts,
I am sending a mail to outlook with an excel attachment. The mail is sent with attachment and the data, but all in one cell.
I am using SO_NEW_DOCUMENT_ATT_SEND_API1. What parameters do i need to manipulate to have data in different columns of excel? I am using "packing_list" table of FM. But dont know the exact parameters to be passed. Can anyone help with the same please?
Best regards and thanks!
Sumit Nene.Hello Sumit,
I am using same function module to send mail with excel attachment.
Below I am attaching my own code for your reference.
Data which u want to add in excel file is maintain in IT_OBJBIN i.e. document information.
CLEAR :IMESSAGE,IT_OBJBIN,IT_OBJPACK,IT_RECLIST.
REFRESH: IMESSAGE[ ] , IT_OBJBIN[ ] , IT_OBJPACK[ ] , IT_RECLIST[ ].
" populate the text for body of the mail
CLEAR WA_IMESSAGE.
CONCATENATE 'Board : ' P_BOARD ':' 'Please find the excel attached for the list of Material whose routing is created' INTO WA_IMESSAGE-LINE.
APPEND WA_IMESSAGE TO IMESSAGE.
"document information
W_DOC_CHNG-OBJ_NAME = 'Excel'.
IF NOT P_BOARD IS INITIAL.
CONCATENATE 'Board : ' P_BOARD ':' 'List Of Routing Materials' INTO W_DOC_CHNG-OBJ_DESCR.
ELSE.
CONCATENATE 'List Of' ' Routing Materials' INTO W_DOC_CHNG-OBJ_DESCR.
ENDIF.
W_DOC_CHNG-SENSITIVTY = 'F'. " ->Functional object
" displaying material , plant in the excel
CONCATENATE 'BOARD NO : ' P_BOARD INTO WA_OBJBIN.
APPEND WA_OBJBIN TO IT_OBJBIN.
CONCATENATE 'MATERIAL' 'PLANT' 'DESCRIPTION' INTO WA_OBJBIN SEPARATED BY C_TAB.
CONCATENATE C_RET WA_OBJBIN INTO WA_OBJBIN.
APPEND WA_OBJBIN TO IT_OBJBIN.
CLEAR : WA_OBJBIN.
LOOP AT IT_DOWNLOAD INTO WA_DOWNLOAD. "It_orders is the internal table to be transferred to excel
CONCATENATE WA_DOWNLOAD-MATNR WA_DOWNLOAD-WERKS WA_DOWNLOAD-DESC INTO WA_OBJBIN SEPARATED BY C_TAB.
CONCATENATE C_RET WA_OBJBIN INTO WA_OBJBIN.
APPEND WA_OBJBIN TO IT_OBJBIN.
ENDLOOP.
DESCRIBE TABLE IT_OBJBIN LINES V_LINES_BIN. " no of lines for excel data
" pack the data as RAW
CLEAR WA_IT_OBJPACK-TRANSF_BIN. "Obj. to be transported not in binary form
WA_IT_OBJPACK-HEAD_START = 1. "Start line of object header in transport packet
WA_IT_OBJPACK-HEAD_NUM = 0. "Number of lines of an object header in object packet
WA_IT_OBJPACK-BODY_START = 1. "Start line of object contents in an object packet
WA_IT_OBJPACK-BODY_NUM = MESSAGE_LINES. "Number of lines of the mail body
WA_IT_OBJPACK-DOC_TYPE = 'RAW'.
APPEND WA_IT_OBJPACK TO IT_OBJPACK.
" pack the data as excel
WA_IT_OBJPACK-TRANSF_BIN = 'X'.
WA_IT_OBJPACK-HEAD_START = 1.
WA_IT_OBJPACK-HEAD_NUM = 1.
WA_IT_OBJPACK-BODY_START = 1.
WA_IT_OBJPACK-BODY_NUM = V_LINES_BIN. "no of lines of it_orders to give no of unprocessed orders
WA_IT_OBJPACK-DOC_TYPE = 'XLS'. " -> excel fomat
WA_IT_OBJPACK-OBJ_NAME = 'EXCEL ATTACHMENT'.
" attachment name
IF NOT P_BOARD IS INITIAL.
CONCATENATE P_BOARD '.XLS' INTO WA_IT_OBJPACK-OBJ_DESCR.
ELSE.
CONCATENATE 'LIST' '.XLS' INTO WA_IT_OBJPACK-OBJ_DESCR.
ENDIF.
WA_IT_OBJPACK-DOC_SIZE = V_LINES_BIN * 255.
APPEND WA_IT_OBJPACK TO IT_OBJPACK.
" creating email id
DATA: STR1 TYPE STRING,
STR2 TYPE STRING,
STR3 TYPE STRING,
ITAB TYPE TABLE OF STRING.
DATA : WA_I LIKE LINE OF ITAB.
SPLIT P_EMAIL AT ',' INTO: TABLE ITAB.
e-mail receivers.
CLEAR WA_IT_RECLIST.
LOOP AT ITAB INTO WA_I.
WA_IT_RECLIST-RECEIVER = WA_I.
WA_IT_RECLIST-RECEIVER = V_MAILADDR.
WA_IT_RECLIST-EXPRESS = 'X'.
WA_IT_RECLIST-REC_TYPE = 'U'. "-> Internet address
APPEND WA_IT_RECLIST TO IT_RECLIST.
CLEAR WA_IT_RECLIST.
ENDLOOP.
" sending mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
PACKING_LIST = IT_OBJPACK
OBJECT_HEADER =
CONTENTS_BIN = IT_OBJBIN
CONTENTS_TXT = IMESSAGE
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
RECEIVERS = IT_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
COMMIT WORK.
IF SY-SUBRC = 0.
MESSAGE I001 WITH 'Routing is Created for Board' P_BOARD 'and Mail send on e-mail id :' P_EMAIL.
ENDIF. -
Bug sending email with Excel file (immediate reply would he helpfull)
Hi ,
Below is have pasted a sample code where it will sends a email along with an attachtment (xls) .where the email is working perfectly but the xls file attachtment has a blank space in the first line .
where iam facing the problem ,
ie there should not be any blank lines at the top .
Please run the code one i have pasted below .u can find the bug .
can any one help me on this .
please have ur mail id in ( reclist-receiver ) so that u can check for the output.
This table requires information about how the data in the
tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are
to be distributed to the documents and its attachments.
DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
This table must contain the summarized data dependent on each object type.
SAPscript objects store information here about forms and styles,
for example. Excel list viewer objects store the number of rows and columns
amongst other things and PC objects store their original file name.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
*CREATION OF INTERNAL TABLE
DATA : BEGIN OF itobjbin OCCURS 10 ,
vbeln type vbrp-vbeln,
matnr type vbrp-matnr,
werks type vbrp-werks,
fktyp like vbrk-fktyp,
END OF itobjbin .
This table must contain the summarized content of the objects identified as binary objects.
*DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: objbin TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: wa_itobjbin LIKE itobjbin .
This table must contain the summarized content of the objects identified as ASCII objects.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
This table must contain the document recipients.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
This structure must contain the attributes of the document to be sent.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA : V_FKTYP LIKE VBRK-FKTYP.
Creating the document to be sent
doc_chng-obj_name = 'OFFER'. " input contains the attributes of the document to be sent
doc_chng-obj_descr = 'EMAIL WITH EXCEL DOWNLOAD'. "input contains title/subject of the document
*BODY OF THE MAIL
OBJTXT = 'Hi'.
APPEND OBJTXT .
OBJTXT = 'Test for excel download'.
APPEND OBJTXT.
OBJTXT = 'Below is the attachment with Billing Document Details'.
APPEND OBJTXT.
OBJTXT = 'Regards'.
APPEND OBJTXT.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
Creating 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.
Creating the document attachment
(Assume the data in OBJBIN are given in BMP format)
select vbeln matnr werks
from vbrp into table itobjbin
up to 10 rows
where werks GE '1000'.
loop at itobjbin.
select single fktyp into v_fktyp from vbrk where vbeln = itobjbin-vbeln.
move v_fktyp to itobjbin-fktyp.
modify itobjbin.
endloop.
PERFORM build_xls_data_table .
DESCRIBE TABLE objbin LINES tab_lines.
objhead = 'ABC.XLS'. APPEND objhead.
Creating 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 = 'XLS'.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'XLS'.
objpack-doc_size = tab_lines * 255.
APPEND objpack..
Entering names in the distribution list
reclist-receiver = ''.
reclist-rec_type = 'U'.
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.
CASE sy-subrc.
WHEN 0.
WRITE: / 'Result of the send process:'.
LOOP AT reclist.
WRITE: / reclist-receiver(48), ':'.
IF reclist-retrn_code = 0.
WRITE 'sent successfully'.
ELSE.
WRITE 'not sent'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'no authorization to send to the specified number of', 'recipients!'.
WHEN 2.
WRITE: / 'document could not be sent to any of the recipients!'.
WHEN 4.
WRITE: / 'no authorization to send !'.
WHEN OTHERS.
WRITE: / 'error occurred during sending !'.
ENDCASE.
*& Form build_xls_data_table
text
--> p1 text
<-- p2 text
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
CONCATENATE 'Billing Document' 'Material Number' 'Plant' 'Billing category' ' ' INTO objbin SEPARATED BY con_tab.
CONCATENATE con_cret objbin INTO objbin.
APPEND objbin.
LOOP AT itobjbin .
CONCATENATE itobjbin-vbeln itobjbin-matnr itobjbin-werks itobjbin-fktyp' '
INTO objbin SEPARATED BY con_tab.
CONCATENATE con_cret objbin INTO objbin.
APPEND objbin.
ENDLOOP.
thanks in advance,
vinay .Hi ravi ,
Thanks ,for your help .now xls is working fine .
but now iam facing a problem with the same function module .for txt files .where all the records are formated in asingle line .
can u provide a solution for this ,which would be very helpfull.
below is have attached the sample code .
Thanks,
vinay.
FUNCTION Z_KAILASH_ATTACHMENT1.
""Local Interface:
*" IMPORTING
*" VALUE(EMAILID)
*" VALUE(SUBJECT)
*" VALUE(ATYPE)
*" TABLES
*" ATTACH_FILE STRUCTURE SOLISTI1
*" BODY OPTIONAL
This table requires information about how the data in the
tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are
to be distributed to the documents and its attachments.
DATA OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
This table must contain the summarized data dependent on each object type.
SAPscript objects store information here about forms and styles,
for example. Excel list viewer objects store the number of rows and columns
amongst other things and PC objects store their original file name.
DATA OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
This table must contain the summarized content of the objects identified as binary objects.
DATA OBJBIN TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
This table must contain the summarized content of the objects identified as ASCII objects.
DATA OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
This table must contain the document recipients.
DATA RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE .
This structure must contain the attributes of the document to be sent.
DATA: DOC_CHING LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
Create the internal table for body , subject
DATA: IT_BODY LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
CONSTANTS: con_cret TYPE C VALUE cl_abap_char_utilities=>horizontal_tab,
con_tab TYPE C VALUE cl_abap_char_utilities=>cr_lf.
Move Body to Internal Table (body into it_body)
LOOP AT BODY .
MOVE BODY TO IT_BODY .
APPEND IT_BODY .
ENDLOOP.
DOC_CHING-OBJ_DESCR = SUBJECT. "Subject of the Email
Move the Subject and Body to OBJTXT
OBJTXT[] = IT_BODY[].
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHING-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
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.
Convert IT to Excel format
IF ATYPE = 'XLS' .
*CONSTANTS: con_cret TYPE C VALUE cl_abap_char_utilities=>horizontal_tab,
con_tab TYPE C VALUE cl_abap_char_utilities=>cr_lf.
LOOP AT ATTACH_FILE .
REPLACE ALL OCCURRENCES OF '#' IN ATTACH_FILE WITH con_cret. " INTO objbin.
CONCATENATE ATTACH_FILE con_tab INTO objbin.
APPEND objbin.
ENDLOOP.
ELSEIF ATYPE = 'TXT' .
LOOP AT ATTACH_FILE .
REPLACE ALL OCCURRENCES OF '#' IN ATTACH_FILE WITH con_tab. " INTO objbin.
CONCATENATE ATTACH_FILE ' ' INTO OBJBIN .
APPEND OBJBIN .
ENDLOOP.
ENDIF.
****End-Code Excel Format .
DESCRIBE TABLE objbin LINES tab_lines.
objhead = subject. APPEND objhead.
Creating 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 = ATYPE.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'TEST'. "Attachment File Name
objpack-doc_size = TAB_LINES * 255.
APPEND objpack..
reclist-receiver = EMAILID.
reclist-rec_type = 'U'.
APPEND reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHING
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
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 .
ENDFUNCTION.
Maybe you are looking for
-
in the menu bar at the top, there's the search bar. I have a lot of searchengines, and they show up when you press on the magnifying glass. however since the latest update i guess. I only see the icons of my searchengines. Is it possible to get them
-
select code.code_combination_id CCIDs, code.segment1||'*'|| code.segment2||'*'|| code.segment3||'*'|| code.segment4||'*'|| code.segment5 Segments from ( select cc.CODE_COMBINATION_ID from gl_je_headers jh, gl_je_lines jl, gl_code_combinations cc, (se
-
I have made a sequence in TestStand 4.1.1 (with LabVieW) that contains a PID regulation VI that regulates a power to a certain temperature. I was using Ziegler-Nichols method to come up with appropriate PID settings for the system when using one DUT
-
RMAN 0 level backup failed while releasing channels at end.
In RMAN 0 level backup, when it's about to finish, reports an error as releasing channels. It backed up about 98% datafiles. Is this backup is usable. As we can not affort to take backup again as it's a big terabyte databse. Please suggest. Thanks in
-
my homepage is igoogle.nl and every time when i restart firefox it changes to another homepage. so everytime i must change it back to igoogle.nl i hope you have an answer for me. greetz, Henk