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

Spool number generation!

Former Member
0 Likes
1,497

Hi friends!

I am trying to submit a report from a program and take the output into a Spool as it is dynamic.

Could you please tell me how can I get the dynamic SPOOL number.

I tried that by capturing the SPOOL NUMBER into memory via current system time and date but this will fail if 2 spools will generate at the same time.

Any thoughts!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,452

Try using syst fields sy-SPONO.

Thanks

Hi friends!

I am trying to submit a report from a program and take the output into a Spool as it is dynamic.

Could you please tell me how can I get the dynamic SPOOL number.

I tried that by capturing the SPOOL NUMBER into memory via current system time and date but this will fail if 2 spools will generate at the same time.

Any thoughts!

12 REPLIES 12
Read only

Former Member
0 Likes
1,452

Hi,

If you want to get the output of your report as spool, Just execute the report in Background. Then check the job in SM37, there you can find the Spool display.

Read only

Former Member
0 Likes
1,452

Hi,

In SAP Easy Access Menu

System -->Own Spool request

You Can Get The Number there

Reward If Helpful

Regards

Sandipan

Read only

Former Member
0 Likes
1,452

Thank you.

Guys, the spool will be created via program that too dynamically and I need to capture that spool to convert it to PDF.

Read only

Former Member
0 Likes
1,453

Try using syst fields sy-SPONO.

Thanks

Read only

0 Likes
1,452

Have tried that too.

But that system spool field is not filled.

Thanks.

Read only

0 Likes
1,452

Hi Park.

DATA: print_parameters TYPE pri_params,

archi_parameters TYPE arc_params,

valid_flag(1) TYPE c.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

archive_mode = '3'

IMPORTING

out_parameters = print_parameters

out_archive_parameters = archi_parameters

valid = valid_flag

EXCEPTIONS

invalid_print_params = 2

OTHERS = 4.

IF valid_flag = 'X' AND sy-subrc = 0.

SUBMIT submitable TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

ARCHIVE PARAMETERS archi_parameters

WITHOUT SPOOL DYNPRO.

ENDIF.

This Will work.

Pls Reply if ur prblm is resolved.

Thanks

Read only

0 Likes
1,452

Hi,

If there is no spool means no output has generated from your program. Try to check in SP01 or table: TSP02F where the generated spools will be displayed.

If you are sure that the spool will be generated, try to debug and find why no output is generated.

Read only

0 Likes
1,452

Thanks Mahammad!

I have done exactly the same but I need to know what spool number is created for that so that I can take that spool and convert to PDF.

Thanks.

Read only

0 Likes
1,452

Any inputs on this?

Read only

0 Likes
1,452

Hi Park,

DATA: number TYPE tbtcjob-jobcount,

name TYPE tbtcjob-jobname VALUE 'JOB_TEST',

print_parameters TYPE pri_params.

************************************************

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = name

IMPORTING

jobcount = number

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc = 0.

SUBMIT ytest TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

WITHOUT SPOOL DYNPRO

VIA JOB name NUMBER number

AND RETURN.

IF sy-subrc = 0.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = number

jobname = name

strtimmed = 'X'

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

IF sy-subrc <> 0.

...

ENDIF.

ENDIF.

ENDIF.

*****************************

From this u will get the job no. ->JOBCOUNT = number

with this jobcount read table TBTCP with key jobcount.

u will get the spool no.(LISTIDENT) from tht table.

use tht spool no to convert the spool to pdf.

Thanks

Read only

0 Likes
1,452

Thanks much, Mahammad!

Read only

Former Member
0 Likes
1,452

Hi,

u can use this.....

submit <report name> to sap-spool.

check its syntax (F1 hlp) for options available...

thanks Amit..

reward if helpful..