07-19-2007 6:42 AM
hi,
can anyone tell me that how to convert sap script into otf format in background job scheduling ,currently by default it is taking list format.
thanks.
07-19-2007 6:44 AM
07-19-2007 6:44 AM
07-19-2007 6:46 AM
07-19-2007 6:47 AM
hi,
Visit this link for SAMple code of SAPSCRIPT to PDF.:
http://www.sapgenie.com/abap/pdf_creation.htm
and check the following weblog for code samples.
/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
chk this one
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
some function modules useful would be
CONVERT_OTF
SO_NEW_DOCUMENT_ATT_SEND_API1 to send mails with attachments
plzz refer to this link..it will solve ur problem
Regards
07-19-2007 6:48 AM
Hi,
Try this and reward if found helpfull. Please look at these function modules.
<b>Please reward if found helpfull</b>
Regards,
Rakesh.
DATA: wa_itcpp LIKE itcpp.
DATA: wa_itcpo LIKE itcpo.
DATA: doc LIKE TABLE OF docs.
DATA: tlines LIKE TABLE OF tline.
DATA: bin_filesize TYPE i.
DATA: it_otf LIKE TABLE OF itcoo.
wa_itcpo-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
device = 'PRINTER'
dialog = 'X'
form = 'ZSCRIPT_BOX_PS'
language = sy-langu
OPTIONS = wa_itcpo
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
RESULT = wa_itcpp
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
.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ELE1'
function = 'SET'
type = 'BODY'
window = 'MAIN'
* IMPORTING
* 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
.
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
TABLES
otfdata = it_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6
.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = bin_filesize
TABLES
otf = it_otf
doctab_archive = doc
lines = tlines.
BREAK-POINT.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = bin_filesize
filename = 'D:New FolderTESTPDF.PDF'
filetype = 'BIN'
TABLES
data_tab = tlines.