12-22-2008 10:12 AM
Hi Experts,
I am trying to import smartform output to a doc file .The problem I am getting is taht the smartform logo is not visible in the output file.
Please suggest . points are sure
For this I am using following code :
IF xscreen NE 'X'.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'ASCII'
max_linewidth = 77
*End of modification
IMPORTING
bin_filesize = filesize
TABLES
otf = wt_output_info-otfdata
lines = lines.
IF sy-subrc <> 0.
retcode = 4.
ELSE.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
*Code modified by S00E493 dated 22-Dec-2008
default_extension = 'doc'
default_file_name = 'Commercial proposal'
file_filter = '(.doc)|.doc|'
*End of modification
CHANGING
filename = name
path = path
fullpath = fullpath
user_action = uact
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF uact = cl_gui_frontend_services=>action_cancel.
cancel = 'X'.
retcode = 4.
EXIT.
ENDIF.
*Code modified by S00E493 dated 21-Dec-2008
MODIFY lines FROM ls_lines TRANSPORTING tdformat WHERE tdformat <> space.
LOOP AT lines.
li_lines = lines-tdline.
APPEND li_lines.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = fullpath
filetype = 'DAT'
TABLES
data_tab = li_lines
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
retcode = 4.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDIF.
Thanks,
Sushant
12-22-2008 10:49 AM
Hi,
If you have done a search in the forum, you would have got the answer.
Anyway the answer is "Its not possible to convert smartform into word with images/logo"
And the alternate way is to download it as pdf and using a full-fledged external PDF2WORD converter software to do the word conversion.
Regards
Karthik D
12-22-2008 11:16 AM