2009 Sep 02 4:18 AM
Hi All,
How to create spool and output simultaneously?
Let say...
WRITE:/ 'HELLO WORLD'.
The above code displays 'HELLO WORLD', however, I need to create a spool also?
Thanks in advance.
Hi All,
How to create spool and output simultaneously?
Let say...
WRITE:/ 'HELLO WORLD'.
The above code displays 'HELLO WORLD', however, I need to create a spool also?
Thanks in advance.
2009 Sep 02 4:32 AM
Create another program say B with
Report B.
Write : / 'hello world'.
Then in Program A
Report A.
write : 'Hello World'.
SUBMIT B TO SAP-SPOOL
SPOOL PARAMETERS PARAMS
WITHOUT SPOOL DYNPRO.
a®
2009 Sep 02 4:36 AM
Hi a®s,
Thanks for the quick reply.
Is there any way to create without writing two programs ?
2009 Sep 02 4:43 AM
Then try something this way
Report A.
Write : / 'Hello World'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = lw_arcpar
in_parameters = lw_pripar
layout = l_lay
line_count = l_lines
line_size = l_cols
no_dialog = 'X'
IMPORTING
out_archive_parameters = lw_arcpar
out_parameters = lw_pripar
valid = l_val.
IF l_val space AND sy-subrc = 0.
lw_pripar-prrel = space.
lw_pripar-primm = space.
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS lw_pripar
ARCHIVE PARAMETERS lw_arcpar
NO DIALOG.
ENDIF.
WRITE :/ 'Hello World'.
NEW-PAGE PRINT OFF.
a®
2009 Sep 02 4:55 AM
Hi,
Just goto abap editor..write ur code...i.e
WRITE:/ 'HELLO WORLD'.
click on F8 button..or execte it..you can find the print option after cancel button..click on it..you can see the print screen list..clcik on properties...and cilck on ok button..
A spool request will be automatically created.and the document also ready to be printed..
Hope it helps..
2009 Sep 02 8:29 AM
Thanks for the replies..
I have solved the issue as below:
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS wa_pripar
ARCHIVE PARAMETERS wa_arcpar
NO DIALOG
NO-TITLE.
WRITE:/ 'HELLO WORLD'.
NEW-PAGE PRINT OFF.
v_rqident = sy-spono.
* Display the spool contents as output.
CALL FUNCTION 'RSPO_DISPLAY_SPOOLJOB'
EXPORTING
rqident = v_rqident
* FIRST_LINE = 1
* LAST_LINE =
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
OTHERS = 7
.
IF sy-subrc NE 0.
IF v_rqident NE 0.
WRITE: 'Spool Error, Spool Number: ', v_rqident.
ENDIF.
ENDIF.
Let me know if there are any other approach to solve this.