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

SMARTFORMS TO PDF

Hi all,

can anyone tell me the steps for converting a smartform output to a pdf file

Nagesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2005 at 03:50 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2005 at 03:43 AM

    try with this

    data: l_pdf_xstring type xstring,

    lt_lines type table of tline,

    ls_line type tline,

    l_pdf_len type i,

    itab type TSFOTF,

    witab type ITCOO,

    tmp_line type STRING,

    tmp_header type STRING.

    tmp_header = 'smarforms to PDF'.

    tmp_line = file_content.

    CONCATENATE

    tmp_header

    tmp_line

    INTO tmp_line IN CHARACTER MODE.

    APPEND tmp_line TO itab.

    call function 'CONVERT_OTF'

    exporting

    format = 'PDF'

    importing

    bin_filesize = l_pdf_len

    bin_file = l_pdf_xstring

    tables

    otf = itab

    lines = lt_lines

    exceptions

    err_max_linewidth = 1

    err_format = 2

    err_conv_not_possible = 3

    err_bad_otf = 4

    others = 5

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2005 at 04:27 AM

    Hi Nagesh

    You can try changing the default format (OTF) to PDF using transaction SCOT

    Regards

    Ashish Jain

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 12, 2005 at 06:55 AM

    Hi,

    Here is the sample code.

    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,

    i_tline TYPE TABLE OF tline WITH HEADER LINE,

    • Work Area declarations

    w_ctrlop TYPE ssfctrlop,

    w_compop TYPE ssfcompop,

    w_return TYPE ssfcrescl,

    • Variables declarations

    v_form_name TYPE rs38l_fnam,

    v_len_in LIKE sood-objlen,

    v_len_out LIKE sood-objlen,

    v_len_outn TYPE i.

    Step 1:

    call function 'SSF_FUNCTION_MODULE_NAME'

    exporting

    formname = 'ZZZ_TEST2'

    importing

    fm_name = v_form_name

    exceptions

    no_form = 1

    no_function_module = 2

    others = 3.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    w_ctrlop-getotf = 'X'.

    w_ctrlop-no_dialog = 'X'.

    w_compop-tdnoprev = 'X'.

    Step 2:

    CALL FUNCTION v_form_name

    EXPORTING

    control_parameters = w_ctrlop

    output_options = w_compop

    user_settings = 'X'

    IMPORTING

    job_output_info = w_return

    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.

    Step 3:

    i_otf[] = w_return-otfdata[].

    Step 4:

    CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

    format = 'PDF'

    max_linewidth = 132

    IMPORTING

    bin_filesize = v_len_in

    TABLES

    otf = i_otf

    lines = i_tline

    EXCEPTIONS

    err_max_linewidth = 1

    err_format = 2

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

    Hope this helps.

    If so,kindly reward points.If you need clarifications,kindly get back.

    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.