Submit for a spool request
Hi friends,
i have three programs Y, Y1& Y2.
in 'Y' program i have a submit statement
SUBMIT 'Y1' TO SAP-SPOOL
AND RETURN
WITH SELECTION-TABLE SELTAB
IMMEDIATELY ' '
SAP COVER PAGE ' '
COVER TEXT 'xxxx - Auto Payment Summary'.
in 'Y1' program i have a submit statement
SUBMIT 'Y2' TO SAP-SPOOL
AND RETURN
WITH SELECTION-TABLE SELTAB
IMMEDIATELY ' '
SAP COVER PAGE ' '
COVER TEXT 'YYYY - Auto Payment Checksum'
SUBMIT (PAYPROG) WITH SELECTION-TABLE SELTAB
WITH PAYDET = PAYDET
EXPORTING LIST TO MEMORY
AND RETURN.
SUBMIT (WTXPROG) WITH SELECTION-TABLE SELTAB
EXPORTING LIST TO MEMORY
AND RETURN.
if i need to skip the first spool request and the file should not be generatedfor first spool is it possible, how please reply soon.
advance thanks to all.
Just refer:
HOw to generate spool request for alv report
Similar Messages
-
Handle not valid for open spool request
Hello everyone,
i am facing an error while clicking the print preview option in change PO (me22n).
i have given the dispatch time in further data of o/p as 'Send with application own transaction'.
now, when i save and click print preview button i get an error as
"Handle not valid for open spool request"
Kindly give me some idea how to tackle this.
Thanks
gauravGaurav,
I am having a similar issue and would appreciate if you could let us know how your problem was solved?
What control parameters did you change to make this work?
Thanks,
Jay -
Long time for generating spool request for smartforms
Hi,
I'm have designed a smartforms for printing a Receipt form. It takes about 1 minute for generating spool request after pressing the PRINT button in PRODUCTION Server only.
The Code i used is below
CALL FUNCTION lv_fname
EXPORTING
p_belnr = p_belnr
p_bukrs = p_bukrs
p_gjahr = p_gjahr
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 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.
Please help me out to sort this issue.
Thanks,
Ramesh
Edited by: Rameshkumar Raamasamy on Mar 4, 2012 6:21 AMHi Rameshkumar,
you may look at the code sections of your smartform: If you have a lot more data in production than you have in development, it is especially important to use a fully specified primary key for any SELECTs.
You may also ask your basis people to check if any performance warnings have been recorded with database system. This happens quite frequently that growing database tables cause problems when table spaces are not properly assigned or table sizes are not maintained adequately.
Regards
Clemens -
HotNews correction for Y2010 spool request error available
Dear gurus,
I became aware of [SAP Note 1422843|https://service.sap.com/sap/support/notes/1422843] which has affected all my systems's spool request reorg jobs.
It is currently release and patch level independent, so you will all be affected by it as well.
You can verify this via entries in table SP01 field RQDELTIME = 2099*
As a kernel patch might take a while (also to download, install, test, etc...) there is a workaround attached to the note until you get there.
Cheers and best wishes for the new years until 2099..
Julius> ...and the variant provided in this note 1422843 doesn't clean at all....
Yes, it does not "clean" the spool requests out of the system - it corrects the deletion date symptom so that your reorg job will pick them up again. Dependent on your config, this might take a few days to become "cleaned", as they were before as well.
Another option is to reorg the spool requests based on the creation date alone. This works fine for "smaller" systems and will protect the spool overflow and number range problem. It will however not correct the other less critical symptoms, so applying the kernel patch at some stage soon is recommended anyway.
Cheers,
Julius -
Print preview for the spool request without actual printer hooked u to SAP
Hi,
We do not have any printer connected to SAP system. But the business team just wants to do print preview of a document using the SAP local printer settings thorough SP01. They do not want to print it.
They say that SAP has many printer drivers in its setting. So even if the printer is not attached they should be at least able to do a print preview ?
Is this possible ? What do I need to do ?
Regards,
Rajesh.Rajesh Thomas,
the preview function needs a printer - for whatever reason.
If NO printer is defined in the system, someone should be able to set up a printer, i.e. locl with driver SAPWIN. Try.
Regards,
Clemens -
How to print Spool requests for cheque printing sequentially
Dear All,
I am making vendor payments and printing cheques using F-58. It automatically creates a spool requests at the end of the transaction. When i complete all my payments and go to SP01 for viewing spool requests, the last request appears at the top of the list.
If i select 3 consecutive requests and print them at a time, the last request gets printed first on the first cheque number and the first request gets printed on the last cheque number.
This results in anomaly in the cheque number assigned in the system and the printed cheque as the last payment is printed on the first cheque.
I am using dot matrix printer with page format fixed for cheque specifications. The cheques are printed properly as per the format except the order of printing.
Kindly let me know how to print multiple requests sequentially from the spool requests list such that the spool request number printed matches with the serial cheque numbers.
Regards,
SAP_2009Hi,
I understod your issue.
Whenever you posted multiple payment documents, and after that if you want to take cheque printouts sequentially by using more spool requests.........there is a way to sort out this issue.
1) Select all of your spool requests and click on Sort in ascending Order (CtrlShiftF5) and click on Print directly (CtrlShiftF8). By doing this you will get the cheque printouts sequentially according to your payment document sequence.
Hope this will help you
Assign ********, if it solved your problem.
Thanks,
Srinu -
Is there any FM to generate spool request for error log of a background job
Hi,
I am going to create a program to create deliveries and do PGI. This program will be assigned to periodic background job.Now whatever errors are generated in program i have to send the error log to spool request.Is there any FM for generating spool request with this error log or how can this be done? Kindly provide sample code if possible.
Thanks.
Nimish Dongare.Hi Nimish,
How are you doing, This is Shreekant working as ABAP developer, I sow your post in sdn forum, I have a similar requirement like I am changing the delivery taking some data from a flat file which is coming from other system and do PGI. If any error occurs during this process I need to capture it and present it as a report or create log file.. whichever is easier.
Please can u help me how did u achieved this functionality for your requirement?.. pls. can u share some details.
If u don mind, can u give me ur email id to communicate.
Thanks,
Shreekant -
Convert Spool request to PDF and send as e-mail
Hi all,
Can any one please provide me a sample code for converting spool request to pdf?
Thanks in advance,
Suneela.HI,
Try this
Hi all,
Can any one please provide me a sample code for converting spool request to pdf?
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
FORM get_job_details *
FORM get_job_details.
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 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
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
Reward points if found helpfull....
Venkoji. -
Spool request with more than 255 columns
Hi,
Please let me know what formatting type has to be used to have spool output with more than 255 lines.
X_24_80_JP L ANY 00024 00080 ABAP list HR Japan: At least 24 rows by 80 columns
X_44_120 L ANY 00044 00120 ABAP/4 list: At least 44 rows by 120 columns
X_51_140_JP L ANY 00051 00140 ABAP list HR Japan: At least 51 rows by 140 columns
X_58_170 L ANY 00058 00170 ABAP/4 list: At least 58 rows by 170 columns
X_60_80_JP L ANY 00060 00080 ABAP list HR Japan: At least 60 rows by 80 columns
X_65_1024/4 L ANY 00065 01024 ABAP List: At Least 65 Lines 4*256=1024 Columns Four-Sided (Only for SAPlpd)
X_65_132 L ANY 00065 00132 ABAP list: At least 65 rows by 132 columns
X_65_132-2 L ANY 00065 00132 ABAP List: 2-column 65 characters 132 columns (only for SAPLPD from 4.15)
X_65_200 L ANY 00065 00200 ABAP list: at least 65 lines with 200 columns (not for all device types)
X_65_255 L ANY 00065 00255 ABAP/4 list: At least 65 rows with a maximum number of columns
X_65_256/2 L ANY 00065 00256 ABAP list: At least 65 lines 2*128=256 double columns (SAPLPD only)
X_65_512/2 L ANY 00065 00512 ABAP List: At least 65 Lines 2*256=512 Columns 2-sided (Only for SAPlpd)
X_65_80 L ANY 00065 00080 ABAP/4 list: At least 65 rows by 80 columns
X_65_80-2 L ANY 00065 00080 ABAP List: 2-column 65 characters 80 columns (only for SAPLPD from 4.15)
X_65_80-4 L ANY 00065 00080 ABAP List: 4-column 65 characters 80 columns (only for SAPLPD from 4.15)
X_90_120 L ANY 00090 00120 ABAP list: At least 90 rows by 120 columns
X_PAPER L ANY 00010 00010 ABAP/4 list: Default list formatting
X_PAPER_NT L ANY 00001 00001 ABAP/4 list: Obsolete (do not use)
X_POSTSCRIPT L ANY 00001 00001 Pre-prepared PostScript
X_SPOOLERR L ANY 00001 00001 ABAP list: Spooler problem report
X_TELEX L TELEX 00001 00001 Telex: 69 characters wide, only as many lines as supported by TTU
ZABC_SAP L ANY 00065 00550 LCM Report Page Type
I have created a custom Format Type with 65*550 (ZABC_SAP) , but still the output gets truncated in the spool.
In sp01 . For the spool request ... If it displayed in Graphical layoout ... Output is getting truncated but when we see in Raw format .. i can see the entire output. But it is not at all formatted.
Thanks,
Tanuj
Message was edited by:
Tanuj Kumar BolisettyHello Tanuj,
You need to use a page format greater than 255 columns for sure. However still if it does not solve the issue then you may consider using the note 186603.
PS: I guess you are on a higher release than 4.6 C . For this release this note íIt has a text attachment for a report tat allows to display such spool requests.
Regards.
Ruchit. -
Hi,
I have one program, that calls transaction code CIP2. When I run in backgound, it creates spool request but with 0 pages.
And have the message:
ERROR => missing close of spool request [rspoooh.c 1173]
If I run this program without background and calls CIP2, it runs well and no spool is created.
Any idea how to solve this problem? or close the spool request?
All ideias are welcome.
Best regards,
Anabela FernandesHi Harsh,
When my program run in background it is done by one job and run when one event occurs.
My program calls CIP2 with FM PROCESS_CC2_MESSAGES_PARALLEL. So I can't use the command SUBMIT.
The spools request are created in backgound.
I was think to do like: at end of program if sy-batch = 'X' -> Close the pending spool requests. But I don't know how to do it. Any idea?
Thanks in advance.
Regards,
Anabela Fernandes -
Deleting spool requests automatically
Hi
We are on R/3 4.7 Enterprise Extn Set 110. I would like to ensure that spool jobs which have printed successfully be deleted automatically. I need some help in getting this done.
There are some places where I could configure this however I was not sure which would work.
SU01 / Defaults / Spool Control / Delete After Output
SPAD / Admin / Settings / Admin / Automatically delete old spool requests. This has a time limit whic I can set. For instance All .... h
SP01 / Spool Requests / Select Spool Request / Request Attributes / Spool Attributes / Delete After printing after no errors.
To me the third one (from SP01) seems just right. But SP01 would show up requests which only belong to me. I would like to ensure that this works for every spool request for every user. How do I go about this? Does this have to be done in IMG? if so how?
thanks
raviYou need read the Note 16083 - Standard jobs, reorganization jobs
the SAP_REORG_SPOOL job, also read
Note 130978 - RSPO1041 - Replacement for RSPO0041
About :
But SP01 would show up requests which only belong to me
dear cleare your user name in Created By and after execute, you will see all in past day , or selected period (it works in ECC, i do not know how it works in 4.7, but i'm think it's are same).
Regards. -
How to control automatic deletion of spool requests while check printing
hi friends
When i do cheque payment run (F-58), my spool getting deleted after printing. In my User setting SU01,
Delete after output is not selected, still it is getting deleted from spool. We have informed users to uncheck this option once the spool request is created at the end of this run. But our users feel there should be some way to disable/uncheck or save this option automatically rather than changing each spool request settings everytime the posting is run.
Please could you suggest me how to disable/uncheck this option 'Delete after printing if no errors' permanently. I have done the necessary settings in user master record but still it's the same.
please advice.
Regards,Hi Nathan,
Solution is only to maintain in SU01 , its picking from there only.
May be your user needs to log-off once status is changed in SU01, ask him to check what it is showing for him in SU3.
So if you deactivate option in SU01/SU3 , it should work as same is working in our environment.
You can test yuorself using below steps
1) Login with your ID , create one spool request
2) check the status in SP01 and check if its ticked or not
3) change the tick mark in SU01 , logoff. and login again .
4) create another spool request
5) check status now for new spool request in SP01 and check if it is ticked.
Regards,
Edited by: Gagan Deep Kaushal on Oct 31, 2010 5:00 PM -
Hi all,
I have a requirement where my data is in my internal table with that data i have to create a log in the spool sp02 t-code. Please help me to do this.
Thanks in advance.Hi
Below code can give you some idea for creating spool request and generating output:
DATA: PRIPAR TYPE PRI_PARAMS,
ARCPAR TYPE ARC_PARAMS,
LAY TYPE PRI_PARAMS-PAART,
LINES TYPE PRI_PARAMS-LINCT,
ROWS TYPE PRI_PARAMS-LINSZ.
DATA: val(1).
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = 'LOCL'
no_dialog = 'X'
immediately = ' '
IMPORTING
out_archive_parameters = arcpar
out_parameters = pripar
valid = val
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
pripar-prdsn = 'DSN'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = arcpar
in_parameters = pripar
no_dialog = 'X'
list_name = 'Testing Purpose Only' "l_list
IMPORTING
out_archive_parameters = arcpar
out_parameters = pripar
valid = val
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc EQ 0.
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS pripar
ARCHIVE PARAMETERS arcpar
NO DIALOG.
ELSE.
write:/ 'Unable to create spool'.
ENDIF.
write:/ 'First Line'.
write:/ 'Second Line'.
NEW-PAGE PRINT OFF.
Cheers,
Simha.
Reward all the helpful answers... -
How to submit a PDF document to spool request by coding
Hi experts,
I have a pdf document that is stored somewhere in SAP system, for example MIME repository. So I can read this PDF document and get its content as an xstring.
I know SAP can print a smartform directly by calling its function module, or submit a program (list output) to SAP-SPOOL to generate a spool request.
But how can I submit a document or an xstring which presents the content of a document to spool request in order to print it out?
Or should I do it in some other way?
Any of the suggestion or hint will be help.
Thanks!We have checked it with SAP and it seems no solution for printing a pdf doc by coding.
The final workaround is to use an virtual printer or some converter on PC to convert the pages in that pdf document into BMP files. Then upload those BMP files in t-code se78 and build a smartform to include them.
It is convenient to use the printing function of smartforms in ABAP coding. -
How to use Submit Statement for mutiple Spools.
Hi Gurus,
I have a requirement wherein I need to Submit a Report Program to SAP-SPOOL which generates output for multiple Idocs.
For each Idoc I need to attach the spool to a particular object_id.
As of now I am doing this by putting the Submit statement in a loop.
I want to meet the same functionality without using a loop for different Idocs.
Ex.
LOOP AT IDOCS.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
CALL FUNCTION 'JOB_OPEN'
IF sy-subrc = 0.
SUBMIT YFAPINV_IDOC_RPTS TO SAP-SPOOL "USING SELECTION-SCREEN '1000'
WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS print_parameters
WITH CREDATE IN CREDATE
WITH CRETIME IN CRETIME
WITH DOCNUM IN DOCNUM
WITH VENDOR IN VENDOR
WITH V_INVOIC IN V_INVOIC
WITH MESCODE IN MESCODE
WITH DOCSTAT IN DOCSTAT
WITH DC_NBR IN DC_NBR
WITH DOC_TYPE IN DOC_TYPE
WITH S_BSART IN S_BSART
WITH ap1_flag eq 'X'
AND RETURN.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_CLOSE'
ENDIF.
ENDIF.
SELECT rqident rqcretime FROM tsp01
INTO (rqident,rqcretime)
WHERE rqowner = sy-uname
ORDER BY rqcretime DESCENDING.
EXIT.
ENDSELECT.
IF rqident IS NOT INITIAL.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
DATA l_line TYPE docs-lines.
LOOP AT l_tline.
CLEAR l_line.
MOVE l_tline-tdline TO l_line.
l_docs-lines = l_line.
APPEND l_docs.
ENDLOOP.
ENDIF.Hi,
Each submit will create only one spool. So I dont think this is possible. Yes what you can do though is that submit the program for all the IDocs at once ( provided your program YFAPINV can handle this) and then process the spool and separate the output for each IDoc after you retrieve the data from spool.
To retrieve the data from the spool, you can use the function 'RSPO_RETURN_ABAP_SPOOLJOB' pass the spool request number and it will return you a internal table with the spool data.
regards,
Advait
Maybe you are looking for
-
Computer recognize IPOD classic but ITunes doesn't
My laptop has my ipod listed in my computer. But my ipod is not recognized by itunes. I have uninstalled and reinstalled itunes with no help. I have reset the ipod and all my songs and videos are listed on the ipod but when I clicked to play them
-
Problem in jdbc connect thru oracle
hi all i hv installed oracle 8i on win2k i wanna connect thru jdbc but i am getting error below i donno whr i got struck? plz help me thnx in advance bye ////////// details /////////////////////// import java.sql.*; ///win2000,oracle 8i /// try to fi
-
Calling a method in another JVM instance
I know you can use RMI to call the methods from classes across the network, but if the class is on the same machine, just in another JVM instance, is there a way to bypass the network layer and have the JVMs communicate directly with each other?
-
Can't access BEFW11S4 v2.1 config page / PASSWORD PROBLEM
Hello. I have a BEFW11S4 version 2.1 wireless router. Recently, I had to reset it to factory defaults. However, since then, I can't access it from my web browser at 192.168.1.1 URL. It keeps asking me my password. I've tried the "admin" password (wit
-
SAP Document Attachment - Services for object
Hello Guys, Find the below attachment about a PPT on " services for object" <a href="http://verbellacmg.com/asug_2006_walls_404.ppt">Services for object icon - ppt</a> Would be highly usefull. Regards, Murali.S Reward if its Usefull.