Skip to Content
avatar image
Former Member

what is code for to open a pdf format for scripts and smartforms

hi

experts

can we help for this

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jul 09, 2007 at 03:44 AM

    Hi Raviteja,

    Here is the code for converting a smartform into a PDF File..

    DATA: BIN_FILESIZE TYPE I,

    BIN_FILE TYPE XSTRING,

    T_OTF LIKE ITCOO OCCURS 200 WITH HEADER LINE,

    T_DOC LIKE DOCS OCCURS 200 WITH HEADER LINE,

    T_LINES1 LIKE TLINE OCCURS 200 WITH HEADER LINE,

    T_FINAL_PDF LIKE TLINE OCCURS 500 WITH HEADER LINE,

    filename TYPE string VALUE 'EXP.pdf',

    path TYPE string VALUE 'C:\DESKTOP\..',

    fullpath TYPE string VALUE 'C:\DESKTOP\PDF\EXP.pdf',

    CALL FUNCTION 'CONVERT_OTF_2_PDF'

    EXPORTING

    use_otf_mc_cmd = 'X'

    • ARCHIVE_INDEX =

    IMPORTING

    bin_filesize = bin_filesize

    TABLES

    otf = t_otf

    doctab_archive = t_doc

    lines = t_lines1

    EXCEPTIONS

    err_conv_not_possible = 1

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

    LOOP AT t_lines1 INTO t_lines1.

    APPEND t_lines1 TO t_final_pdf.

    ENDLOOP.

    CALL METHOD cl_gui_frontend_services=>file_save_dialog

    EXPORTING

    default_file_name = 'EXPO_INVpdf'

    prompt_on_overwrite = 'X'

    CHANGING

    filename = filename

    path = path

    fullpath = fullpath.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    bin_filesize = bin_filesize

    filename = fullpath

    filetype = 'BIN'

    append = 'X'

    IMPORTING

    filelength = bin_filesize

    TABLES

    data_tab = t_final_pdf.

    IF sy-subrc EQ 0.

    MESSAGE s018(zmsg) WITH 'PDF Generated Successfully'.

    ELSE.

    MESSAGE s011(zmsg) WITH 'PDF Not Generated !!!'.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 09, 2007 at 05:05 AM

    Hi

    There is no special TCODE for opening the Script'SF in PDF format

    We take the SPOOL ID of script/sf and convert it to PDF format using the fun modules

    'CONVERT_OTF_2_PDF'

    CONVERT_ABAPSPOOLJOB_2_PDF

    and see the output in PDF format.

    Reward points for useful Answers

    Regards

    Anji

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 09, 2007 at 05:42 AM

    Hi,

    as variant, u can type PDF! in transaction window when your smartform output.

    Add comment
    10|10000 characters needed characters exceeded