on 04-07-2009 9:56 AM
Hi All,
I am using 'CONVERT_OTF' function module to convert the OTF data to PDF.
Later I am using 'OPEN DATASET' IN BINARY MODE to open the file in the file share and write the PDF data to it.
The sample code goes like:
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lv_filesize
TABLES
otf = lt_otfdata[]
lines = lt_lines[]
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE i387 WITH text-028 sy-subrc.
ENDIF.
OPEN DATASET <file> FOR OUTPUT IN BINARY MODE .
*Write data to output file share.
LOOP AT lt_lines INTO wa_lines.
TRANSFER wa_lines TO lv_filename.
ENDLOOP.
*Close the file
CLOSE DATASET lv_filename.
When I try to open the file generated in the file share, I get an error 'Adobe Reader cannot open the file because it may not be a supported file type or the file may have been corrupted or damaged'.
When I download the file using 'GUI_DOWNLOAD' on my desktop, it works fine.
Please let me know if I am missing something in my code.
Thanks in advance,
RAVI
Edited by: Maruvada Ravi Kishore on Apr 7, 2009 10:56 AM
Edited by: Maruvada Ravi Kishore on Apr 7, 2009 10:57 AM
Edited by: Maruvada Ravi Kishore on Apr 7, 2009 11:01 AM
hi ,
in loop do as follow:
data :adg_buffer type string.
Transfer the 132-long strings to 255-long strings
LOOP AT lt_lines INTO wa_lines.
TRANSLATE wa_lines USING ' ~'.
CONCATENATE GD_BUFFER wa_lines INTO GD_BUFFER.
ENDLOOP.
TRANSLATE GD_BUFFER USING '~ '.
transfer GD_BUFFER to lv_filename.
hope this solves your problem.
thanks,
anupama.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anupama,
I have coded the below lines as suggested.
data : gd_buffer type string.
Transfer the 132-long strings to 255-long strings
LOOP AT lt_lines INTO wa_lines.
TRANSLATE wa_lines USING ' ~'.
CONCATENATE GD_BUFFER wa_lines INTO GD_BUFFER.
ENDLOOP.
TRANSLATE GD_BUFFER USING '~ '.
TRANSFER GD_BUFFER to lv_filename.
But I still get the same error 'Adobe Reader cannot open the file because it may not be a supported file type or the file may have been corrupted or damaged'.
Thanks,
RAVI
Can u tell how lv_filename
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.