Application Development 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: 

Problem In JOB Execution

Former Member
0 Kudos
486

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

1 ACCEPTED SOLUTION

former_member203501
Active Contributor
0 Kudos
288

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

16 REPLIES 16

Former Member
0 Kudos
288

read the job log and tell us what it says

0 Kudos
288

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.

former_member203501
Active Contributor
0 Kudos
289

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

0 Kudos
288

Hi,

Dear friend when I do like this then Cancelled job execute properly without any error.

Regards

H.P.

0 Kudos
288

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

0 Kudos
288

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.

0 Kudos
288

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

0 Kudos
288

Hi,

Is there any other alternative to resolve this problem? Please suggest me.

Regards

H.P.

0 Kudos
288

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

0 Kudos
288

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

0 Kudos
288

Dear Friend,

Can I make PDF using OPEN Data Set.?

Regards

H.P.

0 Kudos
288

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.

0 Kudos
288

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.

0 Kudos
288

>

> 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.

0 Kudos
288

'c:\abcpdf.pdf' is presentation server path. for presentation server you just need GUI_DOWNLOAD.

OPEN DATASET is only used for application servers

0 Kudos
288

thanks a lot to all.........

It is now generating text file in the background.....

Thanks & Regards

H.P.