Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

code for spool no.

Former Member
0 Likes
692

Dear friends,

I have to write the code for generation of spool no from a sap transaction vf02.

can any one help me to locate this code in sap.

or have there own written code will help full for me.

PLease help me out.

Thanks and Regards

vivek srivastava

5 REPLIES 5
Read only

Former Member
0 Likes
662

hi,

by default if you will give print from VF02 the it will give spool number.

if you want to explicitly generate spool number then check the driver program for invoice.

Read only

mahaboob_pathan
Contributor
0 Likes
662

hi use this code and put u r condition

----


***INCLUDE /SCL/LRTR_PROCESDIRECTDEBITF03 .

----


&----


*& Form report_log

&----


  • spool report log

&----


FORM report_log .

DATA: pripar TYPE pri_params,

arcpar TYPE arc_params,

lines TYPE pri_params-linct,

rows TYPE pri_params-linsz.

DATA: val(1), val1(1).

DATA: dest TYPE pri_params-pdest .

DATA: v_name TYPE pri_params-plist VALUE 'DIRECT_DEBIT'.

DATA: spono TYPE tsp01_sp0r-rqident.

**internal table******

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

destination = dest

no_dialog = 'X'

immediately = ' '

IMPORTING

out_archive_parameters = arcpar

out_parameters = pripar

valid = val

valid_for_spool_creation = val1

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

pripar-linsz = 300.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

in_archive_parameters = arcpar

in_parameters = pripar

no_dialog = 'X'

list_name = v_name

IMPORTING

out_archive_parameters = arcpar

out_parameters = pripar

valid = val

valid_for_spool_creation = val1

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'. "#EC NOTEXT

EXIT.

ENDIF.

*******spool output**********************

SORT it_output BY doctype process custno docno .

*******first page********************************

**************end of spool*****************

NEW-PAGE PRINT OFF.

spono = sy-spono.

ENDFORM. " report_log

Read only

Former Member
0 Likes
662

See the report RSTXPDFT4

OR

you can use the FM , once the background job is schedules you can find the spool number

in the system variable sy-spono pass that to this FM

CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'

EXPORTING

rqident = spoolid

first_line = 1

last_line = 0

desired_type = ' '

IMPORTING

real_type = real_type

sp_lang = sp_lang

TABLES

buffer = so_table

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.

OR

1. Read spool number form table TSP01

2. Convert spool to PDF with FM 'CONVERT_OTFSPOOLJOB_2_PDF'

3. Download this PDF document into local file.

Read only

Former Member
0 Likes
662

use like this

submit (c_report) to sap-spool

spool parameters params

without spool dynpro and return.

Read only

Former Member
0 Likes
662

thnks