Skip to Content
author's profile photo Former Member
Former Member

Conversion of Smartform output to PDF

Hi,

I have made one Smartform .

My problem is that i do not want to print the smartform.

i want to convert it into pdf and send through Mail to the Customer or client or anywhere.

<<removed by moderator>>

Please search before posting further. Follow the forum guidelines.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2008 at 07:41 AM

    Hi,

    Use This function module CONVERT_OTF to convert In Ur Print program

    sample code

    &----


    *& Report ZPDF_DNLD_TEST2 *

    *& *

    &----


    *& DEVK904540 *

    *& *

    &----


    REPORT ZPDF_DNLD_TEST2 .

    data: i_otf LIKE itcoo OCCURS 100 WITH HEADER LINE,

    i_pdf LIKE tline OCCURS 100 WITH HEADER LINE.

    data: op_option type SSFCTRLOP,

    job_output type SSFCRESCL.

    op_option-getotf = 'X'.

    CALL FUNCTION '/1BCDWB/SF00000005'

    EXPORTING

    ARCHIVE_INDEX =

    ARCHIVE_INDEX_TAB =

    ARCHIVE_PARAMETERS =

    CONTROL_PARAMETERS = op_option

    MAIL_APPL_OBJ =

    MAIL_RECIPIENT =

    MAIL_SENDER =

    OUTPUT_OPTIONS =

    USER_SETTINGS = 'X'

    itab1 = itab1

    IMPORTING

    DOCUMENT_OUTPUT_INFO =

    JOB_OUTPUT_INFO = job_output

    JOB_OUTPUT_OPTIONS =

    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.

    CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

    FORMAT = 'PDF'

    MAX_LINEWIDTH = 132

    ARCHIVE_INDEX = ' '

    COPYNUMBER = 0

    ASCII_BIDI_VIS2LOG = ' '

    PDF_DELETE_OTFTAB = ' '

    IMPORTING

    BIN_FILESIZE =

    BIN_FILE =

    TABLES

    otf = job_output-otfdata

    lines = i_pdf

    EXCEPTIONS

    ERR_MAX_LINEWIDTH = 1

    ERR_FORMAT = 2

    ERR_CONV_NOT_POSSIBLE = 3

    ERR_BAD_OTF = 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.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    BIN_FILESIZE =

    filename = 'c:\test_pdf_sf.pdf'

    FILETYPE = 'BIN'

    tables

    data_tab = i_pdf

    FIELDNAMES =

    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.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Regards

    swamy

    Edited by: Ranga Swamy on Oct 30, 2008 8:44 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2008 at 07:51 AM

    Hi,

    Please Read the [Rules of Engagement |https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]before posting.

    Give a proper Subject Line.

    Search before posting questions.

    Regards

    Karthik D

    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.