Error in Tline to PDF conversion
Hi All
I am trying to convert a SMART form coming in the form of Tline to PDF.
But i am getting the Image in the PDF.
I am able to convert all the Text and other tables in the SMART form.
I get an error, Insufficient data for image. But it displays rest of the document
Please help
Deepu
Hi
I would suggest you clean your hard drive. Could be to many temp files on the hard drive and see if it works or not
thanks
Similar Messages
-
Error in Spool to PDF conversion using 'CONVERT_ABAPSPOOLJOB_2_PDF'.
Hi
I am sending classical report output from the Spool to PDF using 'CONVERT_ABAPSPOOLJOB_2_PDF'.
This is done through a batch job.
Step 1 is RVKRED01 report
Step 2 is a program that picks up the spool number of step1 and converts the spool to PDF.
Now in step 2 I am getting following error.
TEMSE_READ_LISTLINE error, TemssPart 1
What can be the reason?
What can be the solution?HI,
I checked your FM CONVERT_ABAPSPOOLJOB_2_PDF.
in the include LSTXWFPL line 1006, the IF condition is failing (if eop = 'X'. "end of part, read next part? )
so you are getting that message,
you can check that failing job in the debugging mode why it was failing at that point.
Note: for checking the background job you need to do below things.
1) go to sm37, and select you job.
2) and just type "JDBG" in the command line it goes to the debugging mode of your job.
by this way you will find. how and why its that error.
Alternative to your FM ( CONVERT_ABAPSPOOLJOB_2_PDF ) you can also use the
FM FPCOMP_CREATE_PDF_FROM_SPOOL. -
When I select "Convert" using the Adobe PDF conversion - I get "Error signing in"
When I select "Convert" using the Adobe PDF conversion - I get "Error signing in"
You need the CreatePDF forum
-
I am getting an error message when I try to combine three PDF files"Your PDF conversion request fail
I am getting an error message when I try to combine three PDF files "Your PDF conversion request failed. Try again later"
Thank you,
Lori JansHi,
Please let me know if your files are big. complex, or image files?
If you sill have the same error message then please share your files with us so that we can look at them using below site:
https://adobeformscentral.com/?f=qJiclooYWGGNFtWfj8g3wg#
Thank you.
Hisami -
I want to manage my pdf conversion to word account, but when I click on manage I get an error message saying Heading too Large. How do I get into manage
Hi,
May i know which service you are using?
Would it be possible for you to send me the screenshot of the error?
Regards,
Florence -
Error while opening the Pdf Attachment at the time sending mail ..
Hi Frn's ,
i am sending a mail with pdf attachment ... but the pdf is not opening ...it is giving error "There was and error opening this document . This file can not be open because it has no page ."
Please resolve the problem ...below is the code pasted ..
REPORT ZPRI_TEST_LDB.
DATA: it_pdf LIKE tline OCCURS 0 WITH HEADER LINE .
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
DATA: w_recsize TYPE i.
DATA: gd_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
data: gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT 'abc,
p_sender LIKE somlreci1-receiver
DEFAULT 'abc'.
perform write_output .
perform create_pdf .
PERFORM process_email .
FORM WRITE_OUTPUT .
write:'Listed below are the employees in your area who are due a Performance Appraisal'.
write:'during the month of May 2009 .A performance appraisal form can be found on-line'.
write: 'in the MUD template section .The Performance Appraisal is to be completed and' .
write:'discussed with the employee by the immediate supervisor .Signed forms should be '.
write: 'returned to the Human Resource Department by May 31,2009 .'.
skip 2 .
write: 'employee name' .
write: 'Job Date' .
write: 'Date of last appraisal' .
ENDFORM. " WRITE_OUTPUT
FORM CREATE_PDF .
DATA: spoolno LIKE tsp01-rqident.
DATA : p_repid LIKE sy-repid .
DATA: v_len TYPE i , v_len1 TYPE i .
DATA: v_temp(8) TYPE c .
DATA: p_uname LIKE sy-uname .
DATA: it_tsp01 TYPE STANDARD TABLE OF tsp01 WITH HEADER LINE .
DATA: it_pdf LIKE tline OCCURS 0 WITH HEADER LINE .
TABLES: tsp01.
data: var type c .
*-- STRUCTURES
DATA:
lc_rq2name LIKE tsp01-rq2name.
DATA:
mstr_print_parms LIKE pri_params,
mc_valid(1) TYPE c,
mi_bytecount TYPE i,
mi_length TYPE i,
mi_rqident LIKE tsp01-rqident.
*-- INTERNAL TABLES
DATA:
mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
mc_filename LIKE rlgrap-filename.
*-- SELECTION SCREEN
DATA:
p_linsz LIKE sy-linsz VALUE 132, " Line size
p_paart LIKE sy-paart VALUE 'X_65_132'. " Paper Format
*-- Setup the Print Parmaters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
authority = space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
IMPORTING
out_parameters = mstr_print_parms
valid = mc_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
importing variable value set at first time to restrict the infinite loop .
IMPORT var FROM MEMORY ID 'abc' .
var = var + 1 .
p_uname = sy-uname .
p_repid = sy-repid .
*checking variable to restricted scecond time exction of this block of code
IF var = 1 .
v_memid = 1 .
EXPORT var TO MEMORY ID 'abc' .
start ----p3d(02/13/2009)
EXPORT it_pernr it_pernr_quali v_memid it_pernr_status
p_file p_file1 rb_pres rb_app rb2 TO MEMORY ID 'bcd' .
EXPORT it_pernr it_pernr_quali v_memid it_pernr_status it_notqualified
p_file p_file1 rb_pres rb_app rb1 rb2 rb3 rb4 TO MEMORY ID 'bcd' .
EXPORT it_pernr it_pernr_quali v_memid it_pernr_status it_notqualified
p_file p_file1 rb_pres rb_app rb3 rb4 TO MEMORY ID 'bcd' .
end ----p3d(02/13/2009)
submitting the spool request
SUBMIT (p_repid) TO SAP-SPOOL
SPOOL PARAMETERS mstr_print_parms
WITHOUT SPOOL DYNPRO
AND RETURN.
ENDIF.
FREE MEMORY ID 'abc'.
FREE MEMORY ID 'bcd'.
*Calculating the lenth of report name
v_len = STRLEN( p_repid ) .
*consutrucing the database variable rq2name to search the spool request
IF v_len >= 9 .
CONCATENATE p_repid+0(9)
p_uname+0(3) INTO lc_rq2name .
ELSE.
v_len1 = 9 - v_len .
DO v_len1 TIMES .
CONCATENATE v_temp '_' INTO v_temp .
ENDDO.
CONCATENATE p_repid v_temp
p_uname INTO lc_rq2name .
ENDIF.
*selecting the spool request using the above consructed varibale
SELECT * FROM tsp01 INTO TABLE it_tsp01
WHERE rq2name = lc_rq2name .
*sorting the interbla table
SORT it_tsp01 BY rqcretime DESCENDING .
*reading the first spool request
READ TABLE it_tsp01 INDEX 1.
*converting the spool request into pdf
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = it_tsp01-rqident
dst_device = 'LP01'
TABLES
pdf = it_pdf
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf.
TRANSLATE it_pdf USING ' ~'.
CONCATENATE gd_buffer it_pdf 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. " CREATE_PDF
FORM SEND_eMAIL using p_email .
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
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. " SEND_MAIL
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_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 = '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'
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.
Thanks and Regards ..
Priyankhi this is the part of code ...
PERFORM process_email .
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf.
TRANSLATE it_pdf USING ' ~'.
CONCATENATE gd_buffer it_pdf 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. " CREATE_PDF
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 using p_email .
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
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. " SEND_MAIL
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 = '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'
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. -
Automated report/ PDF conversion with AppleScript
Hello-
I am attempting to PDF a spreadsheet from Dropbox, and email it to a set list of recipients with AppleScript. Much of this I have been able to figure out, but I am having some issues with the PDF conversion. As you can see below, I am still working on sending the xls file, and have not yet been able to get AppleScript to convert a specific tab of the file to aPDF. I expect scheduling to be handled theough crontab.
Current script is as follows:
tell application "Finder"
set folderPath to folder "Macintosh HD:Users:user:Dropbox:folder:Calculated PO Sheet"
set theFile to first file in folderPath as alias
set fileName to name of theFile
end tell
set theSubject to "Current PO Report" date
set theBody to "See attached."
set theAddress to "recipient email"
set theAttachment to "CALCULATED PO SHEET.xlsx"
set theSender to "sender email"
tell application "Mail"
set theNewMessage to make new outgoing message with properties{subject:theSubject, content:theBody & return & return, visible:true}
tell theNewMessage
set visibile to true
set sender to theSender
make new to recipient at end of to recipients with properties {address:theAddress}
try
make new attachment with properties {file name:theAttachment} at after the last word ofthe last paragraph
set message_attachment to 0
on error errmess -- oops
log errmess -- log the error
set message_attachment to 1
end try
log "message_attachment = " & message_attachment
#send
end tell
end tellHi,
there is a special setup for this requirement. Please see the following support note
Reference
Oracle Reports Output For Indian Languages Like Gujarati, Marathi [ID 980554.1]
Roberto -
Error in opening the PDF file created from the smart form output.
Hi All,
i have a simple smart form which takes 3 values like customer no, name and no of times customer called and gives an out like
Customer 0001000000 with name Ravi called 5 times today.
I have to send this output to mail as an attachment.
for this i am coding as below.
******Call the SSF Function module
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = Form name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = lv_fmname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
lv_partner_number = '0001000000'.
lv_name_org1 = 'Ravi'.
lv_z_no_calls_day = '5'.
lw_ctrlop-getotf = 'X'.
lw_ctrlop-no_dialog = 'X'.
lw_compop-tdnoprev = 'X'.
lw_compop-tddest = 'LP01'.
*******Call the Form Function module and get the OTF of form output
CALL FUNCTION lv_fmname
EXPORTING
name_org1 = lv_name_org1
partner_number = lv_partner_number
z_no_calls_day = lv_z_no_calls_day
control_parameters = lw_ctrlop
output_options = lw_compop
user_settings = ' '
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
i_otf] = w_return-otfdata[.
*********Now here if i look in to the OTF data i got in debug it has the data i aniticipated along with some other data.
the output is in the format
TDPRINTCOM(2) TDPRINTPAR(70)
ST XXXX.. customer 0001000000 with
name.....
i have my data in the above format spread in three lines of the output otf table where XXXX... is some number.
***********To convert to PDF Format
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = lv_len_in
BIN_FILE =
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5
*********For testing purpose i created a file on the desktop with the the data in i_tline. it created PDF file but when i tried to open it it's giving an error.
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 = 'Smart Form'.
wa_doc_chng-obj_descr = 'Frequent Caller Alert_Day'.
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
*********Creating the Entry for the document
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.
i_objbin] = i_tline[.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objhead = 'Frequentcaller list_Day.pdf'.
APPEND i_objhead.
************Creating the entry for the attachment.
CLEAR : i_objpack.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'ATTACHMENT'.
i_objpack-obj_descr = 'FCA'.
i_objpack-doc_size = v_lines_bin * 255 .
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = 'mail id'.
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'
commit_work = 'X'
TABLES
packing_list = i_objpack
object_header = i_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
This is all i am doing.
It is sending a mail with the attachment but we are not able to open the attachment. it's giving an error like file is damaged and couldn't be repaired.
I serched in the forum but i couldn't get the answer.
I suspect there is a problem in getting the OTF data..
Please help me in resolving this issue....
Thanks in advance.
RKCheck the sample , and see where you made the mistake.
REPORT ZPDF_MAIl.
DATA:
w_fm_name TYPE rs38l_fnam,
w_bin_filesize TYPE i,
w_filesize TYPE i,
w_lines_txt TYPE i,
w_lines_bin TYPE i.
DATA:
wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop,
wa_objhead TYPE soli_tab,
wa_buffer TYPE string,
wa_doc_chng TYPE sodocchgi1.
DATA:
BEGIN OF t_mail_ids OCCURS 0,
mailid TYPE ad_smtpadr,
END OF t_mail_ids,
t_otfdata TYPE ssfcrescl,
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
t_pdf_tab TYPE tline OCCURS 0 WITH HEADER LINE,
t_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z195_TEST'
IMPORTING
fm_name = w_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc EQ 0.
ENDIF. " IF sy-subrc EQ 0.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
CALL FUNCTION w_fm_name
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_outopt
user_settings = 'X'
IMPORTING
job_output_info = t_otfdata
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc EQ 0.
ENDIF. " IF sy-subrc EQ 0.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = w_bin_filesize
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc EQ 0.
ENDIF. " IF sy-subrc EQ 0.
LOOP AT t_pdf_tab.
TRANSLATE t_pdf_tab USING '~'.
CONCATENATE wa_buffer t_pdf_tab INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
t_record = wa_buffer.
APPEND t_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
t_objtxt = ' To Change the COR, Use the Transaction ZCOR_CHANGE'.
APPEND t_objtxt.
t_objtxt = ' Check the Attached PDF file for COR'.
APPEND t_objtxt.
DESCRIBE TABLE t_objtxt LINES w_lines_txt.
READ TABLE t_objtxt INDEX w_lines_txt.
READ TABLE t_objtxt INDEX w_lines_txt.
wa_doc_chng-obj_name = 'COR Display'.
wa_doc_chng-expiry_dat = sy-datum + 10.
CONCATENATE 'COR' "w_cornr
'-' "w_stat_descr w_action_desc
INTO wa_doc_chng-obj_descr SEPARATED BY space.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = w_lines_txt * 255.
CLEAR t_objpack-transf_bin.
t_objpack-head_start = 1.
t_objpack-head_num = 0.
t_objpack-body_start = 1.
t_objpack-body_num = w_lines_txt.
t_objpack-doc_type = 'RAW'.
APPEND t_objpack.
t_objpack-transf_bin = 'X'.
t_objpack-head_start = 1.
t_objpack-head_start = 1.
t_objpack-head_num = 0.
t_objpack-body_start = 1.
DESCRIBE TABLE t_objbin LINES w_lines_bin.
READ TABLE t_objbin INDEX w_lines_bin.
t_objpack-doc_size = w_lines_bin * 255 .
t_objpack-body_num = w_lines_bin.
t_objpack-doc_type = 'PDF'.
t_objpack-obj_name = 'COR'.
t_objpack-obj_descr = 'COR Test'.
* concatenate 'COR' w_cornr into t_objpack-obj_descr
* separated by space.
APPEND t_objpack.
*LOOP AT t_mail_ids.
CLEAR t_reclist.
t_reclist-receiver = 'INTENATEMAIL'.
t_reclist-rec_type = 'U'.
APPEND t_reclist.
*ENDLOOP.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = t_objpack
object_header = wa_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 EQ 0.
ENDIF. -
Layout problem in PDF conversion
Hi all,
i am downloading spool data using the function module CONVERT_ABAPSPOOLJOB_2_PDF. But i am facing layout problem. e.g. RFBILA00(financial statement generation program) has written balancesheet data to the spool. This spool data has some 6 columns. but CONVERT_ABAPSPOOLJOB_2_PDF is writing only first 3 columns to the generated PDF file. i used 'GET_PRINT_PARAMETERS' function module also with values like layout as 'X_65_132' and 'X_90_120'. but no success. if anybody knows the answer, please let me know.
Thanks in advance,
NaveenHi All,
i am following the below approach to download the information from spool.
program/spool output is an ALV List output data having 8 columns. but below approach is converting only first 5 columns in to PDF format. other 3 columns are getting truncated.
FUNCTION /ngl/download_spoolinfo_as_pdf.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_SPOOL_REQUEST) LIKE TSP01-RQIDENT
*" REFERENCE(I_FILENAME) LIKE RLGRAP-FILENAME
*" EXCEPTIONS
*" DOWNLOAD_ERROR
TABLES tsp01.
DATA: mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
mc_filename LIKE rlgrap-filename.
DATA: mstr_print_parms LIKE pri_params,
mc_valid(1) TYPE c,
mi_bytecount TYPE i.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
copies = '1'
cover_page = space
destination = 'locl'
expiration = '1'
immediately = space
mode = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
line_size = 200
line_count = 65
layout = 'X_65_200'
layout = 'X_90_120'
sap_cover_page = 'X'
IMPORTING
out_parameters = mstr_print_parms
valid = mc_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc EQ 0.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = i_spool_request
no_dialog = 'X'
dst_device = mstr_print_parms-pdest
IMPORTING
pdf_bytecount = mi_bytecount
TABLES
pdf = mtab_pdf
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.
IF sy-subrc EQ 0.
mc_filename = i_filename.
DATA: lv_filename TYPE string.
lv_filename = i_filename.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = mi_bytecount
filename = lv_filename
filetype = 'BIN'
TABLES
data_tab = mtab_pdf
EXCEPTIONS
OTHERS = 22.
IF sy-subrc EQ 0.
WRITE:/ mc_filename, 'CONVERTED TO PDF AND DOWNLOADED'.
ELSE.
WRITE:/ 'PROBLEM WITH DOWNLOAD'.
RAISE download_error.
ENDIF.
ELSE.
WRITE:/ 'PROBLEM WITH PDF CONVERSION'.
RAISE download_error.
ENDIF.
ELSE.
WRITE:/ 'PROBLEM GETTING PRINT PARAMETERS'.
RAISE download_error.
ENDIF.
ENDFUNCTION. -
Doc to PDF conversion failed for Acrobat 9 on IIS7/win 2008 system
I wanted to convert a doc to PDF. But getting error when PDF distiller initialized.
Error : 006~ASP 0177~Server.CreateObject Failed~80080005
at statement : Set Obj = server.CreateObject("PdfDistiller.PdfDistiller.1")
This is done is classic ASP.
This works perfectly fine on IIS6/win 2003 with Acrobat 5 . but getting error on production server where IIS7/win 2008,Acrobat 9 is installed.
I have added all the necessary permissions.
What could be the problem?
Any help would be appriciated.But the same thing is working fine for Acrobat distiller 5 on IIS 6 and Win 2003.
With Acrobat 5,printer installed is called Acrobat Distiller and with Acrobat 9, printer installed is called Adobe PDF. This should not affect the distiller functionality/execution I think.
Manual Doc to PDF conversion works, means if document is passed to Adobe PDf it converts the doc to PDF.
Somehow automation is not working failing at statement
Set oDistiller = CreateObject("PDFDistiller.PDFDistiller.1")
Could there be case that Acrobat 9 doesn't support automation or need license or so? -
Broadcast - ERROR max no of 100 conversations exceeded
We've scheduled 3 reports to email PDF's to approx 400 users but the BEx broadcaster only managed to send out about 80 emails. in the various logs and traces I can see and error that states "ERROR max no of 100 conversations exceeded".
I can find various notes about this refering to various sytstem parameters but as far as I can tell our parametrs are set correctly e.g.
gw/max_conn 500
gw/max_sys 300
gw/max_overflow_size 10000000
gw/max_shm_req 50
rdisp/tm_max_no 200
rdisp/max_comm_entries 500
As I understand it from the notes we should increase the environment variable CPIC_MAX_CONV. However the note I'm looking at (316877) states that this environment variable is on the ITS server but from talking to our Basis support the version of netweaver we are running doesnt have an ITS server?? Dont really know what all that means. Any ideas on that one or about the error message as a whole would be greatly appreciated.
If it's any help I can also see in SM21 that at the time of broadcasting the users got the error:
> Conversation ID: 33568780
> CPI-C function: CMSEND(SAP)
Communication error, CPIC return code 017, SAP return code 450
Thren in the broadcast log via RSRD_LOG the users have the error:
Java communication error: Error when opening an RFC connection RSBOLAP017
ThanksHi,
Try using these threads, if you get some help from them.
/thread/174978 [original link is broken]
RFC_ERROR_COMMUNICATION--max no of 100 conversation exceeded
AI_DIRECTORY_JCOSERVER - ConnTest issue Error "max no of 100 conversation" -
Word to PDF Conversion = Different Color on Paper
Hello All,
I created a bunch of forms in Word 2010. Converted them into PDF and made them fillable. On screen Word doc and PDF doc colors look the same, but when I print PDF documents their blue turns intor dark purple. Any suggestions on how to keep colors consistent with the Word doc? I read about software and screen collibration, but I believe that there must be a simplier way to synchronize colors. Again, on screen colors looks the same.... Thank you very much.try these links:
http://www.learningsharepoint.com/2012/10/15/word-to-pdf-conversion-in-sharepoint-2013-via-print-to-pdf/
https://code.msdn.microsoft.com/office/SharePoint-2013-Convert-1e0578a1
https://www.linkedin.com/groups/SharePoint-2013-has-another-awesome-4542747.S.175460660
Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing
Hi,
Thanks for the help.
Your first link use Office Web Apps to generate a PDF and launch printing action, it's not my use case.
I wan't generate a PDF near the word document in a document library.
Your second link is interesting, allow IntranetCall and permission on application service Word Automation but no change.
I have always :
"The file could not be converted due to an intermittent error in the system. Please resubmit this file for conversion. If the file fails again with this error message, contact your system administrator" error code 10.
Help me !!!!
http://kouilb.wordpress.com -
Hi people!
I am trying to enable the pdf conversion on my Content Server (windows).
I installed IBR, same admin and computer as the idc instance.
I installed "PDF Converter" and a distiller engine (afpl ghostcript).
I also installed a new printer on the computer and configured the provider, the file formats, etc ... on Content Server and IBR.
When I check a word document in, I have the following error (no pdf generated) :
(translated from french...)
Failed to check c:/oracle/ucm/server2/vault/~convert/idc/9/essai~1.pdf.tmp.pdf file
'PDFOptimization' has not generated the exit file 'c:/oracle/ucm/server2/vault/~convert/idc/9/essai~1.pdf.tmp.pdf'.
Exception type 'java.lang.Throwable'. [ Details ]
Stack Trace :
Failed to check c:/oracle/ucm/server2/vault/~convert/idc/9/essai~1.pdf.tmp.pdf file <br>'PDFOptimization' has not generated the exit file 'c:/oracle/ucm/server2/vault/~convert/idc/9/essai~1.pdf.tmp.pdf'. <br>!syExceptionType,java.lang.Throwable
java.lang.Throwable
at intradoc.common.IdcLogWriter.doMessageAppend(Unknown Source)
at intradoc.common.Log.addMessage(Unknown Source)
at intradoc.common.Log.errorEx2(Unknown Source)
at intradoc.common.Log.errorEx(Unknown Source)
at docrefinery.agent.Logger.logError(Logger.java:138)
at docrefinery.convert.StepHandler.executeStepByName(StepHandler.java:140)
at docrefinery.convert.ConversionDriver.processSteps(ConversionDriver.java:231)
at docrefinery.convert.ConversionDriver.convertDocument(ConversionDriver.java:144)
at docrefinery.queue.PreConvertedRefineryQueueMonitor.handleCurrentQueueItem(PreConvertedRefineryQueueMonitor.java:204)
at docrefinery.queue.PreConvertedRefineryQueueMonitor.monitorRefineryPreConverterQueue(PreConvertedRefineryQueueMonitor.java:125)
at docrefinery.queue.PreConvertedRefineryQueueMonitor$1.run(PreConvertedRefineryQueueMonitor.java:93)
at java.lang.Thread.run(Thread.java:595)
Could someone help me ?
thanks,
romain.Hi!
I tried that but I got the following errors in the agent log :
"The step MSOfficeToPostscript did not create a log entry, it may not have set results correctly. Exception type is 'java.lang.Throwable
Runtime error:java.lang.NullPointerException
at docrefinery.data.DocumentConversionsSteps.getStepData(DocumentConversionsSteps.java:43)
at docrefinery.data.ConversionDataManager.getStepData(ConversionDataManager.java:78)
at docrefinery.convert.StepHandler.executeStepByName(StepHandler.java:81)
at docrefinery.convert.ConversionDriver.processSteps(ConversionDriver.java:298)
at docrefinery.convert.ConversionDriver.convertDocument(ConversionDriver.java:144)
at docrefinery.convert.ConversionDriver.processSubConversion(ConversionDriver.java:165)
at docrefinery.convert.StepHandler.executeStepByName(StepHandler.java:109)
at docrefinery.convert.ConversionDriver.processSteps(ConversionDriver.java:231)
at docrefinery.convert.ConversionDriver.convertDocument(ConversionDriver.java:144)
at docrefinery.convert.ConversionDriver.processSubConversion(ConversionDriver.java:165)
at docrefinery.convert.StepHandler.executeStepByName(StepHandler.java:109)
at docrefinery.convert.ConversionDriver.processSteps(ConversionDriver.java:231)
at docrefinery.convert.ConversionDriver.convertDocument(ConversionDriver.java:144)
at docrefinery.queue.PreConvertedRefineryQueueMonitor.handleCurrentQueueItem(PreConvertedRefineryQueueMonitor.java:204)
at docrefinery.queue.PreConvertedRefineryQueueMonitor.monitorRefineryPreConverterQueue(PreConvertedRefineryQueueMonitor.java:125)
at docrefinery.queue.PreConvertedRefineryQueueMonitor$1.run(PreConvertedRefineryQueueMonitor.java:93)
at java.lang.Thread.run(Thread.java:595)
AND
"Conversion completed -- Step MSOfficeToPostscript forced conversion failure by conversion engine because of error: 'Unable to convert. Native application reported: '' ActiveX component can't create object'. Exception type is 'java.lang.Throwable'" and the file is not checked in...
Have you an idea ?
Here are the steps I followed to enable PDF conversion :
- Installing component InboundRefinerySupport
- Installing IBR
- Configuring Apache
- Installing PDFConverter.zip
- Installing ghostscript 8.54
- Configuring the distiller engine on "Third-Party Application Settings"
- Installing the printer IDC PDF PRINTER
- Creating the outgoing provider on idc
- Configuring the conversion parameter application/msword to Word
- Configuring the "Primary Web-Viewable Rendition" to "Convert to PDF using third-party applications "
Maybe, I have forgotten something ...
Romain. -
Hello, I have an issue when performing the Spool to PDF conversion. I am using FM CONVERT_ABAPSPOOLJOB_2_PDF to convert an ALV list to a PDF file. When I run my report in the foreground, everything works correctly, the PDF file is attached and then emailed to the appropriate recipient. When I schedule the job to run in the background, the contents of the attachment that is created is truncated on the right side cutting off half of the report (the font is also larger). I am out of ideas on how to solve this issue. Any help would be appreciated.
Hi,
Use this code this work for you
Please reward me if you find this answer is helpful
*& Report YSEND_MAIL_ATTACH
REPORT ysend_mail_attach NO STANDARD PAGE HEADING LINE-COUNT 65(2)
LINE-SIZE 120.
*TABLES/ DATA DECLARATION
TABLES: tsp01,
kna1.
DATA: int_email_receivers LIKE zelift_user_3 OCCURS 0 WITH HEADER LINE.
DATA: int_to_receivers TYPE zeinterface_mail-z_email_to OCCURS 0.
DATA: wa_to_receivers TYPE zeinterface_mail-z_email_to.
DATA: int_mailsend TYPE soos1 OCCURS 0 WITH HEADER LINE.
DATA: printer LIKE pri_params,
mc_valid(1) TYPE c,
p_linsz LIKE sy-linsz VALUE 100,
p_paart LIKE sy-paart VALUE 'X_65_132',
mi_rqident LIKE tsp01-rqident,
mi_bytecount TYPE i,
prg_name LIKE sy-repid,
user_name LIKE sy-uname,
mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
mc_filename LIKE rlgrap-filename,
req_no LIKE tsp01_sp0r-rqid_char,
req_rc LIKE sy-subrc,
nom_char(20),
g_drc_diff.
sending email stuff
DATA: object_hd_change TYPE sood1,
object_type TYPE sood-objtp,
objcont TYPE soli OCCURS 0 WITH HEADER LINE,
objhead TYPE soli OCCURS 0 WITH HEADER LINE,
att_cont TYPE soli OCCURS 0 WITH HEADER LINE,
att_head TYPE soli OCCURS 0 WITH HEADER LINE,
packing_list TYPE soxpl OCCURS 0 WITH HEADER LINE,
receivers TYPE soos1 OCCURS 0 WITH HEADER LINE,
receivers TYPE somlreci1 OCCURS 0 WITH HEADER LINE,
free_recc TYPE soos1 OCCURS 0 WITH HEADER LINE,
object_id_new TYPE soodk,
sent_to_all TYPE sonv-flag,
all_binding_done TYPE sonv-flag,
office_object_key TYPE swotobjid-objkey,
originator_id TYPE soudk,
objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
doc_chng LIKE sodocchgi1,
tab_lines LIKE sy-tabix,
paylist LIKE bapi7004_rl OCCURS 0 WITH HEADER LINE,
p_info LIKE pc407,
pdf_table LIKE tline OCCURS 0 WITH HEADER LINE,
pdf_fsize TYPE i,
pdf_line(134),
spoolid TYPE tsp01-rqident.
***data declaration for sending the mail.
***data declaration for output display.
DATA:BEGIN OF int_kna1 OCCURS 0,
kunnr LIKE kna1-kunnr,
land1 LIKE kna1-land1,
name1 LIKE kna1-name1,
END OF int_kna1.
PARAMETERS p_kunnr LIKE kna1-kunnr.
*start-of-selection
START-OF-SELECTION.
perform display.
*pdf conversion.
PERFORM pdf_conversion.
END-OF-SELECTION.
FORM get_spool_number *
Get the most recent spool created by user/report *
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
FORM get_spool_number USING f_repid
f_uname
CHANGING f_rqident.
DATA:
lc_rq2name LIKE tsp01-rq2name.
CONCATENATE f_repid+0(9)
f_uname+0(3)
INTO lc_rq2name.
CONDENSE lc_rq2name.
SELECT * FROM tsp01 WHERE rq2name = lc_rq2name
ORDER BY rqcretime DESCENDING.
f_rqident = tsp01-rqident.
EXIT.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR f_rqident.
ENDIF.
ENDFORM. " get_spool_number
*---getting the spool created by user/report
*& Form PDF_CONVERSION
text
--> p1 text
<-- p2 text
FORM pdf_conversion.
*-- Setup the Print Parmaters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
authority = space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
IMPORTING
out_parameters = printer
valid = mc_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
IF printer-pdest = space.
printer-pdest = 'LOCL'.
ENDIF.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
printer-linsz = p_linsz.
printer-linct = sy-linct.
printer-paart = p_paart.
printer-prrel = ' '.
prg_name = 'YSEND_MAIL_ATTACH'.
user_name = sy-uname.
SUBMIT yidoc12 TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS printer
WITH p_kunnr = p_kunnr
AND RETURN.
PERFORM get_spool_number USING prg_name user_name
CHANGING mi_rqident.
IF sy-subrc = 0.
IF sendmail = 'X'.
req_no = mi_rqident.
PERFORM spool_pdf_conversion.
PERFORM sendmail.
ENDIF.
ENDIF.
req_no = mi_rqident.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = req_no
IMPORTING
RC = req_rc
status = req_rc.
IF req_rc <> 0.
IF req_rc = 0.
LEAVE PROGRAM.
ENDIF.
ENDFORM. " PDF_CONVERSION
*****pdf conversion----
*& Form SPOOL_PDF_CONVERSION
text
--> p1 text
<-- p2 text
FORM spool_pdf_conversion.
spoolid = req_no.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spoolid
no_dialog = space
dst_device = printer-pdest
IMPORTING
pdf_bytecount = pdf_fsize
TABLES
pdf = pdf_table
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.
ENDFORM. " FILE_UPLOAD
********converting the spool job to pdf******************************
*sending the mail as an attachment using the fm
*& Form SENDMAIL
text
--> p1 text
<-- p2 text
FORM sendmail.
DATA : BEGIN OF lt_pdflns OCCURS 0.
INCLUDE STRUCTURE solisti1.
DATA : END OF lt_pdflns.
DATA: l_ind,
l_nom_key_o LIKE oijnomi-nomtk.
General header data.
MOVE: sy-langu TO object_hd_change-objla,
'Ext.email' TO object_hd_change-objnam,
'C' TO object_hd_change-objsns,
'TXT' TO object_hd_change-file_ext,
'REQUIRED OUTPUT' TO object_hd_change-objdes.
Body of the message itself (255).
MOVE ' REPORT TESTING' TO objcont-line.
APPEND objcont.
CONCATENATE 'Time: ' sy-uzeit0(2) ':' sy-uzeit2(2) ':' sy-uzeit+4(2)
INTO objcont-line.
APPEND objcont.
MOVE: 'RAW' TO object_type.
LOOP AT pdf_table.
lt_pdflns = pdf_table.
APPEND lt_pdflns.
CLEAR lt_pdflns.
ENDLOOP.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = 134
line_width_dst = 255
TABLES
content_in = lt_pdflns
content_out = objbin
EXCEPTIONS
err_line_width_src_too_long = 1 "content_out
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
DESCRIBE TABLE objbin LINES tab_lines.
*get the mail ids for sending the emails.
Fill email receivers
IF int_email_receivers[] IS INITIAL.
CALL FUNCTION 'ZEI_GET_INTERFACE_MAILIDS'
EXPORTING
program_name = 'ZER02230_TSPPRA'
interface = 'TS_TMJ_REJ'
key = 'NOMTK'
value = 'FAILURE_RECEIVERS'
DIRECTION =
NOTES =
IMPORTING
to_mail_recivers = int_to_receivers
CC_MAIL_RECIVERS = int_cc_receivers
EXCEPTIONS
no_data_found = 1
OTHERS = 2
Appending Email addresses if found.
IF NOT int_to_receivers[] IS INITIAL.
LOOP AT int_to_receivers INTO wa_to_receivers.
MOVE wa_to_receivers TO int_mailsend-recextnam .
int_mailsend-recesc = 'U'.
int_mailsend-sndart = 'INT'.
int_mailsend-sndpri = '1'.
APPEND int_mailsend.
ENDLOOP.
ENDIF.
ELSE.
LOOP AT int_email_receivers.
CONCATENATE int_email_receivers '@exchange.aramco.com.sa' INTO
int_mailsend-recextnam.
int_mailsend-recesc = 'U'.
int_mailsend-sndart = 'INT'.
int_mailsend-sndpri = '1'..
APPEND int_mailsend.
ENDLOOP.
ENDIF.
**************end of the getting emails for sending the mails
DESCRIBE TABLE objbin LINES tab_lines.
MOVE: "'X' TO packing_list-TRANSF_BIN,
'1' TO packing_list-head_start,
'1' TO packing_list-head_num,
'1' TO packing_list-body_start,
tab_lines TO packing_list-body_num,
'RAW' TO packing_list-objtp,
'Attachment' TO packing_list-objnam,
'PDF' TO packing_list-file_ext.
packing_list-objlen = tab_lines * 255.
CONCATENATE 'REPORT TESTING' '--'
sy-datum4(2) '/' sy-datum6(2) '/' sy-datum+0(4)
sy-uzeit0(2) ':' sy-uzeit2(2) ':' sy-uzeit+4(2)
INTO packing_list-objdes.
APPEND packing_list.
objhead = 'testing the email for pdf'.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = object_hd_change
object_type = object_type
IMPORTING
object_id_new = object_id_new
sent_to_all = sent_to_all
all_binding_done = all_binding_done
office_object_key = office_object_key
originator_id = originator_id
TABLES
objcont = objcont
objhead = objhead
receivers = int_mailsend
packing_list = packing_list
att_cont = objbin
att_head = att_head
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
originator_not_exist = 20
x_error = 21
OTHERS = 22.
IF sy-subrc EQ 0.
COMMIT WORK.
ELSE.
MESSAGE i014(ze9) WITH 'Email was not sent to the Recipients'.
ENDIF.
ENDFORM. " SENDMAIL
************sending mail as an attachment
*for displaying
form display.
endform.
*for displaying -
Your PDF conversion request failed.
Everytime I try to combine my PDF's I keep getting a message that says Your PDF Conversion Request Failed.
Hi,
Please let me know if your files are big. complex, or image files?
If you sill have the same error message then please share your files with us so that we can look at them using below site:
https://adobeformscentral.com/?f=qJiclooYWGGNFtWfj8g3wg#
Thank you.
Hisami
Maybe you are looking for
-
I have several Apple products, some eligible for iCloud and some not. I was using MobileMe and elected to keep my email address after June 30. I moved to iCloud and everything seems to be working except for my MacBook that couldn't be upgraded to L
-
Sending vector logo to client as one flat layer??
AI newbie here. How do you send the client a vector logo? When I save my logo as EPS, it is still in a thousand pieces. Is it possible to "Flatten" logo like in Photoshop before sending as vector? My logo has some transparency which I'd like to keep.
-
How to publish a 3rd party webservice ?
Hi Guys, I have a wsdl file of the 3rd party webservice and now i need to consume this service in ABAP on ECC 6.0. I am following the video presentation by Thomas Jung /people/thomas.jung/blog/2007/12/17/consuming-services-with-abap while doing so th
-
Dynamic Variables and New-Object - in a GUI
so, i have not found anything that i can parlay into a solution for what i am attempting to do. Basically i am using powershell to build a GUI to manage websites on various servers. in a nutshell: - i have an array with the servers i want to quer
-
Hello all, I have a requirement to create a query on a table that has a column called created_datetime which is of type TIMESTAMP(6) (using Oracle 9i). The query should return all results where the date is greater than 1,200,000 milliseconds from Jan