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 not generated for program RSVTPROT when run in background

ayan_chakraborty
Explorer
0 Likes
3,504

Hi,

SCC4 changes can be checked using the standard change log functionality.

The program which actually runs in the background is RSVTPROT.

I have a requirement where there is a need to capture the change log in a pdf and send in email.

The data should be displayed in the exact format as when viewed from SCC4 transaction

Utilities -> Change Log.

All runs well when I use " SUBMIT RSVTPROT TO SAP-SPOOL SPOOL PARAMETERS print_parameters WITHOUT SPOOL DYNPRO VIA JOB job_name NUMBER job_number

AND RETURN." command in the foreground and this the exact output that is needed.

But when I schedule a background job the spool is not generated.

So, the question is , will it be possible to run RSVTPROT in background and generate a spool.

Regards,

Ayan

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,909

Nothing special about RSVTPROT. Running it via a job launched programmatically is the same as running via a manual job. You have just a programming error in your code.

PS: please share your code so that we can help you.

10 REPLIES 10
Read only

Jelena_Perfiljeva
Active Contributor
2,909

Why are you using SUBMIT? Just run the program as a step in a background job and use spool output distribution option in the job definition to send output by email. It won't be in PDF but that is much simpler process.

Also is this not covered already by the CCMS tools? I'm not a Basis person but monitoring / alert functionality is quite robust from what I've heard.

Read only

0 Likes
2,909

Hi Jelena,

Thank you for your response.

In my case, I have a very specific requirement where the change logs are needed only as a pdf attachment in a predefined email body.

As you rightly said and I did a test from my side as well, running the program RSVTPROT as a step in a background job generates the spool although not in pdf. This spool serves the purpose for me as it has all the details.

Here as well, it is in fact a background job and so I am not quite able to understand why the same would not work via a SUBMIT statement which is turn is also trying to run program RSVTPROT via a job.

Some insights on this restrictive behavior of SUBMIT statement would be very helpful.

Regards,

Ayan

Read only

DoanManhQuynh
Active Contributor
0 Likes
2,909

you may try to export it in ALV output and get it through cl_salv_bs_runtime_info

Read only

former_member608267
Participant
0 Likes
2,909

Hi Ayan,

Try debugging background job in SM37 , check the submit statement.

  • Set a break-point in report RSVTPROT
  • In SM37 transaction, put the cursor on the job line, type 'JDBG' in the command line and press enter.
  • Job will start in debug mode.

Regards,

Muhammed M

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,910

Nothing special about RSVTPROT. Running it via a job launched programmatically is the same as running via a manual job. You have just a programming error in your code.

PS: please share your code so that we can help you.

Read only

0 Likes
2,909

Hi,

Below is the code where I am calling RSVTPROT with a variant by the name 'TEST' :-

CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = job_name
IMPORTING
jobcount = job_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3

OTHERS = 4.

SUBMIT RSVTPROT USING SELECTION-SET 'TEST'

TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB job_name NUMBER job_number
AND RETURN.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING
jobcount = job_number
jobname = job_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.

This is not generating a spool number when run in background mode through a batch job.

But works fine when I am running it in foreground.

Regards,

Ayan

Read only

0 Likes
2,909

I still have no issue, I get a spool. Could you handle and check the possible errors, missing authorizations, etc.?

Read only

2,909

Hi Sandra,

Thanks for confirming from your end. This drove me to check why it does not work for me when it works for you.

Indeed, there was an issue with the printer name at my end.

Now I have used another printer as default and with this change the program is able to generate the spool even in background.

In all we can confidently conclude that there is nothing different about RSVTPROT when run in foreground or in background mode.

Thanks to everyone for their valuable inputs.

Regards,

Ayan

Read only

0 Likes
2,909

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }

cl_salv_bs_runtime_info=>set( EXPORTING display = abap_true
metadata = abap_false
data = abap_true ).

Check the above code where ever u r using and make display abap_true during sy-batch is abap_true.

Read only

0 Likes
2,909

Hi Sivanadh,

My problem is that that spool is not getting generated through SUBMIT statement when run in background mode. ALV is not the issue.

I will convert the spool to pdf and simply attach in email but to do this I first need the spool to be generated.

Regards,

Ayan