Regarding OTF Spool job
Hi Folks
I am using the following code for my requirement:
data: SPOOLNO LIKE TSP01-RQIDENT value '24841'.
DATA: NUMBYTES TYPE I.
data :pdfspoolid like tsp01-rqident,
jobname like tbtcjob-jobname,
jobcount like tbtcjob-jobcount.
DATA: PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
tables: tsp01.
select single * from tsp01 where rqident = spoolno.
if sy-subrc <> 0.
WRITE: / 'Spoolauftrag existiert nicht'(003)
COLOR COL_negative.
exit.
endif.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = spoolno
NO_DIALOG = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
OTF_PAGECOUNT =
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11.
I am not getting the proper result as PDF . I am getting the PDF with junk data.
<b>Points are assured for helpful and correct answers.</b>
Regards,
Sreeram
Hi
It's Answered.
Similar Messages
-
Issue with getting the entire spooled job into the pdf document
Hi All,
My scheduled job runs fine and completes successfully but it appears to have some issues with getting the entire spooled job into the pdf document which it sends to a an end user.Has anyone encountered it before.Your kind assistance would be appreciated.
Thank you.
Regards,
JohnHi,
Please read below link for your query:-
http://help.sap.com/saphelp_nw04/helpdata/EN/85/54c73cee4fb55be10000000a114084/content.htm
Regards,
Anil -
Hi,
I am tryiing to print the COBRA letters from the program RPUCOB02 and i am selecting uptodate radio button.
I am not facing the error when i select one employee and give the letter print.when i try to select more that one employee and click on letter generate buton it is throwing an error "cannot generate a new spool job"
It is working fine with the first employee.
when i went to into the debug mode in the Inlcude for COB02F03 of the program RPUCOB02 , there is open_form and it is dispalying the 104 exception " Error when opening layout set printing" for the second ee.
can anyone let me know how i can eliminate the error
Thanks.Anjani & Raj,
This worked for me as a bandaid fix.... didnt do much reasearch... looks like after printing first employee the system is trying to create a new spool request again.... follwoing work around worked for me and may work for you too....
In the First component of the COBRA User Exit - ZXPCOU01
added the following peice of code... and it worked as the spool will be openend once...
DATA: lc_flag TYPE c.
IMPORT lc_flag = lc_flag FROM MEMORY ID 'COBRAUSER'.
IF lc_flag IS INITIAL.
lc_flag = 'X'.
EXPORT lc_flag = lc_flag TO MEMORY ID 'COBRAUSER'.
RAISE standard_procedure.
ELSE.
sy-subrc = 0.
ENDIF. -
Getting OTF spool into internal table
Hi experts !
I am trying to get an OTF spool into an internal table (in order to send it to a web application).
I use FM CONVERT_OTFSPOOLJOB_2_PDF :
PARAMETERS : p_spoolid LIKE tsp01-rqident.
DATA : lt_numbytes TYPE i,
lt_pdf TYPE TABLE OF tline.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = p_spoolid
IMPORTING
pdf_bytecount = lt_numbytes
TABLES
pdf = lt_pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11.
The table lt_pdf then contains some junk characters such as
TDFORMAT 潆
TDLINE 瑮吠䵉卅潮浲污䰠湡⁧剆਍启灹⁥䘯湯൴⼊畓
Any idea of how I can get that fixed ??
A strange thing is when I save it as a local file (for testing purpose) using GUI_DOWNLOAD, I have a nice readable PDF file ...
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = '10884'
FILENAME = 'C: est.pdf'
FILETYPE = 'BIN'
TABLES
DATA_TAB = lt_pdf
EXCEPTIONS
FILE_WRITE_ERROR = 1 ...
Thank you for your help !
Yann PortraitHi,
try to Pass parameters like this
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = spoolno
NO_DIALOG = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
OTF_PAGECOUNT =
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11. -
Multiple invoices(spool jobs) download to multiple PDF files or 1 PDF file
Hello techies:
Has anyone written a program that takes the spool jobs of multiple Invoices from table TSP01 and then download these multiple invoices to multiple PDF files or to
One PDF file depending on selection screen?
This is an urgent request from client for archiving. Any help is highly appreciated !
Thanks so much
SilviaBHi Chris
Try printing from another browser, such as Firefox. There have been issues between eBay's coding practices and how Safari interprets them. -
Max limit on size of PDF when converting from OTF spool to PDF
I have a scenario where I need to process as many OTF spool files into one PDF file, and then send this PDF as a ZIP file in an email attachment.
Is there a limit on the size of PDF that ABAP code can handle?
Also, what are the ABAP steps to accomplish this.
Thank you,
ShipraHello Shipra,
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
data_set = dataset " dataset name
destination = 'LP01' " Output device
expiration = '1' " one day in spool
immediately = space " no immediate print
list_name = listname " listname
layout = 'X_65_132' " Layout
new_list_id = 'X' " new spool id
no_dialog = 'X' " no print popup
IMPORTING
out_parameters = pri_params
valid = valid
EXCEPTIONS
OTHERS = 4.
CHECK sy-subrc EQ 0 AND valid NE space.
* Begin of Spool Generation.
NEW-PAGE PRINT ON
PARAMETERS pri_params
NO DIALOG .
SELECT single * FROM /itsam/smmmt into ls_smmmt
where mtask_id = '0015600EB8A41DDB9980CAB61CD154D7' .
* Write the report in required format
*WRITE: 'Test page'.
CONCATENATE ls_smmmt-mtask_id ' ' ls_smmmt-TASK_NR into str_text.
write: / str_text .
*write: / ls_smmmt-description .
* End of Spool Generation.
NEW-PAGE PRINT OFF.
CONCATENATE c_pdf_filepath c_pdf_filename INTO pdf_filename.
CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
EXPORTING
rq0name = spoolname
rq2name = spooldsn
TABLES
spoolrequests = spool_ids
EXCEPTIONS
OTHERS = 0.
READ TABLE spool_ids ASSIGNING <spool> INDEX 1.
CHECK sy-subrc EQ 0.
spoolid = <spool>-rqident.
filename1 = pdf_filename.
CALL FUNCTION 'GUI_CREATE_DIRECTORY'
EXPORTING
dirname = c_pdf_filepath
EXCEPTIONS
failed = 1
OTHERS = 2.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spoolid
no_dialog = ' '
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
TABLES
pdf = li_pdf
and then use CL_ABAP_ZIP to convert it into a zip file -
Download a Spool job to UNIX ???
Hi techies:
<b>I have an urgent request from client. They need to download a Spool job(report format) to UNIX directory.</b> Is there any standard SAP function routine that does this function???
PLEASE help - they have many reports that they want to spool .. and then
save this spool job in UNIX directory.
thanks for all your support and assistance.
SBHello Seshu:
This fm <b>RSPO_DOWNLOAD_SPOOLJOB is not working to download to
UNIX - unless I am missing something???</b>It does work to download to regular flat text file on local server
HELP!!
thanks
SB -
Combine Spool Job Contents ..
Hello Experts,
I'm hoping someone can help with this. I have a requirement to create adobe print forms for a set amount of employees. The problem I'm having is that I can get the spool job to create. In side the spool job, it is broken into parts. The pdf form created is 8 pages for one employee. If I print 5 employees, the spool job will have 40 pages, but the job is split into 5 segments of 8 pages. The issue I'm having is that I need to get all 40 pages in one file to send to a printer. I've tried a number of things but I can't seem to get the spool job to print to pdf on a local machine. The only alternative I can find is to get the segments of the spool job into one big file.
Does anyone have any experience with this? Points will be awarded for any help.
Thanks,
MeezyHi,
i have the same problem than the original poster. I call FP_JOB_OPEN/FP_JOB_CLOSE only once, and only one spool job is created. But inside this job there are several parts and each part is an own pdf document. It is possible to read each part/file separately, but i found no possibility to get one big pdf with all parts.
Does anybody have an idea how to solve this?
Jan -
Can i delete the Print spooler jobs through command prompt or through any program with out stopping printspooler services.
Hello, I think you can not delete spooler jobs without stop spooller service. Otherwise, If you try to delete queue, you will see "This files using another software etc." error message. You can try below cmd.
R.
net stop spooler
DEL %systemroot%\system32\spool\printers\*.shd
DEL %systemroot%\system32\spool\printers\*.spl
net start spooler
Ersin CAN - TAT MCSE - Private Cloud. www.get-itlabs.com -
Problem with characters Converting OTF Spool to PDF
Hello All,
Im working on ECC6.0 system. I have a Z report where it will take spool number and mail ID as input.
It will check wheter the spool is of type OTF of ABAP List, according to that it will use the FMs ONVERT_OTFSPOOLJOB_2_PDF & CONVERT_ABAPSPOOLJOB_2_PDF.
Now it will download the PDF internal table data into a file using OPEN DATA SET statement as shown below.
OPEN DATASET gv_dsn FOR OUTPUT IN BINARY MODE.
*Download the file to application server
LOOP AT gt_pdf_output.
TRANSFER gt_pdf_output TO gv_dsn.
ENDLOOP.
CLOSE DATASET gv_dsn.
and it will ZIP the PDF as shown below.
* open the file from application server for zipping.
OPEN DATASET gv_dsn FOR INPUT IN BINARY MODE.
READ DATASET gv_dsn INTO lv_content.
CLOSE DATASET gv_dsn.
CREATE OBJECT go_zip.
go_zip->add( name = gv_file content = lv_content ).
gv_zip_content = go_zip->save( ).
* Convert the xstring content to binary
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = gv_zip_content
IMPORTING
output_length = gv_file_length
TABLES
binary_tab = gt_data.
After that the ZIP file conataining the PDF will be sent as an attachement to the mail ID given as input.
Now the problem is some characters of Czech are not coming properly when the attachement is opend once the mail is received. Can any one tell where the problem is and solution.
Im getting the message "Can not extract the embedded front 'CourierNewL2'. Some characters may not display or print correctly." while opening the PDF in the ZIP attachment.
Thank you.
Best Regards,
Sasidhar Reddy Matli.hi
u also check the following link
Re: how call FM otf to pdf in a report
Re: otf to pdf
Re: Error while converting OTF into PDF in CONVERT_OTF FM
Re: Convert OTF to PDF problem
Edited by: krupa jani on Jul 15, 2009 12:58 PM -
i want to be able to print a job from the spool in batch mode. In other words a job currently exists that creates a report that currently goes to a printer.
The user wants the report to print on two different printers.
can any one give the report or a solution for this question...........................Hi,
Use FM RSPO_RPRINT_SPOOLREQ
Best regards,
Prashant -
Hi All,
I need to know is it possible to get OTF data by calling FM CLOSE_FORM as well create a spool in SP01 for related script.
Regards
Dhiraj ShettyHi,
Manual conversion to OTF format
If there are more than 10 pages,
Tick the spool request
then click Edit -> OTF display -> No. of OTF pages
Convert SAP Script to text
Display the spool request
then click Goto -> List display
Automatic conversion to OTF format
tables: tline.
data: begin of int_tline1 occurs 100.
include structure tline.
data: end of int_tline1.
call function 'OPEN_FORM'
device = 'OTF_MEM'
after CLOSE_FORM
call function 'CONVERT_OTF_MEMORY'
exporting
format = 'ASCII'
max_linewidth = 132
tables
lines = int_tline1
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
write the text file to spool
loop at int_tline1.
if int_tline1-tdline = space.
skip.
else.
write:/ int_tline1-tdline.
endif.
endloop.
Regards
Sudheer -
How to get data from OTF spool request number
Hi all,
How to get OTF Data from the spool request number (OTF)?
How to create spool request from the OTF Data?
Regards,
Sunil KumarHi,
Check this links:
http://www.sapdev.co.uk/reporting/rep_spooltopdf.htm
Sending Mail from SAP
https://wiki.sdn.sap.com/wiki/display/sandbox/SendMailwithPDFAttachment?showChildren=false#children -
This is regarding back ground job scheduling
Hi to all...........
1....here iam using background job scheduling for a report to run under background.I difine the backgorund job at sm36 and i had given the job name and time ,date in sm37.
With this details the report executed sucessfully.Now i want to see the output list for that report.Please tell that where i have to see the output list.
what is the transaction code for displaying that output list?????????????????
Thanks and regards,
k.swaminathGo to SM36.. select ownjobs..
List will come.. Select your job (check box) and click SPOOL ...
Output will come like this..
Spool no. Type Date Time Status Pages Title
16501 24.10.2007 11:25 Waiting 7 LIST1S LOCA Z00_SELECT_S
Press the Icon under Type...
Output will get displayed..
Message was edited by:
Rama Jyothi -
HP P1606dn network printer spools jobs but won't print without a "form feed"
I recently changed by HP P1606dn printer from a USB connection to my HP desktop running Windows 7 (64bit) to a network connection. The objective was to allow my Mac (OS 10.6.8) to print to this printers as well via the network.
When I first installed the printer it worked fine. Then I installed the HP drivers on the Mac, and it too worked fine and continues to work fine. However, my Windows 8 desktop stopped printing. It appears to spool the print jobs correctly and they show up in the queue as actively printing. However, the only way to get them out is to go over to the printer and press the "form feed" button (button showing page with down arrow). Then the HP test page will come out followed by the desired print job.
I've tried disabling "bi-directional support" in the "ports" tab under "printer properties" but that did not help.
Any helpful advice appreciated!
BrentDid you connect the USB cable when doing the firmware update?
Please mark the post that solves your issue as "Accept as Solution".
If my answer was helpful click the “Thumbs Up" on the left to say “Thanks”!
I am not a HP employee.
Maybe you are looking for
-
How can I delete the image in my e-mails?
I'm having difficulty deleting or changing the e-mail image that appears automatically in e-mails. I gather they appear on e-mails sent to other Mac Mail uses, but not otherwise. I'd like to simply remove the image. Yet even when I delete the image a
-
My music won't sync with my iPhone (and several other problems)
My music has all disappeared from my iphone - the playlist names are still there, but the playlists are empty. and all my songs are in the library, but they all have the dowload from cloud button by them, but they arent on my actual phone. I'm not su
-
Itunes 8 worked fine the first time, now it keeps trying to reinstall.
So I downloaded itunes 8 the first day it became available with no problems. I opened it to make sure all my music was there, and turned on Genius then closed it. The next day when I go to open itunes, it tries to install again and it gave me an erro
-
BAPI_PR_CREATE EXTENSIONIN
Hello Gurus, I am creating a PR using BAPI_PR_CREATE, I achieve creating the PR, but I can't save value in the custom fields. This is my code, would you please help me? Thanks DATA: ls_req_item TYPE BAPI_TE_MEREQITEM, ls_req_itemx TYPE BAPI_TE_
-
About 5.1 Sound Support
I bought recently Motherboard Msi on 865PE chip the Standart edition with S-ATA support and 5.1 Sound. But then i received the Computer i`ve noticed that i don`t have S-Bracket that can support the 5.1 sound. Is this device that the store forgot to