Skip to Content

Convert smartfrom output to MS word file

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 11:16 AM

    hi

    just try the code given in this thread

    convert-smartform-to-word

    hope it helps

    regards

    Aakash Banga

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.