According to my knowledge this works on SAP systems which has 4.6c higher versions.
A way to find out is by going to SE80 and entering the relevant class names and find out whether they are available in the system.
Thanks IndiaKing for pointing out the version issue.
data: binary_content type solix_tab.
data: xl_content type xstring .
constants:
con_tab type c value cl_abap_char_utilities=>horizontal_tab,
con_cret type c value cl_abap_char_utilities=>cr_lf.
data: xlcontent type xstring,
conlength type i,
conlengths type so_obj_len,
result_content type string,
wa_string type string, "This holds all of your data
dummy type string.
data: send_request type ref to cl_bcs.
data: text type bcsy_text.
data: document type ref to cl_document_bcs.
data: sender type ref to if_sender_bcs.
data: recipient type ref to if_recipient_bcs.
data: recipients type bcsy_smtpa.
data: bcs_exception type ref to cx_bcs.
data: sent_to_all type os_boolean.
data: e_r_page type ref to cl_rsr_www_page.
data: content_length type w3param-cont_len ,
content_type type w3param-cont_type,
return_code type w3param-ret_code .
data: html type standard table of w3html .
data: server type string ,
port type string .
data: wa_rec type ad_smtpadr .
data: bcs_message type string .
data: subject type so_obj_des.
data: sender_id type ad_smtpadr.
data: email type ad_smtpadr.
data: gv_file type string,
gv_zipfilehex type xstring,
go_zipper type ref to cl_abap_zip. "The zip folder object
concatenate 'Customer no.'
'CUSTOMER name'
'Subcustomer'
'Sales incoterms'
'Currency'
'Material'
'Mat long text'
'level1'
'level2'
'level3'
'Level 1 description'
'Level 2 description'
'Level 3 description'
'Data'
'Valid from'
'Valid to'
into wa_string separated by con_tab.
concatenate con_cret con_tab wa_string into wa_string.
* After this keep on appending the data to the wa_string
data: i type i,
true type string.
clear: xl_content .
* convert the string data to xstring
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = wa_string
* MIMETYPE = ' '
* ENCODING =
importing
buffer = xl_content.
* EXCEPTIONS
* FAILED = 1
* OTHERS = 2
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
gv_file = 'Data.xls'. "Zip file name
create OBJECT go_zipper.
go_zipper->add( name = gv_file
content = xl_content )."If you have other content to be added to the zip folder, do it here
*refresh text .
clear result_content .
*The body message
concatenate
'<p><font color="#000080">Dear Customer,</font></p>'
'<p><font color="#000080">Attached herewith is the data list you requested.</font></p>'
into result_content .
conlength = strlen( result_content ) .
conlengths = conlength .
call function 'SCMS_STRING_TO_FTEXT'
exporting
text = result_content
tables
ftext_tab = text.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.