Skip to Content
avatar image
Former Member

smartform and acrobat output

Hi All ,

I have developed a report on incometax and using smartforms .The output is coming as required .

Now the new requirement is that I have to get the same output in acrobat format as well at a particular locaiton in system as C drive .

Later I have to send the mails of that acrobat output to the employees .

My TL as asked me to take selection screen with 2 check boxes.1) for dispaly in smart forms and 2) for acrobat form .So which ever the check box user selects the out put shld be displayed in that format .

Thanks

I want to know if there is any function module used to convert the out put to acrobat and later send a mail.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 15, 2006 at 10:53 AM

    This program is used to convert script to PDF

    use this FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send a document through mail.

    DATA : ITC TYPE ITCPO,

    OTF LIKE TABLE OF ITCOO,

    DOC LIKE TABLE OF DOCS,

    TLINES LIKE TABLE OF TLINE,

    BIN_FILESIZE TYPE I.

    ITC-TDGETOTF = 'X'.

    ***In close form we have to specify this*

    CALL FUNCTION 'CLOSE_FORM'.

    TABLES

    OTFDATA = OTF.

    CALL FUNCTION 'CONVERT_OTF_2_PDF'

    IMPORTING

    BIN_FILESIZE = BIN_FILESIZE

    TABLES

    OTF = OTF

    DOCTAB_ARCHIVE = DOC

    LINES = TLINES.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    BIN_FILESIZE = BIN_FILESIZE

    FILENAME = 'C:\TESTPDF.PDF'

    FILETYPE = 'BIN'

    TABLES

    DATA_TAB = tlines.

    Hope this is useful.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 15, 2006 at 10:45 AM

    REFER THIS THREAD

    Convert Smartform to PDF

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 15, 2006 at 10:48 AM

    Hi,

    This shuld help you check this out.

    CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

    format = 'PDF'

    max_linewidth = 132

    IMPORTING

    bin_filesize = ws_bin_size

    TABLES

    otf = i_otf

    lines = i_lines

    EXCEPTIONS

    err_max_linewidth = 1

    err_format = 2

    err_conv_not_possible = 3

    err_bad_otf = 4

    OTHERS = 5.

    IF sy-subrc <> 0.

    flg_exit = 'X'.

    MESSAGE i050 WITH 'Error converting to PDF format'.

    EXIT.

    ENDIF.

    • Get the download path

    PERFORM get_download_path CHANGING ws_filename.

    if flg_exit = 'X'.

    EXIT.

    endif.

    • Download

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    bin_filesize = ws_bin_size

    filename = ws_filename

    filetype = 'BIN'

    TABLES

    data_tab = i_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.

    MESSAGE i050 WITH 'Error while File download'.

    flg_exit = 'X'.

    EXIT.

    ELSE.

    MESSAGE i050 WITH 'File downloaded successfully '.

    flg_exit = 'X'.

    EXIT.

    ENDIF.

    or go through this link.

    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450

    or go through this link as well.

    http://sap4.com/wiki/index.php?title=Genera_PDF_a_partir_de_Smartforms

    Feel free to revert back.

    --Ragu

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 16, 2006 at 04:57 AM

    You can create a PDF document out of a Smartform.

    1. Get the OTF form data in OTF table by activating the flag in SSFCTRLOP - "Smart Forms: Control structure". You get the Form data in import parameter - JOB_OUTPUT_INFO-OTFDATA.

    2. Convert this OTFData into PDF data by FM " CONVERT_OTF_2_PDF ".

    3. Download the PDF converted data into the local PC by FM " WS_DOWNLOAD / DOWNLOAD ".

    4. You can open the downloaded file by using FM " WS_EXECUTE ".

    I hope it helps.

    Best Regards,

    Vibha

    *Please mark all the helpful answers

    Add comment
    10|10000 characters needed characters exceeded