Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Script to PDF to Mail

former_member229729
Active Participant
0 Likes
1,261

Dear Friends,

I have a below scenario on Script:

I need to convert the Script to PDF in background and send it to External Mail Box.

Please give me an idear or sample code, if possible.

Thanks and regards,

Ramani

Dear Friends,

I have a below scenario on Script:

I need to convert the Script to PDF in background and send it to External Mail Box.

Please give me an idear or sample code, if possible.

Thanks and regards,

Ramani

5 REPLIES 5
Read only

Former Member
0 Likes
1,169

Hi,

See the fallowing link

it will solve ur problem

Regards,

Vijay

Read only

Former Member
0 Likes
1,169

Hi,

Refer to the following program.

TABLES: likp, lips,itcpo.

DATA: pdftab type standard TABLE OF tline,

datab TYPE standard TABLE OF itcoo.

itcpo-tdgetotf = 'X'.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

DEVICE = 'PRINTER'

DIALOG = 'X'

FORM = 'Z_PRAC'

LANGUAGE = SY-LANGU

OPTIONS = itcpo

// call script using start_form and write_form.

CALL FUNCTION 'END_FORM'

IMPORTING

RESULT = gi_ofc

CALL FUNCTION 'CLOSE_FORM'

TABLES

OTFDATA = datab

EXCEPTIONS

UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

SEND_ERROR = 3

SPOOL_ERROR = 4

CODEPAGE = 5

OTHERS = 6

.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

IMPORTING

BIN_FILESIZE = BINFILE

TABLES

otf = datab

lines = pdftab

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = binfile

filename = 'D:\MYFILE.PDF' //give the address where u want output.

FILETYPE = 'BIN'

tables

data_tab = pdftab

Regards,

Rajesh Kumar

Read only

0 Likes
1,169

Dear Rajesh,

The requirement is to send the PDF file thro mail, not Download.

Thanks and regards,

Ramani

Read only

0 Likes
1,169

Hi,

the above ans is for how to convert SAP script into PDF file.

to know how to send pdf file as attachment in a mail..refer to the link given.

Hope it will solve your problem.

Regards,

Rajesh Kumar

Edited by: Rajesh Kumar on Aug 19, 2009 10:46 AM

Read only

former_member188827
Active Contributor
0 Likes
1,169

for mail use function:SO_NEW_DOCUMENT_ATT_SEND_API1.if you check its documentation you will get to know how to call this FM.