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

How to do debugging for a batch job?

Former Member
0 Likes
6,879

Hi Colleague,

I created a batch job via t-code sm36 in SAP GUI, and added a report to this batch job, there is no problem to run this report directly, but fails to run the batch job. How can I do debugging for this batch job?

Kind Regards

Andie

1 ACCEPTED SOLUTION
Read only

venuarun
Active Participant
5,224

Hi

Go to SM37

Type 'JDBG'

Double Click your job

Regards

Arun VS

12 REPLIES 12
Read only

Former Member
0 Likes
5,224

Hi,

if you rin the programm directly its executed in foreground. When scheduling a batch job, its executed in background. This may cause the problem.

you can catch the batch-job in transaction SM50 / SM51 and jump into debugger.

regards

Stefan Seeburger

Read only

former_member201275
Active Contributor
0 Likes
5,224

There are a number of ways to do this:

1. select active job in sm37.

2. type "jdbg" command in command field.

   No need to type /n or /o .

3. Double click the job , it will go in debug mode.

           OR

1. Go to sm50 .

2. place the cursor on active job.

3. goto program mode> Debugging

Read only

venuarun
Active Participant
5,225

Hi

Go to SM37

Type 'JDBG'

Double Click your job

Regards

Arun VS

Read only

Former Member
0 Likes
5,224

Hi Arun VS,

Now I can do debugging, when I invoke the following standard function module, there is a dialog box popped up for doing security check. How can I prevent it from being popped up in a batch job?

............................................................

CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

      filename                = lv_full_path

      filetype                = 'ASC'

      codepage                = lv_codepage

      write_bom               = ip_bom

    IMPORTING

      filelength              = lv_file_length

    TABLES

      data_tab                = gt_xml

    EXCEPTIONS

      file_write_error        = 1

      no_batch                = 2

............................................................

Kind Regards

Andie

Read only

Former Member
0 Likes
5,224

Hi,

GUI-DOWNLOAD not working in background. Search forum, for further information.

If u need to do it in background, 1 way is to change the programm and read from appication server.

regards

Stefan Seeburger

Read only

Former Member
0 Likes
5,224

Hi Andie,

You can't execute the presentation layer related task like what you doing the GUI_DOWNLOAD during background jobs. You have download or upload to application layer.

The popup is coming from GUI security which can be prevented by clicking remember me checkbox for one time and Allow or changing the GUI security parameter

Thanks & Regards,

Arun

Read only

Former Member
0 Likes
5,224

Hi Stefan,

This function module is standard, I cannot change its coding. And I try to input several import parameters but no one can be used to prevent this dialog box from being popped up. Is there another way to run it in background?

Kind Regards

Andie

Read only

Former Member
0 Likes
5,224

Hi Arun,

See my reply above. Is there another way to run it in background?

Kind Regards

Andie

Read only

venuarun
Active Participant
0 Likes
5,224

Hi,

By giving remember my decision.

regards

Arun VS

Read only

Former Member
0 Likes
5,224

Hi Andie,

GUI_DOWNLAOD will not work for  background job , only in foreground and job is failing not because of the popup. GUI_DOWNLOAD needs GUI interaction.

As I told earlier, in GUI security some rule related to download file might have set as ASK.

Thanks & Regards,

Arun

Read only

Former Member
0 Likes
5,223

Hi Arun VS,

How can I give my decision in background?

Kind Regards

Andie

Read only

Former Member
0 Likes
5,223

Hi Arun,

When I run this report directly, there is no problem. But fails to run batch job, the popped up dialog box is the key diffferent point between them. Please see the error message as below after running report.

-------------------------------------------------------

Result(s):           6

2014-08-13T12:08:21Z

\\DWDF219.WDF.SAP.CORP\ICP_BACK_UP\P1C\RCA_P1C_BACKUP_20140813120821.xml

Error occurs when saving file.

msgid =  FES

msgno =  022

sy-subrc =     21

-------------------------------------------------------

Kind Regards

Andie