Error "number out of range" in pdf sent through mail using smartform output
Hi Experts,
We have a program which sends mail using smartform output in 'PDF' format. We are able to preview smartform correctely in SAP and mail is also getting sent fine with attachment of form as PDF document. But, when we try to open the document, it gives error saying 'Number out of range'. Also, not all of the windows of smartform are appearing in document and some are coming only half.
We are not able to find out the reason for this. Any help would be appriciated.
Gouri.
Hello,
How did you solve this one? We are facing the same problem in ECC6.0.
Thanks in advance,
Benjamin de Rijke
Similar Messages
-
Error "number out of range" in pdf sent through mail using smartform outpu
Hi Experts,
We have a program which sends mail using smartform output in 'PDF' format. We are able to preview smartform correctely in SAP and mail is also getting sent fine with attachment of form as PDF document. But, when we try to open the document, it gives error saying 'Number out of range'. Also, not all of the windows of smartform are appearing in document and some are coming only half.
We are not able to find out the reason for this. Any help would be appriciated.Hi Soumya,
Have you got the solution as we are facing the same issue.
Cheers,
Bharath -
How to send pdf attachment through mail using Webdynpro-Java
How can i send the Adobe Interactive Form with data involved as a PDF attachment to mail? using Webdynpro-Java.
Is there any Adobe API or jar file for generating pdf?
Helpful answer is highly appreciable and rewarded with points.!Hi Sankar,
try [Offline Interactive PDF Form Using E-Mail|/docs/DOC-8061#49]
Michal -
Error while trying to open an attachment sent through email in smartform
Hi,
My requirement is to send the smartform through email as PDF attachment.I am able to send the mail.But when I try to open the attachment I am getting error as 'Adobe reader could not open the attachment 'advance shipment notification.PDF' because it is either not the supported file type or the file has been corrupted(for example, it was sent as an email attachment and was't correctly decoded)'.What does it mean?
Can anyone give me a proper solution for this?
It's very urgent.Useful answers will be rewarded.
Thanks,
HemaHi,
Are you using any webdispatcher or some proxy? Is there any URL filter configured in between?
If yes then I think you have to allow these pages.
Regards,
Vamshi. -
Hello. This is the error I get on my iMac Lion using an i1Pro spectrometer and the latest Argyll ICC software. Chartread is the sub program for reading printed color targets.
chartread: Error - icoms - usb_is_usb_portno: port number out of range!
Q. 1 I can't figure out how to fix this and I have no X-Rite software remaining on my computer.
Q. 2 How do I get a list of usb devices (in terminal?) and if I can do that can I assign a new number to that device?
Regards
Mark MacKenzieWithout the KVM the results are the same, except that using the fallback grub entry shows the console but X fails to start
(EE) intel(0): No kernel modesetting driver detected.
(II) UnloadModule: "intel"
(EE) Screen(s) found, but none have a usable configuration.
The same happens if I load the i915 module
MODULES=(i915 !vesafb !uvesafb !vboxdrv)
If I load the i915 and use
kernel /boot/vmlinuz26 root=/dev/sda2 ro vga=795 i915.modeset=1
the console still is unusable, but X boots
And I still see the
fb: conflicting fb hw usage inteldrmfb vs VESA VGA - removing generic driver
Last edited by noalwin (2009-12-28 12:38:51) -
CR XI Database Connector Error 220 Out of Range with Remedy AR System
Post Author: schilders
CA Forum: Data Connectivity and SQL
Good Afternoon,
We just upgraded to CR XI and I'm now attempting to refresh a report based on our Action Request System. I received the database connector error 220 out of range and cannot refresh the report. Has anyone else experienced this issue? If so, how did you fix it?
Thanks,
SidPost Author: Alleda
CA Forum: Data Connectivity and SQL
Hi
I have a similar problem, have you found any solution?
Dan -
Just installed mountain Lion. Viewing a pdf sent to me using preview and some colors are appearing BLACK, however when I view the same PDF in Acrobat they are perfect and what they are suppose to be. WHY would PREVIEW showing a different color?
Here's what I've found on the issue:
Pantone color definitions have changed (coinciding with CS6) — they are now "Pantone+" (I think that's what they're called). The "+" apparently means they're now LAB colors. Lab colors are not properly displayed in Preview (or in Finder previews) — they display as black (as far as I can tell, in all circumstances). I'm sure it's a tad more complicated than that, but that's the gist.
Now the bad news — nobody seems to know anything about a fix or workaround (unless you convert your PDFs to process — this might be a fix for sending to clients). It causes issues for me in AI files — being able to view them in the finder (with previews) is a HUGE time saver for my workflow... when they're all black, not so much.
In my chat with a director of product dev at Adobe, they placed the responsibility to fix on Apple (assuming Apple wants to support Pantone color definitions in their OS). -
HT3697 i am trying to open a pdf sent by email using keynote
Hi I am needing help opening a pdf sent via email using keynote
I just tried an experiment.
I created a PDF file and e-mailed it to myself. I then checked my e-mail on my iPad in Mail. The PDF appeared as an attachement. When I clicked on it it opened, apparently in Mail.
Am I misunderstanding your situation since Keynote does not seem to be involved at all? -
HR: Need to Send the Paysilp as a PDF file through Mail to Employees
Dear All ,
Need to Send the Paysilp as a PDF file through Mail to Employees.
can anyone please suggest any Standard Function Modules which takes the Payslip Form as input and convert it into PDF and can send it through mail to the concern employees.
Can anyone please explain the procedure in detail.
Thanks in Advance,
Regards.venu,
below is code which helps to generate pdf ,,,,hope u know how to use the mail sending function
data:
fm_name TYPE RS38L_FNAM, "Smart Forms: FM Name
sf_name TYPE TDSFNAME
value 'YOUR_FORM_NAME', "Smart Forms: Form Name
P_OUTPUT_OPTIONS TYPE SSFCOMPOP,
P_JOB_OUTPUT_INFO TYPE SSFCRESCL,
P_CONTROL_PARAMETERS TYPE SSFCTRLOP,
P_LANGUAGE TYPE SFLANGU value 'E',
P_E_DEVTYPE TYPE RSPOPTYPE.
data:
P_BIN_FILESIZE TYPE I,
P_BIN_FILE TYPE XSTRING,
P_OTF type table of ITCOO,
P_DOCS type table of DOCS,
P_LINES type table of TLINE,
name type string,
path type string,
fullpath type string,
filter type string,
guiobj type ref to cl_gui_frontend_services,
uact type i,
filename(128).
GET SMARTFORM FUNCTION MODULE NAME ---
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = sf_name
IMPORTING
FM_NAME = fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
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 'SSF_GET_DEVICE_TYPE'
EXPORTING
I_LANGUAGE = P_LANGUAGE
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
E_DEVTYPE = P_E_DEVTYPE.
P_OUTPUT_OPTIONS-XSFCMODE = 'X'.
P_OUTPUT_OPTIONS-XSF = SPACE.
P_OUTPUT_OPTIONS-XDFCMODE = 'X'.
P_OUTPUT_OPTIONS-XDF = SPACE.
P_OUTPUT_OPTIONS-TDPRINTER = P_E_DEVTYPE.
P_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
P_CONTROL_PARAMETERS-GETOTF = 'X'.
****...................................PRINTING.........................
CALL FUNCTION fm_name
EXPORTING
CONTROL_PARAMETERS = P_CONTROL_PARAMETERS
OUTPUT_OPTIONS = P_OUTPUT_OPTIONS
(....) <--- your form import parameters
IMPORTING
JOB_OUTPUT_INFO = P_JOB_OUTPUT_INFO.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
P_OTF[] = P_JOB_OUTPUT_INFO-OTFDATA.
****...................................CONVERT TO PDF...............
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
BIN_FILESIZE = P_BIN_FILESIZE
TABLES
OTF = P_OTF
DOCTAB_ARCHIVE = P_DOCS
LINES = P_LINES
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
now you can mail the pdf.
Reward points if helpful
Regards,
jinesh -
Sending SAP Script output as a PDF attachment through mail
Dear Guru,
I am using SAP 4.0B version, DATABASE Oracle 8i, OS is sun solaris 7.5.
I want to send SAP script output as a
PDF attachement through mail.Please suggest a solution.
Regards,
RajeshHi Rajesh,
In your print program, while calling OPEN_FORM, pass options-TDGETOTF = 'X'. This is used for returning print output in OTF format.
Then in CLOSE_FORM, get the table OTFDATA returned from the function module. for example
DATA: OTF_DATA LIKE ITCOO OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = RESULT
TABLES
OTFDATA = OTF_DATA.
now you can convert this OTF data to PDF using function module CONVERT_OTF
Then send this data as attachment to a mail using function module SO_NEW_DOCUMENT_ATT_SEND_API1
Regards,
Komal. -
SAP HANA Model validation error - Index out of range
Hi,
Creating a simple Attribute View using the SYSTEM user.
1. Log on with SYSTEM
2. CREATE SCHEMA EFASHION
3. CREATE THE TABLES UNDER EFASHION
4. LOAD DATA INTO TABLES
5. GRANT SELECT ON SCHEMA EFASHION TO _SYS_REPO WITH GRANT OPTION
Whilst activating/validating the Attribute View, face the following error:
Repository: Activation failed for atleast one object; atleast one runtime reported an error during activation. Please see CheckResults for details
Repository: Encountered an error in repository run time extension : Index $IDX$out of range [$BEG$, $END$]
Please help me to resolve this issue.
Thanks & Regards,
Ramana.Hi,
I too have the exact same issue and error.
The tables are created under the efashion schema using the SYSTEM user. The tables are created as "column" tables.
Regards,
Asif. -
Spool to PDF sent by mail - Pb to open PDF -
Dear all,
I try to convert a spool in a PDF file using the FM 'CONVERT_ABAPSPOOLJOB_2_PDF' and then I send it by mail using 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
When I open the attachement I have the error message from adobe.This error can change depending on what I have in the spool (I let the cover page, I have error 117 from Adobe, I dont' let the cover page I have an other error) !!!
I think that this problem comes from the FM 'CONVERT_ABAPSPOOLJOB_2_PDF' - Sap has just provided 2 Sap note regarding this FM, But it seems that the problem is for Unicode system.
I'm in 4.7, all my programs are flag "Unicode Checks Activ", but my system isn't yet translate in Unicode.
Do you have an idea? May I have to implement the new sap note, or do you know an other solution?
Thanks for your answers .
NatHi Sibi, sorry for YOUR CODE ...on my last message
I become completely crazy ... find enclosed my coding - Just the modfications -
DATA: PARAMS LIKE PRI_PARAMS,
VALID(1).
START-OF-SELECTION.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
ELSE.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING DESTINATION = 'ZL16'
COPIES = '1'
LIST_NAME = 'TEST'
LIST_TEXT = 'SUBMIT ... TO SAP-SPOOL'
IMMEDIATELY = ' '
RELEASE = 'X'
NEW_LIST_ID = 'X'
EXPIRATION = DAYS
LINE_SIZE = 132
LINE_COUNT = 65
LAYOUT = 'X_65_132'
SAP_COVER_PAGE = ' '
COVER_PAGE = ' '
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
NO_DIALOG = ' '
IMPORTING OUT_PARAMETERS = PARAMS
VALID = VALID.
submit YFKD17AK
to sap-spool
spool parameters PARAMS
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
get PARAMETER ID 'YSPOOL' FIELD nc_spool_nr.
move nc_spool_nr to gd_spool_nr.
ENDIF.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
" ELSE.
" SKIP.
" WRITE:/ 'Program must be executed in background in-order for spool',
" 'request to be created.'.
" ENDIF.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = sy-DATUM.
APPEND it_mess_bod.
it_mess_bod = gd_spool_nr.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'PDF'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
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 .
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 = 'LIST'.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
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 = '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'
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_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.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
+ The part of my Submit Program
Sort imodif.
LOOP AT imodif.
write :/ 'TEST PDF'.
ENDLOOP.
NEW-PAGE.
commit work.
new-page print off.
SET PARAMETER ID 'YSPOOL' FIELD sy-spono .
TOP-OF-PAGE.
WRITE :/ 'TEST'.
??? If I let the coding like this, it's ok, I just replace in the top of page
WRITE :/ 'TEST'. by WRITE :/ 'TESTABCDEABDEZZZZZZZZZFGJGFDGDFJGJ E30'., it's always OK, but if I add a blank like WRITE :/ 'TESTABCDEABDEZZZZZZZZZ FGJGFDGDFJGJ E30'. then I have a problem !!!!! -
Sending smartform as pdf attachment through mail
Dear All,
Can anyone suggest me sample code of how an sap smartform output is sent as pdf attachment to a receipients email address?
Thanks
M Ahi,
chk this sample code.
* Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
* Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
* Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
* Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZZZ_TEST1'
importing
fm_name = v_form_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 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.
i_otf[] = w_return-otfdata[].
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
* Fehlerhandling
if sy-subrc <> 0.
endif.
loop at i_tline.
translate i_tline using '~'.
concatenate wa_buffer i_tline into wa_buffer.
endloop.
translate wa_buffer using '~'.
do.
i_record = wa_buffer.
append i_record.
shift wa_buffer left by 255 places.
if wa_buffer is initial.
exit.
endif.
enddo.
* Attachment
refresh:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear wa_objhead.
i_objbin[] = i_record[].
******* Create Message Body
**** Title and Description
i_objtxt = 'test with pdf-Attachment!'.
append i_objtxt.
describe table i_objtxt lines v_lines_txt.
read table i_objtxt index v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
**** Main Text
* wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
clear i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
append i_objpack.
**** Attachment
* (pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
* Länge des Attachment ermitteln
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
append i_objpack.
clear i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-rec_type = 'U'.
append i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
CONTENTS_BIN = i_objbin
contents_txt = i_objtxt
receivers = i_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.
Regards
Anver -
Corrupted file when sent through mail
Hello,
I wrote a script that, among other things, sends an email with an attached binary file.
This goes through an SMTP relay server.
The problem is that the file gets corrupted along the way. something, somewhere, removes all 0x00 entries within the binary file.
I wonder if this could be due to the method I use to send the email.
Could someone have a look at this sub please ?
Sub SendMail (AttachmentFile)
Const SMTPServer = "zcabb37s.mydom.com"
Const SMTPServerPort = 25
Const MailExp = "[email protected]"
Dim Recipents, objMessage
Recipents = ""
For i = 0 To WScript.Arguments.Count - 1
If Len (Recipents) = 0 Then
Recipents = WScript.Arguments (i)
Else
Recipents = Recipents & "; " & WScript.Arguments (i)
End If
Next
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Stats du jour"
objMessage.From = MailExp
objMessage.To = Recipents
On Error Resume Next
objMessage.AddAttachment AttachmentFile
If Err.Number <> 0 Then
Call Echo ("Could not find attachment : " & " - " & Err.Number & Err.Source & " - " & Err.Description, 12)
Call Echo ("with " & AttachmentFile, 1)
WScript.Quit (5)
End If
On Error Goto 0
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPServerPort
objMessage.Configuration.Fields.Update
On Error Resume Next
objMessage.Send
If Err.Number <> 0 Then
Call Echo ("Could not send mail : " & " - " & Err.Number & Err.Source & " - " & Err.Description, 12)
Call Echo ("to " & Recipients, 1)
Call Echo ("with " & AttachmentFile, 1)
WScript.Quit (5)
End If
On Error Goto 0
Call Echo ("Mail sent to : " & Recipents & ".", 1)
Call Echo ("with attached file : " & AttachmentFile, 1)
End SubThis is not a scripting issue. Contact the server vendor or admin and ask them why they are doing that.
Perhaps you have a Unicode file that is being handled incorrectly. EXE files and binary files are usually blocked by mail systems.
The CDO package does not alter files. Only mail servers and mail clients will do that.
Try sending the file with PowerSHell to see that the same thing happens.
¯\_(ツ)_/¯ -
How to convert document file in PDf format through workflow using sharepoint designer
Please suggest me solution it's urgent.....please.
Hi Anil,
If Word Automation Services is installed in your environment then that may be an option (Providing you are only interested in converting MS-Word documents). However SharePoint does not ship with an out-of-the-box workflow activity that makes use of this.
You may want to consider some third party software that supports formats other than MS-Word as well and comes with workflow actions for SharePoint Designer (and Nintex Workflow) out of the box. Have a look at the
Muhimbi PDF Converter for SharePoint.
Disclaimer, I worked on this product so I am obviously biased. (It works great though :-)
Maybe you are looking for
-
Hi Experts, When i try to open a node(for example: a folder in portal content) its giving the error: <b>"Could not load or refresh node Tree creation failed on node:<location>"</b> How can i resolve this? valuable answers will b rewarded. Thanks in a
-
How to make it work in HTML?
The project run very well in Chrome, firefox and IE after published. (Stand alone) http://www.ctmotorfairing.com/Test/index.html However, after I integrated it in my existing HTML, in IE and firefox can't display any more. (Chrome is Perfect) http://
-
If I have created a database using dbca then the parameter file init<SID>.ora file is not created. It is only created the server parameter file spfile<SID>.ora. Attempting to automate the startup with dbstart I got the error for "no parameter file fo
-
How to get a count of BPS objects?
Hi All, While upgrading from BW 3.5 to BI 7.0., We need a count of BPS objects in the existing system. Any pointers to how this can be done.? Are there any system tables with which we can get this? Thanks in advance
-
IViews are not updated in customized top level navigation
Hi experts, I am working on External Facing Portal. I developed customized top level navigation. The problem is that the content area of External Facing portal is not refreshed. Although, i can see different navigationURLs but content area iView rema