on 05-19-2008 7:50 AM
How do you preview using a spool request number?
I have an application in which I have accumulated the results from several smartforms into one spool request. I have the spool request number, and am printing it using function RSPO_RPRINT_SPOOLREQ.
I need to be able to preview the contents of the spool request before printing. I can not preview when generating the smartforms, as that involves several previews, and I need to preview once only per spool request.
I have been trying to use RSPO_RDISPLAY_OUTREQ but it dumps immediately (line 47) with field symbol <FTSP01> not assigned.
Suggestions?
Can you can try using FM: RSPO_DISPLAY_SPOOLJOB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
*With no faction module "COM_SE_SPOOL_DISPLAY", try this simple code, you can display the form *type spool (you also can put the code in a function module):
REPORT ypl_test_display_spool MESSAGE-ID zm_print.
PARAMETERS: rqident LIKE tsp01-rqident,
rqdocty LIKE tsp01-rqdoctype.
*--- there may be more types need to separate..., so use case...
CASE rqdocty.
WHEN 'OTF' OR 'SMART'.
PERFORM display_form.
WHEN OTHERS.
PERFORM display_others.
ENDCASE.
&----
*& Form DISPLAY_FORM
&----
display form type spool...
----
FORM display_form.
DATA: wstr_otf_control TYPE itcpp.
DATA: wtbl_buffer TYPE TABLE OF soli WITH HEADER LINE.
DATA: wtbl_otf TYPE TABLE OF itcoo WITH HEADER LINE.
DATA: wstr_retcode LIKE itcpp.
*--- return spool raw data
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = rqident
TABLES
buffer = wtbl_buffer
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE s013 WITH text-001.
EXIT.
ENDIF.
LOOP AT wtbl_buffer .
wtbl_otf-tdprintcom = wtbl_buffer(2).
wtbl_otf-tdprintpar = wtbl_buffer+2.
APPEND wtbl_otf.
ENDLOOP.
*--- some data to pass to this parameter, may not need...from SP01...
wstr_otf_control-tdcopies = 1.
wstr_otf_control-tdappl = 'TX'.
wstr_otf_control-tddest = 'LOCL'.
wstr_otf_control-tdpages = 0.
wstr_otf_control-tdnoprint = 'X'.
CALL FUNCTION 'DISPLAY_OTF'
EXPORTING
control = wstr_otf_control
IMPORTING
RESULT = wstr_retcode
TABLES
otf = wtbl_otf.
IF wstr_retcode IS INITIAL.
*--- message...
ENDIF.
ENDFORM. "DISPLAY_FORM
&----
*& Form display_others
&----
display other types, may more types needed to separate...
you can refer current version of SAP report RSPOLST2
----
FORM display_others.
CALL FUNCTION 'RSPO_DISPLAY_SPOOLJOB'
EXPORTING
rqident = rqident
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 <> 0.
MESSAGE s013 WITH text-001.
ENDIF.
ENDFORM. "display_others
Hi, my friend Ed sent me the contents of the FM "COM_SE_SPOOL_DISPLAY", so the code should be:
*----
REPORT YPL_TEST_DISPLAY_SPOOL2 .
TYPE-POOLS: SP01R.
PARAMETERS: rqident LIKE tsp01-rqident.
DATA:
LS_LIST TYPE LINE OF SP01R_ID_LIST,
LT_LIST TYPE SP01R_ID_LIST.
MOVE rqident TO LS_LIST-ID.
APPEND LS_LIST TO LT_LIST.
CALL FUNCTION 'RSPO_RID_SPOOLREQ_DISP'
EXPORTING
ID_LIST = LT_LIST
EXCEPTIONS
OTHERS = 0.
*----
Thank you so much, Ed,
Peili
hi,
You can use function "COM_SE_SPOOL_DISPLAY" to display spool.
Atul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.