cancel
Showing results for 
Search instead for 
Did you mean: 

smartform and acrobat output

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (3)

Answers (3)

Former Member
0 Kudos

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

raguraman_c
Active Contributor
0 Kudos

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

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

Former Member
0 Kudos

HI Raghuraman ,

I have internal tables : i_output andi_output_all which contains data .

I have to pass that tables to fn mod . convert_otf .where shld I pass this tables for getting converted .

Regards

SAntosh

raguraman_c
Active Contributor
0 Kudos

Hi,

Its simle did you open the function module in SE37 and check tables,

it is

OTF LIKE ITCOO Input table with OTF format

Feel free to revert back.

--Ragu

raguraman_c
Active Contributor
0 Kudos

Hi,

Its simle did you open the function module in SE37 and check tables,

it is

OTF LIKE ITCOO Input table with OTF format

Feel free to revert back.

--Ragu

raguraman_c
Active Contributor
0 Kudos

Hi,

Its simle did you open the function module in SE37 and check tables,

it is

OTF LIKE ITCOO Input table with OTF format

Feel free to revert back.

--Ragu

Former Member
0 Kudos

REFER THIS THREAD