cancel
Showing results for 
Search instead for 
Did you mean: 

po to pdf

Former Member
0 Kudos

hi all

i am functional consultant and just want to know that.

is it possible to send a po to vendor as an pdf.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It is possibel to send a mail to a vendor in PDF format.

Thanks.

Former Member
0 Kudos

hi

waht is spool no

'if i excute the report for converting po to pdf system gives message that spool no required

i dont know what is spool no and how to get it and how to create it

Former Member
0 Kudos

Hi,

see transaction SP01 or SP02.

Then you see the spool.

The spool is a kind of data container via where all to be printed data is gathered.

every item has a spool number.

Gr., Frank

Your program has to remember which spoolnumber it created.

With this number it gets the data out of the spool and converts it into a PDF.

How lloks the program you are using?

Former Member
0 Kudos

u dont need a spool no to generate pdf, better get output in otf format, can u show us the code u have implemented.

кu03B1ятu03B9к

Former Member
0 Kudos

hi all

i am using standrad program for converting po into pdf the program name is mentiuioned in one of the above thread that starts from R

please tell in whihc situtation system will create a spool request and how to do the settings for the same

Former Member
0 Kudos

i have the po no. now i just need to convert this to pdf

tell me what should i do

i have tried with standard program but system is asking for spool no and which i dont have now could u please tell me the way out

Answers (1)

Answers (1)

Former Member
0 Kudos

YES

Possible

check Link: [;

Gr., Frank

Former Member
0 Kudos

well as u said it is possible then please tell me is it by standard programe in sap or by the some devlopment and in case devlopment is required please give the code here and also i want to send the pdf po via email

although i know the settings required for sending po via mail but i need to know how to send a pdf po via mail

Former Member
0 Kudos

Hi,

It needs a little development. I have here an example coding.

hope it helps you.

the extra development starts at the OTF-DATA

Gr., Frank

&----


*& Report ZFBTEST

*&

&----


*&

*&

&----


REPORT ZFBTEST

.

range

data: form_name(20) type c.

DATA: IT_OTFDATA TYPE STANDARD TABLE OF ITCOO,

IT_TLINE TYPE STANDARD TABLE OF TLINE,

W_OPTIONS LIKE ITCPO .

W_OPTIONS-TDGETOTF = 'X'.

form_name = 'ZSCRPT_PDF'.

*data retreval

  • open layoout

call function 'OPEN_FORM'

EXPORTING

APPLICATION = 'TX'

  • ARCHIVE_INDEX = ARCHIVE_INDEX

  • ARCHIVE_PARAMS = ARCHIVE_PARAMS

DEVICE = 'PRINTER'

DIALOG = SPACE

FORM = form_name

  • LANGUAGE = SY-LANGU

OPTIONS = W_OPTIONS

  • MAIL_SENDER = MAIL_SENDER

  • MAIL_RECIPIENT = MAIL_RECIPIENT

  • MAIL_APPL_OBJECT = MAIL_APPL_OBJECT

  • RAW_DATA_INTERFACE = '*'

  • SPONUMIV = SPONUMIV

  • IMPORTING

  • LANGUAGE = LANGUAGE

  • NEW_ARCHIVE_PARAMS = NEW_ARCHIVE_PARAMS

  • RESULT = RESULT

  • EXCEPTIONS

  • CANCELED = 1

  • DEVICE = 2

  • FORM = 3

  • OPTIONS = 4

  • UNCLOSED = 5

  • MAIL_OPTIONS = 6

  • ARCHIVE_ERROR = 7

  • INVALID_FAX_NUMBER = 8

  • MORE_PARAMS_NEEDED_IN_BATCH = 9

  • SPOOL_ERROR = 10

  • CODEPAGE = 11

  • OTHERS = 12

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

  • processing logic

  • display data on to layout

call function 'WRITE_FORM'

EXPORTING

ELEMENT = 'SOLD'

FUNCTION = 'APPEND'

TYPE = 'BODY'

WINDOW = 'SOLD'

  • IMPORTING

  • PENDING_LINES = PENDING_LINES

  • EXCEPTIONS

  • ELEMENT = 1

  • FUNCTION = 2

  • TYPE = 3

  • UNOPENED = 4

  • UNSTARTED = 5

  • WINDOW = 6

  • BAD_PAGEFORMAT_FOR_PRINT = 7

  • SPOOL_ERROR = 8

  • CODEPAGE = 9

  • OTHERS = 10

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

call function 'WRITE_FORM'

EXPORTING

ELEMENT = 'START'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

  • IMPORTING

  • PENDING_LINES = PENDING_LINES

  • EXCEPTIONS

  • ELEMENT = 1

  • FUNCTION = 2

  • TYPE = 3

  • UNOPENED = 4

  • UNSTARTED = 5

  • WINDOW = 6

  • BAD_PAGEFORMAT_FOR_PRINT = 7

  • SPOOL_ERROR = 8

  • CODEPAGE = 9

  • OTHERS = 10

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

call function 'WRITE_FORM'

EXPORTING

ELEMENT = 'MAIN_DATA'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

  • IMPORTING

  • PENDING_LINES = PENDING_LINES

  • EXCEPTIONS

  • ELEMENT = 1

  • FUNCTION = 2

  • TYPE = 3

  • UNOPENED = 4

  • UNSTARTED = 5

  • WINDOW = 6

  • BAD_PAGEFORMAT_FOR_PRINT = 7

  • SPOOL_ERROR = 8

  • CODEPAGE = 9

  • OTHERS = 10

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

call function 'WRITE_FORM'

EXPORTING

ELEMENT = 'SOLD'

  • FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

  • IMPORTING

  • PENDING_LINES = PENDING_LINES

  • EXCEPTIONS

  • ELEMENT = 1

  • FUNCTION = 2

  • TYPE = 3

  • UNOPENED = 4

  • UNSTARTED = 5

  • WINDOW = 6

  • BAD_PAGEFORMAT_FOR_PRINT = 7

  • SPOOL_ERROR = 8

  • CODEPAGE = 9

  • OTHERS = 10

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

  • close layout

call function 'CLOSE_FORM'

  • IMPORTING

  • RESULT = RESULT

  • RDI_RESULT = RDI_RESULT

TABLES

OTFDATA = IT_OTFDATA

  • EXCEPTIONS

  • UNOPENED = 1

  • BAD_PAGEFORMAT_FOR_PRINT = 2

  • SEND_ERROR = 3

  • SPOOL_ERROR = 4

  • CODEPAGE = 5

  • OTHERS = 6

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

DATA: BIN_FILESIZE TYPE I.

call function 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

  • MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

IMPORTING

BIN_FILESIZE = BIN_FILESIZE

  • BIN_FILE = BIN_FILE

tables

otf = IT_OTFDATA

lines = IT_Tline

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

endif.

DATA: filename type string.

filename = 'c:\TEST\test.pdf'.

call function 'GUI_DOWNLOAD'

exporting

BIN_FILESIZE = BIN_FILESIZE

filename = filename

FILETYPE = 'BIN'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH = FILELENGTH

tables

data_tab = it_tline

  • FIELDNAMES = FIELDNAMES

  • 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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

Former Member
0 Kudos

Hi,

Is is also possible to send it as an PDF by email directly.

Buti cannot gave that code right. i have to search for it.

Gr. Frank

Former Member
0 Kudos

check this code tutorial

https://wiki.sdn.sap.com/wiki/display/Snippets/mailsendthroughoutputcontrols

Its for sending a smartform which is the PO output to external email id with pdf attachment, the name of attachment would be the PO number.

кu03B1ятu03B9к