2009 Aug 29 10:12 AM
Dear All,
I have generated a program for converting a spool request into PDF file.It is running fine but when Im putting this program in JOB scheduling, it is not executing and being cancelled with some error.
Please help.
Thanks & Regards
H.P. Singh
2009 Aug 29 11:40 AM
Hi ,
Please check the job error status in sm37. please debugg the job in sm37 using the command JDBG so that you can able to know what the problem is.
process for debugging the job in SM37:
select the job
enter JDBG in the command bar and click enter.
this will takes you to the debugging screen.
Regards,
Venkat
2009 Aug 29 10:22 AM
2009 Aug 29 12:41 PM
Job started
Step 001 started (program ZCREATEPDF, variant , user ID DSAHIB)
TEMSE_OPEN o.k. for SPOOL0000031998
PDF data of length 32634 created
ABAP/4 processor: RAISE_EXCEPTION
Job cancelled
Error analysis
A RAISE statement in the program "CL_GUI_FRONTEND_SERVICES======CP" raised the
exception
condition "CNTL_ERROR".
Since the exception was not intercepted by a superior
program, processing was terminated.
Regards
H.P.
2009 Aug 29 11:40 AM
Hi ,
Please check the job error status in sm37. please debugg the job in sm37 using the command JDBG so that you can able to know what the problem is.
process for debugging the job in SM37:
select the job
enter JDBG in the command bar and click enter.
this will takes you to the debugging screen.
Regards,
Venkat
2009 Aug 29 12:53 PM
Hi,
Dear friend when I do like this then Cancelled job execute properly without any error.
Regards
H.P.
2009 Aug 29 12:58 PM
Hi,
Are you using any GUI related activities like uploading a file from a presentation server or downloading a file etc,, From the error analysis text it seems ur using something related to GUI. Kindly confirm on this as no gui related activity will work in background job.
Regards,
Vik
2009 Aug 29 1:01 PM
Hi,
you are right, but I have removed that portion which ask the location to store the file.
I have hardcoded the path.
Regards
H..P.
2009 Aug 29 1:06 PM
Well dude even if you hard code the path, if you are using gui_upload or gui_download wont work if the job is scheduled as background job. When the program is run in background job, the SAP system is completely independent and any operations related to presentation sever wont work. The only solution is to upload or download the data to the application server instead of presentation server. Hope you are clear now.
Regards,
Vikranth
2009 Aug 31 6:59 AM
Hi,
Is there any other alternative to resolve this problem? Please suggest me.
Regards
H.P.
2009 Aug 31 7:26 AM
Hi,
As i suggested use application server for download or upload files instead of presentaion server. There is no other solution available for this if you are running the program as a background job.
Regards,
Vikranth
2009 Aug 31 7:27 AM
Dear Singh,
<li>After converting data into PDF file, you may be downloading pdf into desktop. In background you can not download or upload files. It is clear and confirmed.
<li>In your case, you may be hardcoded file path, but dealing presentation server in background impossible.
<li>Instead you can download to Application server using OPEN DATASET, TRANSFER and CLOSE DATASET.
Thanks
Venkat.O
2009 Aug 31 10:28 AM
2009 Aug 31 10:59 AM
Hi,
After converting the spool output to PDF using 'CONVERT_ABAPSPOOLJOB_2_PDF',
Try the following,
data: dsn(100) value '/usr/sap/xfr/FIS/testpdf'. " Application server Path
OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.
LOOP AT it_pdf_output.
TRANSFER it_pdf_output-field TO dsn.
ENDLOOP.
close dataset dsn.
2009 Aug 31 12:42 PM
I have done below mentioned code. But it is not generating PDF file or text file.
data: dsn(100) value 'c:\abcpdf.pdf'.
OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.
LOOP AT pdf.
TRANSFER pdf-tdline TO dsn.
ENDLOOP.
close dataset dsn.
Regards
H.P.
2009 Aug 31 12:47 PM
>
> I have done below mentioned code. But it is not generating PDF file or text file.
>
>
>
> data: dsn(100) value 'c:\abcpdf.pdf'.
>
>
Here you have given a presentation server path. OPEN DATASET statement is used for application server path. Goto Tcode AL11 to check the application server path and give the appropriate path. After executing the program again go to AL11 and the specified path. There you will find the created file.
Please also search for the difference between presentation and application server in SCN first.
2009 Aug 31 12:48 PM
'c:\abcpdf.pdf' is presentation server path. for presentation server you just need GUI_DOWNLOAD.
OPEN DATASET is only used for application servers
2009 Aug 31 1:28 PM
thanks a lot to all.........
It is now generating text file in the background.....
Thanks & Regards
H.P.