02-09-2011 9:32 AM
hi Experts,
I have a problem in receiving mail. My programe has been converting the smartform in to pdf and then sending it through mail to the relevent email addressed. I have been also using the "GUI_DOWNLOAD" FM to download it at specific loacation. The downloaded files are given me the complete results but when I m sending the mail but at the reciving end it is not receiving the whole file. e,g if the file is 50 kb it is receiving 25 kb while 25 KB is missing.
regards,
02-17-2011 4:34 AM
----
data: l_send_request type ref to cl_bcs, " Send request
l_body type bcsy_text, " Mail body
l_attach type bcsy_text, " Attachment
lt_lines type i,
wa_text type soli, " Work area for attach
l_document type ref to cl_document_bcs, " Mail body
l_sender type ref to if_sender_bcs, " Sender address
l_recipient type ref to if_recipient_bcs, " Recipient
l_email type ad_smtpadr, " Email ID
l_extension type soodk-objtp value 'OTF', " TXT format
l_size type sood-objlen, " Size of Attachment
st_output_options type ssfcompop,
st_control_parameters type ssfctrlop,
st_job_output_info type ssfcrescl.
----
st_control_parameters-no_dialog = 'X'.
st_control_parameters-getotf = 'X'.
*st_output_options-tdnoprev = 'X'.
call function salary_slip
exporting
wa = wa
trndate = p_dat
output_options = st_output_options
control_parameters = st_control_parameters
user_settings = 'X'
importing
job_output_info = st_job_output_info
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4.
append 'Test Mail ' to l_body.
l_attach[] = st_job_output_info-otfdata[]..
lt_lines = lines( l_attach ).
l_size = lt_lines * 255.
Creates persistent send request
l_send_request = cl_bcs=>create_persistent( ).
Craete document for mail body
l_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = l_body
i_subject = 'Your Salary Slip' ).
Add attchment
call method l_document->add_attachment
exporting
i_attachment_type = l_extension "'PDF'
i_attachment_subject = 'test_delv'
i_attachment_size = l_size
i_att_content_text = l_attach.
Add the document to send request
call method l_send_request->set_document( l_document ).
Sender addess
l_sender = cl_sapuser_bcs=>create( sy-uname ).
call method l_send_request->set_sender
exporting
i_sender = l_sender.
*l_email = "emailaddress". "Receiver Email address
if wa-usrid is not initial.
l_email = wa-usrid. "employee email address from IT0105
l_recipient = cl_cam_address_bcs=>create_internet_address( l_email ).
else.
message 'Please Insert the Email Address in IT0105' type 'I'.
exit.
endif.
Add recipient address to send request
call method l_send_request->add_recipient
exporting
i_recipient = l_recipient
i_express = 'X'
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
Trigger E-Mail immediately
l_send_request->set_send_immediately( 'X' ).
Send mail
call method l_send_request->send( ).
commit work.
This Has Solved my Problem. I hope it will solve yours to.
Tnkks Every body
Edited by: ZAHID HAMEED on Feb 17, 2011 9:40 AM
09-13-2011 9:35 AM