Facing problem in excel attachment in the Email
Hi,
I am facing one issue while sending an email with an excel attachment . In the excel attachment the actual number of line items are not displaying . For example if i have 4 rows in my internal table the excel shows only the first row of the internal table.
Can anybody suggest what is the issue.
Regards,
Ratheesh BS
Hi ,
Please find the code used.
WRITE: sy-datum TO l_date MM/DD/YY.
CONCATENATE text-014 "Enterprise workflow(s) are in ERROR status
l_date
INTO l_text
SEPARATED BY c_colon.
wa_doc_data-obj_langu = sy-langu.
wa_doc_data-obj_name = text-013. "SAPRPT
wa_doc_data-obj_descr = l_text.
wa_doc_data-sensitivty = c_false.
Fill the document data and get size of attachment
DESCRIBE TABLE i_attach LINES l_cnt.
READ TABLE i_attach INTO wa_attach INDEX l_cnt.
IF sy-subrc EQ 0.
l_size = STRLEN( wa_attach ).
l_docsize = ( ( l_cnt - 1 ) * c_length255 + l_size ).
wa_doc_data-doc_size = l_docsize.
wa_doc_data-obj_langu = sy-langu.
wa_doc_data-obj_name = text-013. "SAPRPT
wa_doc_data-obj_descr = l_text.
wa_doc_data-sensitivty = c_false.
ENDIF.
lt_attachment[] = i_attach[]." XLS attachment details
Describe the body of the message
CLEAR wa_packing_list.
REFRESH lt_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.
DESCRIBE TABLE lt_message LINES wa_packing_list-body_num .
wa_packing_list-doc_type = c_raw.
APPEND wa_packing_list TO lt_packing_list.
CLEAR wa_packing_list.
*l_docsize = 5000.
Create attachment notification
wa_packing_list-transf_bin = c_active.
wa_packing_list-head_start = 1.
wa_packing_list-head_num = 1.
wa_packing_list-body_start = 1.
DESCRIBE TABLE lt_attachment LINES wa_packing_list-body_num.
wa_packing_list-doc_type = c_xls.
wa_packing_list-obj_descr = text-022.
wa_packing_list-doc_size = wa_packing_list-body_num * c_length255.
APPEND wa_packing_list TO lt_packing_list.
CLEAR: wa_packing_list,l_cnt.
Email to be sent for multiple receivers
Add the recipients email address
LOOP AT s_receiv INTO wa_email.
l_email = wa_email-low.
wa_receivers-rec_type = c_rectyp.
wa_receivers-receiver = l_email.
wa_receivers-com_type = c_internet.
wa_receivers-notif_del = c_true.
wa_receivers-notif_ndel = c_true.
APPEND wa_receivers TO lt_receivers.
CLEAR : wa_receivers, wa_email, l_email.
ENDLOOP.
IF lt_receivers[] IS NOT INITIAL AND
i_itemrecord[] IS NOT INITIAL.
email sender
l_sender_address = sy-uname. " Stores the sender's address
*Function module to handel mail sending.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_doc_data
put_in_outbox = c_true
sender_address = l_sender_address
sender_address_type = c_sender_address_type
commit_work = c_true
IMPORTING
SENT_TO_ALL =
TABLES
packing_list = lt_packing_list
contents_bin = lt_attachment
contents_hex = lt_attachment1
contents_txt = lt_message
receivers = lt_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
Similar Messages
-
Not able to open MS Excel attachment in the email Using SO_NEW_DOCUMENT_ATT
Hi, I am not able to open the attached MS excel in the mail its giving error as "Problems came up in the following areas during load Table". My requirement is to send a colored excel as attachment through mail when the program is executed in background. For this i have reffered the following link " http://wiki.sdn.sap.com/wiki/display/Snippets/FormattedExcelasEmailAttachment". That is i have used the XML method for this . I would be thankful if you can let me know where i am doing the mistake For refference i am pasting my code: * Send mail when executed in background mode IF sy-batch eq 'X'. PERFORM send_mail_bkgrnd. ELSE. " Foreground mode PERFORM build_layout. PERFORM build_field_cat. PERFORM display. ENDIF. FORM SEND_MAIL_BKGRND . PERFORM process_xml_data. PERFORM disatch_mail. ENDFORM. " SEND_MAIL_BKGRND &---- *& Form PROCESS_XML_DATA &---- FORM PROCESS_XML_DATA . DATA lv_xlwidth TYPE i. * Creating a ixml Factory l_ixml = cl_ixml=>create( ). * Creating the DOM Object Model l_document = l_ixml->create_document( ). * Create Root Node 'Workbook' l_element_root = l_document->create_simple_element( name = 'Workbook' parent = l_document ). l_element_root->set_attribute( name = 'xmlns' value = 'urn:schemas-microsoft-com:office:spreadsheet' ). ns_attribute = l_document->create_namespace_decl( name = 'ss' prefix = 'xmlns' uri = 'urn:schemas-microsoft-com:office:spreadsheet' ). l_element_root->set_attribute_node( ns_attribute ). ns_attribute = l_document->create_namespace_decl( name = 'x' prefix = 'xmlns' uri = 'urn:schemas-microsoft-com:office:excel' ). l_element_root->set_attribute_node( ns_attribute ). * Create node for document properties. r_element_properties = l_document->create_simple_element( name = 'TEST_REPORT' parent = l_element_root ). l_value = sy-uname. l_document->create_simple_element( name = 'Author' value = l_value parent = r_element_properties ). * Styles r_styles = l_document->create_simple_element( name = 'Styles' parent = l_element_root ). * Style for Header r_style = l_document->create_simple_element( name = 'Style' parent = r_styles ). r_style->set_attribute_ns( name = 'ID' prefix = 'ss' value = 'Header' ). r_format = l_document->create_simple_element( name = 'Font' parent = r_style ). r_format->set_attribute_ns( name = 'Bold' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Interior' parent = r_style ). r_format->set_attribute_ns( name = 'Color' prefix = 'ss' value = '#92D050' ). r_format->set_attribute_ns( name = 'Pattern' prefix = 'ss' value = 'Solid' ). r_format = l_document->create_simple_element( name = 'Alignment' parent = r_style ). r_format->set_attribute_ns( name = 'Vertical' prefix = 'ss' value = 'Center' ). r_format->set_attribute_ns( name = 'WrapText' prefix = 'ss' value = '1' ). r_border = l_document->create_simple_element( name = 'Borders' parent = r_style ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Bottom' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Left' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Top' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Right' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). * Style for Data "Color properties are set over here r_style1 = l_document->create_simple_element( name = 'Style' parent = r_styles ). r_style1->set_attribute_ns( name = 'ID' prefix = 'ss' value = 'Data' ). r_border = l_document->create_simple_element( name = 'Borders' parent = r_style1 ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Bottom' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Left' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Top' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Right' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). * Worksheet r_worksheet = l_document->create_simple_element( name = 'Worksheet' parent = l_element_root ). r_worksheet->set_attribute_ns( name = 'Name' prefix = 'ss' value = 'Sheet1' ). * Table r_table = l_document->create_simple_element( name = 'Table' parent = r_worksheet ). r_table->set_attribute_ns( name = 'FullColumns' prefix = 'x' value = '1' ). r_table->set_attribute_ns( name = 'FullRows' prefix = 'x' value = '1' ). * Column Formatting DO 32 TIMES. CASE sy-index. WHEN 1. lv_xlwidth = '300'. WHEN 2. lv_xlwidth = '300'. WHEN OTHERS. lv_xlwidth = '300'. ENDCASE. PERFORM clmn_formatting USING lv_xlwidth. ENDDO. * Blank Row r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). * Column Headers Row r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). r_row->set_attribute_ns( name = 'AutoFitHeight' prefix = 'ss' value = '1' ). * VC. No. r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'VC No.' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). * Source r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'Source' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). DO 30 TIMES. * * TPLGRP r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = '' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). ENDDO. * Blank Row after Column Headers r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). DO 32 TIMES. r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Data' ). ENDDO. * Data Table CLEAR gs_output. LOOP AT gt_output INTO gs_output. r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). DO 32 TIMES. CASE sy-index. WHEN 1. a_dvalue = gs_output-vc_number. WHEN 2. a_dvalue = gs_output-source. WHEN 3. a_dvalue = gs_output-tplgrp_01. WHEN 4. a_dvalue = gs_output-tplgrp_02. WHEN 5. a_dvalue = gs_output-tplgrp_03. WHEN 6. a_dvalue = gs_output-tplgrp_04. WHEN 7. a_dvalue = gs_output-tplgrp_05. WHEN 8. a_dvalue = gs_output-tplgrp_06. WHEN 9. a_dvalue = gs_output-tplgrp_07. WHEN 10. a_dvalue = gs_output-tplgrp_08. WHEN 11. a_dvalue = gs_output-tplgrp_09. WHEN 12. a_dvalue = gs_output-tplgrp_10. WHEN 13. a_dvalue = gs_output-tplgrp_11. WHEN 14. a_dvalue = gs_output-tplgrp_12. WHEN 15. a_dvalue = gs_output-tplgrp_13. WHEN 16. a_dvalue = gs_output-tplgrp_14. WHEN 17. a_dvalue = gs_output-tplgrp_15. WHEN 18. a_dvalue = gs_output-tplgrp_16. WHEN 19. a_dvalue = gs_output-tplgrp_17. WHEN 20. a_dvalue = gs_output-tplgrp_18. WHEN 21. a_dvalue = gs_output-tplgrp_19. WHEN 22. a_dvalue = gs_output-tplgrp_20. WHEN 23. a_dvalue = gs_output-tplgrp_21. WHEN 24. a_dvalue = gs_output-tplgrp_22. WHEN 25. a_dvalue = gs_output-tplgrp_23. WHEN 26. a_dvalue = gs_output-tplgrp_24. WHEN 27. a_dvalue = gs_output-tplgrp_25. WHEN 28. a_dvalue = gs_output-tplgrp_26. WHEN 29. a_dvalue = gs_output-tplgrp_27. WHEN 30. a_dvalue = gs_output-tplgrp_28. WHEN 31. a_dvalue = gs_output-tplgrp_29. WHEN 32. a_dvalue = gs_output-tplgrp_30. ENDCASE. PERFORM fill_data_val_excel USING a_dvalue. ENDDO. CLEAR gs_output. ENDLOOP. * Creating a Stream Factory l_streamfactory = l_ixml->create_stream_factory( ). * Connect Internal XML Table to Stream Factory l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ). * Rendering the Document l_renderer = l_ixml->create_renderer( ostream = l_ostream document = l_document ). l_rc = l_renderer->render( ). * Saving the XML Document l_xml_size = l_ostream->get_num_written_raw( ). ENDFORM. " PROCESS_XML_DATA &---- *& Form DISATCH_MAIL &---- FORM DISATCH_MAIL . DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE. DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE. DATA: objbin LIKE solix 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: l_num(3). DATA: subj_date(10) TYPE c. * Mail Subject data lv_date TYPE d. lv_date = sy-datum. CONCATENATE lv_date6(2) '-' lv_date4(2) '-' lv_date+0(4) INTO subj_date. CONCATENATE 'SAP Application Usage Report ' subj_date INTO doc_chng-obj_descr SEPARATED BY space. * Mail Contents objtxt = 'Dear User,'. APPEND objtxt. CLEAR objtxt. APPEND objtxt. CONCATENATE 'Please find the attached SAP Application Usage Report for ' subj_date INTO objtxt SEPARATED BY space. " Mail Contents APPEND objtxt. CLEAR objtxt. APPEND objtxt. objtxt = 'Thanks & Regards,'. APPEND objtxt. objtxt = 'Himanshu Kanekar'. APPEND objtxt. DESCRIBE TABLE objtxt LINES tab_lines. READ TABLE objtxt INDEX tab_lines. doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ). * Packing List For the E-mail Body 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 LOOP AT l_xml_table INTO wa_xml. CLEAR objbin. objbin-line = wa_xml-data. APPEND objbin. ENDLOOP. DESCRIBE TABLE objbin LINES tab_lines. objhead = 'SAP Login Details'. APPEND objhead. * Packing List For the E-mail Attachment objpack-transf_bin = ''."'X'. objpack-head_start = 1. objpack-head_num = 0. objpack-body_start = 1. objpack-body_num = tab_lines. CONCATENATE 'SAP_Login_Details' subj_date INTO objpack-obj_descr SEPARATED BY space. objpack-doc_type = 'XLS'. objpack-doc_size = tab_lines * 255. APPEND objpack. * Target Recipent CLEAR reclist. 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_txt = objtxt contents_hex = objbin receivers = reclist EXCEPTIONS too_many_receivers = 1 document_not_sent = 2 operation_no_authorization = 4 OTHERS = 99. ENDFORM. " DISATCH_MAIL
Refer:
http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
http://www.saptechies.com/sending-mail-with-attachment-report-in-background/ -
I attempted to eprint an email with an excel attachment. The attachment didn't print
I attempted to eprint an email with an Excel attachment. The email message printed but the Excel attachment does not print
Hi DaveF100,
You may want to refer to the help section of ePrintCenter.com here about attachments. In general though, Excel documents will have difficulty if they have complex variables in the document, such as pivot tables, macros, etc.
If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
Although I work for HP, my posts and replies are my own opinion and not those of HP. -
Excel attachment in external email sending
Hi guys.
Just having a bit problem in my excel attachment in external email sending (internet). The contents of my attachment are being considered as one column per line item, which is supposedly divided into columns according to its tab or space.
example: i sent this :
PO# Poitem
A 1
it will be displayed in excel as:
column1
PO# Poitem
A 1
it should be like this:
column1
column2
PO#
Poitem
A
1
can anyone tell me what additional fm(s) do I need to implement before calling fm: SO_NEW_DOCUMENT_ATT_SEND_API1 to send the email.
thanks a lot!
cheers,jagan,
Comapare your code with this program.
I need a create a excel file (or tab delimited file) and send it as attachment by mail to the user (in background processing). I use SO_NEW_DOCUMENT_ATT_SEND_API1. I have a problem, that 1 Excel line is splited into 2 lines in mail, because there is more then 255 chars in Excel line.
Can anybody help me?
report y_cr17_mail .
data method1 like sy-ucomm.
data g_user like soudnamei1.
data g_user_data like soudatai1.
data g_owner like soud-usrnam.
data g_receipients like soos1 occurs 0 with header line.
data g_document like sood4 .
data g_header like sood2.
data g_folmam like sofm2.
data g_objcnt like soli occurs 0 with header line.
data g_objhead like soli occurs 0 with header line.
data g_objpara like selc occurs 0 with header line.
data g_objparb like soop1 occurs 0 with header line.
data g_attachments like sood5 occurs 0 with header line.
data g_references like soxrl occurs 0 with header line.
data g_authority like sofa-usracc.
data g_ref_document like sood4.
data g_new_parent like soodk.
data: begin of g_files occurs 10 ,
text(4096) type c,
end of g_files.
data : fold_number(12) type c,
fold_yr(2) type c,
fold_type(3) type c.
parameters ws_file(4096) type c default 'c:\debugger.txt'.
Can me any file fromyour pc ....either xls or word or ppt etc ...
g_user-sapname = sy-uname.
call function 'SO_USER_READ_API1'
exporting
user = g_user
PREPARE_FOR_FOLDER_ACCESS = ' '
importing
user_data = g_user_data
EXCEPTIONS
USER_NOT_EXIST = 1
PARAMETER_ERROR = 2
X_ERROR = 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.
fold_type = g_user_data-outboxfol+0(3).
fold_yr = g_user_data-outboxfol+3(2).
fold_number = g_user_data-outboxfol+5(12).
clear g_files.
refresh : g_objcnt,
g_objhead,
g_objpara,
g_objparb,
g_receipients,
g_attachments,
g_references,
g_files.
method1 = 'SAVE'.
g_document-foltp = fold_type.
g_document-folyr = fold_yr.
g_document-folno = fold_number.
g_document-objtp = g_user_data-object_typ.
*g_document-OBJYR = '27'.
*g_document-OBJNO = '000000002365'.
*g_document-OBJNAM = 'MESSAGE'.
g_document-objdes = 'Manohar testing by program'.
g_document-folrg = 'O'.
*g_document-okcode = 'CHNG'.
g_document-objlen = '0'.
g_document-file_ext = 'TXT'.
g_header-objdes = 'Manohar testing by program'.
g_header-file_ext = 'TXT'.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = sy-uname
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
FOLMEM_DATA =
RECEIVE_DATA =
File from the pc to send...
method1 = 'ATTCREATEFROMPC'.
g_files-text = ws_file.
append g_files.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
method1 = 'SEND'.
g_receipients-recnam = 'MK085'.
g_receipients-recesc = 'B'.
g_receipients-sndex = 'X'.
append g_receipients.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header. -
Unable to read excel attachment received thru email using function module ?
Hi...
I am using the function module 'SO_DOCUMENT_SEND_API1' to send an email attachement in EXCEL format.
The email is getting received along with the attachment, but when i try to open the excel file, i am getting an error stating "Unable to Read File"......
What could be the reason behind this error.......
Plz Help......Hi,
Firstly, convert Excel Format with FM: SAP_CONVERT_TO_TXT_FORMAT ,
" Format convert(Excel content)
CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
EXPORTING
I_LINE_HEADER = 'X'
TABLES
I_TAB_SAP_DATA = GIT_DATA "Before convert
CHANGING
I_TAB_CONVERTED_DATA = GIT_EXCEL "After convert
LOOP AT GIT_EXCEL INTO LFC_STMP.
LI_ITMP = STRLEN( LFC_STMP ).
LFC_STMP+LI_ITMP = CL_ABAP_CHAR_UTILITIES=>CR_LF.
MODIFY GIT_EXCEL FROM LFC_STMP.
ENDLOOP.
Then, send Email with .xls attachment via FM: SO_DOCUMENT_SEND_API1.
Best Regards
Lily -
How can I print only the attachment without the email content
How can I print only the attachment without the email content. Every time I send to print, It prints the email itself with the attachment- can I cancel that?
Hello Riklama,
When you first open the attachment (e.g. on your phone) than you can mail only that attachment. Works fine with my husbands blackberry.
Elsy -
Communication problems: A device attached to the system is not functioning.
Hi all,
I'm developing an applet and using the OMNIKEY 5321 CL reader for communication and testing. One of the requirements for our card is to read large binary data.
For this purpose i used extented lenght APDU to read the data from card.
When I tested it via JCOP simulation I was able to read up to 32767 bytes as described in specification. But problem occurs when I test it with reader, in this case I'm able to read max 298B in APDU response. When I send greater byte count than 298B i have got following error in JCShell plugin:
jcshell: requestSessionKey.jcsh[1]: Error code: -6 (Card terminal error)
jcshell: requestSessionKey.jcsh[1]: Communication problems: A device attached to the system is not functioning.
Regarding the extend lengh APDU support it should by OK from the OMNIKEY. I'm using newest driver 1.2.9.2 for Win 7.
Here my configuration:
JCOP:JCOP 2.4.2r1
JAVA CARD: jc301
Global Platform: gp22
Can somebody help me? Any ideas?If you want to use PC/SC directly, I have a simple Go program that reads an APDU file (just hex encoded APDU strings) and sends them to a smart card. You can give that a try if you like.
The code is at: https://bitbucket.org/safarmer/go-apdus
There is a Goclipse project as well as the source. You will need to install Go and run "go get github.com/ebfe/go.pcsclite/scard" to install the required PC/SC wrapper. Once you have done this you can run the program with -file <apth to text file>
An example text file:
# A comment that is ignored
00a4040000
80ca9f7f00- Shane -
Read attachment in the email adapter in PI 7.11
Hello Experts
I am working on as scenario where I would be receiving source payload as an attachment in the email, and I need to read the attached payload and map it to the target structure
please let me know how can i read the attachment as part of the payload
Thanks
PRHi,
have a look at my article:
The specified item was not found.
Regards,
Michal Krawczyk -
Attachment of the email and PDF
When transfer the outllook emails to PDF package, the attachment of the email will not tranfer to PDF, but still keep as word format, how to transfer these attachment also to PDF?
When print the PDF package which tranfered from the emails, only the first email could be print out, how to print out all pages of emails together with their attachment?Ok, so what do I do then? My Question is this. I am using Pages to create email flyers for my business. I have been Exporting them into a PDF File, but they as you say, send as attachements. I need to know how to send them in an email, as an email and not as an attachement.
What do I do to save and send them differently. I know it can be done since I get craploads of Junk mail everyday that look like that. Please help, I have a deadline to meet approaching very soon. Thanks!!!!!!!!!!!!!!! -
Facing problems with network due which the phone goes into hangs status
Facing problems with network due which the phone goes into hangs status. some one help me with switching between 2g and 3G network
Hi Mani Nair,
I apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are talking about having issues with a 3G cellular data network, you may find the troubleshooting steps outlined in the following article helpful:
iPhone cellular data connection issues
Regards,
- Brenden -
Whenever I send a email from iPad mail app with an attachment from pages or numbers, the receiver is getting only attachment in the email. They are getting the email content. How to troubleshoot this issue.
Someone is probably sending spam with your address forged on the To: line. Could be one of your old contacts with a Windows machine has a virus that's doing it. It's also possible your e-mail account has been hacked, though I'd think such a hacker would be a bit more purposeful.
For more information, see:
http://www.reedcorner.net/guides/macvirus/is_it_malware.php#spam
* Disclaimer: links to my pages may give me compensation, and should not be taken as endorsement of my services by Apple. -
Duplicate enties getting attached in the email excel
HI,
When am trying to send the details in the excel duplicate entries are getting attached in the excel though the internal table has the correc value.The list is displaying the contents such as 1-255 are correct entries and 256-511 are the duplicate entries.
Instead of attaching in the excel if am displaying in the contents of email the details are getting displayed correctly.Please help to correct this duplicate entries in the excel.Code is as follows
TABLES: edidc,somlreci1.
TYPE-POOLS: slis,sscr.
TYPES: BEGIN OF gt_edidc,
docnum TYPE edidc-docnum,
status TYPE edidc-status,
credat TYPE edidc-credat,
idoctp TYPE edidc-idoctp,
mestyp TYPE edidc-mestyp,
rcvprn TYPE edidc-rcvprn,
END OF gt_edidc.
DATA:gi_edidc TYPE STANDARD TABLE OF gt_edidc.
DATA:gw_edidc TYPE gt_edidc.
SELECTION-SCREEN:BEGIN OF BLOCK b01 WITH FRAME TITLE text-001.
SELECT-OPTIONS:s_credat FOR sy-datum .
SELECT-OPTIONS: s_mailid FOR somlreci1-receiver OBLIGATORY
NO INTERVALS.
SELECTION-SCREEN:END OF BLOCK b01.
INITIALIZATION.
s_credat-low = ' '.
s_credat-high = sy-datum - 2.
APPEND s_credat.
start-of-selection.
SELECT docnum status idoctp mestyp rcvprn FROM edidc INTO CORRESPONDING
FIELDS OF TABLE gi_edidc
WHERE credat IN s_credat AND ( status EQ 64 OR status EQ 30 ).
IF no idoc selected for the given idoc date give the error message.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'No idoc selected for the given input'.
ENDIF.
DATA: lv_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: lv_objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: lv_objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: lv_objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: lv_reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: lv_doc_chng LIKE sodocchgi1.
DATA: lv_tab_lines LIKE sy-tabix.
data: lc_dsn_totals TYPE string.
DATA: gv_date_mmdd(10) TYPE c.
DATA: gv_message(50) TYPE c.
lv_doc_chng-obj_descr = 'IDoc Error Status'.
lv_objtxt = 'Please Find the Attached IDOC Error List'.
APPEND lv_objtxt.
lv_objtxt = 'Have a good day'.
APPEND lv_objtxt.
Mail Contents
DESCRIBE TABLE lv_objtxt LINES lv_tab_lines.
READ TABLE lv_objtxt INDEX lv_tab_lines.
*attaching the data excel sheet to be sent as the email.
CONCATENATE 'IDOCNUMBER' 'STATUS' 'BASIC TYPE' 'MESSAGE TYPE' 'PARTNER'
cl_abap_char_utilities=>newline INTO lv_objbin-line separated by
cl_abap_char_utilities=>horizontal_tab.
append lv_objbin.
LOOP AT gi_edidc INTO gw_edidc.
CONCATENATE gw_edidc-docnum gw_edidc-status gw_edidc-idoctp
gw_edidc-mestyp gw_edidc-rcvprn
cl_abap_char_utilities=>newline INTO lv_objbin-line
separated by cl_abap_char_utilities=>horizontal_tab.
APPEND lv_objbin.
ENDLOOP.
APPEND INITIAL LINE TO lv_objbin.
lv_doc_chng-doc_size = ( lv_tab_lines - 1 ) * 255 + STRLEN( lv_objtxt ).
CLEAR lv_objpack-transf_bin.
*OBJPACK-TRANSF_BIN = 'X'.
lv_objpack-head_start = 1.
lv_objpack-head_num = 0.
lv_objpack-body_start = 1.
lv_objpack-body_num = lv_tab_lines.
*OBJPACK-BODY_NUM = 1.
lv_objpack-doc_type = 'RAW'.
lv_objpack-obj_name = 'Mail'.
lv_objpack-obj_descr = 'First Mail'.
lv_objpack-doc_size = lv_tab_lines * 255.
APPEND lv_objpack.
Creation of the entry for the compressed document
DESCRIBE TABLE lv_objbin LINES lv_tab_lines.
CLEAR lc_dsn_totals.
IF sy-langu = 'E'.
CONCATENATE 'IDOC_TOTALS_' sy-datlo '_' sy-timlo INTO lc_dsn_totals.
endif.
*CLEAR OBJPACK-TRANSF_BIN.
lv_objpack-transf_bin = 'X'.
lv_objpack-head_start = 1.
lv_objpack-head_num = 0.
lv_objpack-body_start = 1.
*OBJPACK-BODY_NUM = TAB_LINES.
lv_objpack-body_num = lv_tab_lines.
lv_objpack-doc_type = 'CSV'.
lv_objpack-obj_name = 'ATTACHMENT'.
lv_objpack-obj_descr = lc_dsn_totals.
lv_objpack-doc_size = lv_tab_lines * 255.
APPEND lv_objpack.
*Create the list of recipients
LOOP AT s_mailid.
lv_reclist-receiver = s_mailid-low.
lv_reclist-rec_type = 'U'.
APPEND lv_reclist .
ENDLOOP.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lv_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = lv_objpack
object_header = lv_objhead
contents_bin = lv_objbin
contents_txt = lv_objtxt
receivers = lv_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc = 0.
MESSAGE s000 WITH 'Email succesfully delivered'.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ELSE.
MESSAGE s000 WITH 'Error while sending email'.
ENDIF.Your code is tough to understand in the way you posted .....
make sure you are clearing the data in some internal tables.... or make sure you are using the correct table for email body and to excel
if at all if you are using header line clear: itab[] will clear the whole table.. -
Problem in sending Excel attachment on the SAI id.
Hi Experts.
i am using one function module to send one alv output in Excel format to sapid.
FORM SEND_MAIL TABLES T_AMS RECEIVERS_TAB.
CALL FUNCTION 'Z_MAIL_ITAB_AS_XLS_ATTACHMENT'
EXPORTING
I_MESSAGE_TITLE = SYST-TITLE
I_ATTACHMENT_TITLE = SYST-TITLE
I_STRUCTURE_NAME = 'ZAMT__ZBCAUTH0001'
I_INCLUDE_HEADER = 'X'
I_RECIPIENT_UNAME = P_UNAME
TABLES
T_MESSAGE = MESSAGE_TAB
T_DATA = I_TABLE
T_RECEIVERS = RECEIVERS_TAB
EXCEPTIONS
NO_DATA_TO_SEND = 01
UNABLE_TO_GET_NAMETAB = 02
UNABLE_TO_GET_DDTEXTS = 03
NO_HEADER_SUPPLIED = 04
MAIL_SENDING_FAILED = 05
OTHERS = 06.
IF SYST-SUBRC NE 0.
MESSAGE ID SYST-MSGID TYPE SYST-MSGTY NUMBER SYST-MSGNO
WITH SYST-MSGV1 SYST-MSGV2 SYST-MSGV3 SYST-MSGV4.
ENDIF.
ENDFORM.
now, my requirement is i had two internal table one for ITAB_FICO & ITAB_SD for FICO and SD module.AND BY CHECKING CONDITON I HAD TO SEND MAIL TO CORRESPONDING DIFFERENT PERSON.
I HAD DONE THE CODING AS GIVEN BELOW.
IF NOT itab_fico[] IS INITIAL.
RECEIVERS_TAB-RECEIVER = 'SAP_00021'.
RECEIVERS_TAB-REC_TYPE = 'B'.
RECEIVERS_TAB-EXPRESS = 'X'.
APPEND RECEIVERS_TAB.
PERFORM SEND_MAIL TABLES T_AMS RECEIVERS_TAB.
endif.
IF NOT itab_sd[] IS INITIAL.
RECEIVERS_TAB-RECEIVER = 'SAP_00022'. <------- its my sap id
RECEIVERS_TAB-REC_TYPE = 'B'.
RECEIVERS_TAB-EXPRESS = 'X'.
APPEND RECEIVERS_TAB.
PERFORM SEND_MAIL TABLES T_AMS RECEIVERS_TAB.
endif.
Now, what is happening is i am getting two mails,
one contains the attachement in Excel for ITAB_FICO. ( 3 ROWS)
SECOND mail contains two attachement one for ITAB_FICO ,second attachment contains the line items of ITAB_FICO + in the same excel the line items of ITAB_SD(2 ROWS).
So, for one time its working fine, but on sending mail second or third them its attaching the previous attachment also...... i tried to refresh everything but its not working....................
please help,,,,or if possible tell me some other SAP FM ...which can fulfil the requirements.
I will reward points for every suggestion.
thanksHi Saurabh,
IF NOT itab_fico[] IS INITIAL.
<b>REFRESH : RECEIVERS_TAB.
CLEAR : RECEIVERS_TAB.</b>
RECEIVERS_TAB-RECEIVER = 'SAP_00021'.
RECEIVERS_TAB-REC_TYPE = 'B'.
RECEIVERS_TAB-EXPRESS = 'X'.
APPEND RECEIVERS_TAB.
PERFORM SEND_MAIL TABLES T_AMS RECEIVERS_TAB.
endif.
IF NOT itab_sd[] IS INITIAL.
<b>REFRESH : RECEIVERS_TAB.
CLEAR : RECEIVERS_TAB.</b>
RECEIVERS_TAB-RECEIVER = 'SAP_00022'. <------- its my sap id
RECEIVERS_TAB-REC_TYPE = 'B'.
RECEIVERS_TAB-EXPRESS = 'X'.
APPEND RECEIVERS_TAB.
PERFORM SEND_MAIL TABLES T_AMS RECEIVERS_TAB.
endif.
Best regards,
Prashant -
Forward excel attachment to the user-defined mail id
Hello Everybody
i hv collect all data into the ITAB and want to transfer that data to excel format and send that excel file as an attachment to the user-defined mail id .
Input on selection-screen
SELECTION-SCREEN : BEGIN OF BLOCK B1 .
PARAMETERS : MAILID(255) TYPE C .
SELECTION-SCREEN : END OF BLOCK B1 .
plz suggest me
ASAPHi Sandeep,
EMAIL as EXCEL ATTACJEMENTS
Refer the following codes ..
Hope this will help you..
TYPE-POOLS: truxs.
DATA t5 LIKE t005t OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
SELECT * INTO TABLE t5
FROM t005t
WHERE spras = sy-langu.
DATA wa_data TYPE truxs_t_text_data.
CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
EXPORTING
i_line_header = 'X'
TABLES
i_tab_sap_data = t5
CHANGING
i_tab_converted_data = wa_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
DATA stmp(4096) TYPE c.
DATA itmp TYPE i.
LOOP AT wa_data INTO stmp.
itmp = STRLEN( stmp ).
stmp+itmp = cl_abap_char_utilities=>cr_lf.
MODIFY wa_data FROM stmp.
ENDLOOP.
PERFORM send_email.
*& Form send_email
FORM send_email .
DATA docs LIKE docs OCCURS 0 WITH HEADER LINE.
DATA excelsize TYPE i.
DATA excel LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA doc LIKE sodocchgi1.
DATA excelln TYPE i.
DATA int_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA int_objhead LIKE solisti1 OCCURS 2 WITH HEADER LINE.
DATA int_objtext LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA int_reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA bodyln LIKE sy-tabix.
DATA output_data TYPE ssfcrescl.
excel[] = wa_data[].
excel table sizes
DESCRIBE TABLE excel LINES excelln.
Body Email
int_objtext-line = 'Test Body'.
APPEND int_objtext.
DESCRIBE TABLE int_objtext LINES bodyln.
READ TABLE int_objtext INDEX bodyln.
CLEAR doc.
doc-doc_size = ( bodyln - 1 ) * 255 + STRLEN( int_objtext ).
doc-obj_name = ' '.
doc-sensitivty = 'P'.
doc-proc_syst = sy-sysid.
doc-proc_clint = sy-mandt.
CLEAR: int_objpack, int_objpack[].
int_objpack-transf_bin = ' '.
int_objpack-head_start = 1.
int_objpack-head_num = 0.
int_objpack-body_start = 1.
int_objpack-body_num = bodyln.
int_objpack-doc_type = 'RAW'.
int_objpack-obj_descr = 'Test'.
APPEND int_objpack.
CLEAR: int_objhead, int_objhead[].
int_objhead = 'Attachment'.
APPEND int_objhead.
int_objpack-transf_bin = 'X'.
int_objpack-head_start = 1.
int_objpack-head_num = 0.
int_objpack-body_start = 1.
int_objpack-body_num = excelln.
int_objpack-doc_size = excelsize.
int_objpack-doc_type = 'XLS'.
int_objpack-obj_name = 'excel'.
int_objpack-obj_descr = 'test.xls'. "File name
APPEND int_objpack.
Set Receiver
int_reclist-receiver = 'SAPUSER'.
int_reclist-rec_type = 'B'.
int_reclist-notif_del = 'X'.
int_reclist-notif_read = 'X'.
int_reclist-notif_ndel = 'X'.
int_reclist-express = 'X'.
APPEND int_reclist.
doc-obj_descr = 'Report in Excel'.
Sending Email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = int_objpack
object_header = int_objhead
contents_bin = excel
contents_txt = int_objtext "Body
receivers = int_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.
ENDFORM. " send_email
Note:
- If you are using FM SAP_CONVERT_TO_TXT_FORMAT you will not be able to execute this program in the background.
- dont forget to change 'SAPUSER' to your SAP user ID
- you can check the email by using tcode 'SBWP'.
Reward points if this Helps.
Manish -
Since I upgraded to Lion, my photos are not attached to emails. Example: I select photos in iphoto, click Share and send the email.
Recipients tell me that there is 'nothing attached, no photo attached." Can you help?This doesn't work for me at all. I tried entering exactly the same information that I used to set up my regular email account and I'm still getting an error message. I even tried switching to using my gmail account and neither one worked. Then it got hung up and had to repair my database! I have a lot of photos on my Mac (thank goodness they're backed up) and I was really sweating it for a moment.
Apple is so easy until it's not. I find this to be really aggrevating and I'm irritated that it hasn't been fixed. In fact I did an online search and someone described this same problem in detail and it was exactly what was happening to me. Same error messages.
I'm frustrated that Apple keeps updating it's operating system and then we go through these glitches.
And while I'm at it, I have never had such a frustrating time using my login information as I have to get into this forum! Why do they make it so difficult? There's just something about the way it's worded that get's me messed up every time. Meanwhile, at least get iPhoto fixed!
Maybe you are looking for
-
CCan't access paid video on iPad why
-
Header in flat file destination (ssis)
Hi I am creating a header in the flat file destination which has some hard coded values and record count which will get its value from a variable assisgned to a row count transformation in the package. There is no problem in hard coded value but when
-
Automatic Generartion of Transfer Order
Dear SAP Prof, How Automatic Transfer order is created The moment Delivry is SAVED....? Is their any configuration settings have to be done......? Please Suggests me for the above querry... Shafi
-
Hi all. I am trying to get around the mutating trigger error when having a trigger on a table that updates the same table. What I have done so far is: 1. create a package that will store the :new values. 2. I then use a BEFORE trigger to populate the
-
ITunes shuts down computer while trying to synch!!
Someone out there please help me. iTunes support kissed me off. Here is the situation. I have a 3G iPhone that synchs up to my laptop just fine (Windows Vista machine). When I try to synch up to my desktop (Windows XP) as soon as it starts to detect