Skip to Content
avatar image
Former Member

smart forms

how to convert smart form o/p to pdf format

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Oct 24, 2007 at 06:03 AM

    hi check the following links:

    pdf-file-format-error-smartform-to-email-attachmen

    convert-smartform-to-pdf

    reward points if it helps

    rgds

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 24, 2007 at 06:04 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 24, 2007 at 06:36 AM

    hi using this function module u can convert smartform output to pdf

    CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

    FORMAT = 'PDF'

    • MAX_LINEWIDTH = 132

    • ARCHIVE_INDEX = ' '

    © 2006 SAP AG 9

    • COPYNUMBER = 0

    • ASCII_BIDI_VIS2LOG = ' '

    • PDF_DELETE_OTFTAB = ' '

    IMPORTING

    BIN_FILESIZE = BINFILESIZE

    • BIN_FILE =

    TABLES

    otf = DATAB[]

    lines = PDFTAB[]

    • 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.

    reward points if useful.

    Thanks,

    Usha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 24, 2007 at 06:41 AM

    Hi Sai,

    This sample let u knw

    report ztest.

    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,

    i_tline TYPE TABLE OF tline WITH HEADER LINE,

    i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,

    i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,

    • Objects to send mail.

    i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,

    i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,

    i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,

    i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,

    • Work Area declarations

    wa_objhead TYPE soli_tab,

    w_ctrlop TYPE ssfctrlop,

    w_compop TYPE ssfcompop,

    w_return TYPE ssfcrescl,

    wa_doc_chng typE sodocchgi1,

    w_data TYPE sodocchgi1,

    wa_buffer TYPE string,"To convert from 132 to 255

    • 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,

    v_lines_txt TYPE i,

    v_lines_bin TYPE i.

    call function 'SSF_FUNCTION_MODULE_NAME'

    exporting

    formname = 'ZSMART1'

    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'.

    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.

    i_otf[] = w_return-otfdata[].

    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.

    • Fehlerhandling

    if sy-subrc <> 0.

    endif.

    loop at i_tline.

    translate i_tline using '~'.

    concatenate wa_buffer i_tline into wa_buffer.

    endloop.

    translate wa_buffer using '~'.

    do.

    i_record = wa_buffer.

    append i_record.

    shift wa_buffer left by 255 places.

    if wa_buffer is initial.

    exit.

    endif.

    enddo.

    • Attachment

    refresh:

    i_reclist,

    i_objtxt,

    i_objbin,

    i_objpack.

    clear wa_objhead.

    i_objbin[] = i_record[].

    ths i_odjbin will contain the covert otf format to PDF format data after ths u need to send to mail as attachment..

    If useful , reward the points

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 24, 2007 at 07:56 AM
    Add comment
    10|10000 characters needed characters exceeded