This website is not affiliated with, sponsored by, or approved by SAP AG.

Is it possible to debug the Backgroud Job ? How ?

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Is it possible to debug the Backgroud Job ? How ?

Postby Sri » Wed Oct 30, 2002 8:14 am

Hallo All, Is it possible to debug the Backgroud Job ? How ? Coz I wrote a FM which was incorporated in a program. I defined this program for a job. If I run this program indvidually it is serving my purpose. The same program is not working properly in job maintainance. Any small help/hint appreciated. THanks in advance. ...Best Regards ..Sri
Sri
 
Posts: 318
Joined: Mon Oct 21, 2002 7:34 am

Postby Bugs Bunny » Wed Oct 30, 2002 8:33 am

Try this trick:

code in your program and endless loop like this:

data:
h type i.

h = 1.

while h = 0.
endwhile.

Then you start the progam in background and it will of course hang, which is intended so.

You will see it (hanging) in SM51. There you chose
Program/Program/Debugging and change in the debugger
h to 0 and debug as in foreground.

Regards
BB
Bugs Bunny
 

Postby Dopey » Wed Oct 30, 2002 8:38 am

Hi-ho Sri,

Perhaps you could check that you are not using calls from a local PC in the code

e.g. ws_download, gui_download etc. As these will only work when the user's PC initates it - as it is the SAP GUI which will be used. Whereas if the code is run in the backgorund, then there is no SAP GUI as the processing occcurs on the application server and so the program will not execute.

I hope this helps.

Dopey
Dopey
 
Posts: 68
Joined: Mon Oct 21, 2002 3:11 am
Location: Earth

Postby ocvantol » Wed Oct 30, 2002 8:44 am

:idea: You'd better set h to 0, if you want that endless loop to work. :wink:
ocvantol
 
Posts: 929
Joined: Tue Oct 22, 2002 3:19 am
Location: The Hague

Postby Sri » Wed Oct 30, 2002 8:48 am

Tnaks BugsBunny and all for u'r debuging tip. But I could not reach my program in debugging. I will try more . ..Thanks any way..Sri
Sri
 
Posts: 318
Joined: Mon Oct 21, 2002 7:34 am

Postby Frank Nickle » Wed Oct 30, 2002 11:39 am

Sri,

Using transaction SM37 you can capture the job if you
are on the same app.server. Then you should be able
to debug it if you have the proper authorization.

I have tried this, but lacked proper authority.

Frank
Frank Nickle
 
Posts: 28
Joined: Mon Oct 21, 2002 9:06 am
Location: Springdale, AR

Postby Innocent_Abapper » Wed Oct 30, 2002 12:05 pm

More simply, you could try just writing variable values to a file on the application server to see what's happening to these variables. Not as good as on-line debugging, but okay if you're stuck...
Innocent_Abapper
 
Posts: 149
Joined: Tue Oct 29, 2002 3:29 pm
Location: Republic of Ireland

Postby bubu » Wed Oct 30, 2002 12:57 pm

Just as Frank Nickle have said, you can capture active job using SM37 (Job Overview->Ctrl+Shft+F7) ...
bubu
 
Posts: 529
Joined: Mon Oct 21, 2002 7:42 am

Postby Guest » Wed Oct 30, 2002 4:47 pm

More than likely, the job setup has very little to do with the proper execution of your code. Try running the program in background from se38 and place a debug stop anywhere you wish. This will run it as it it would be ran from SM37.
Guest
 

Postby anatogi » Mon Nov 04, 2002 7:59 pm

Try this,

You can debug batch jobs by going to 'SM37', type in 'JDBG' in the
command line ( no '/' ), put the cursor on the job and press enter - will
take you to the job in debug mode.

You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job also sy-batch will set to 'X'.

So type in the transaction code 'JDBG' and place your cursor on the job after It has finished. It will take you to a SAP program in debug mode. Step through this program which is about 10 lines, after this your program will be executed in the debug mode.

Cheeers.
anatogi
 
Posts: 45
Joined: Thu Oct 24, 2002 1:06 am

Postby ABAPOSAUR » Sat Jul 24, 2004 4:36 am

Is this dick trying to sell insurance or what?? :D
ABAPOSAUR
 
Posts: 368
Joined: Tue Jul 20, 2004 12:07 pm
Location: UK

Postby TryMe » Wed Jul 28, 2004 6:27 am

Steps
1. Create variant called BACKGROUND for program to be debugged.
2. Execute ZDEBUGBG (pgm code below) in background for immediate processing.
3. Execute transaction SM50.
4. Select process that runs ZDEBUGBG.
5. Goto 'Program/Session' 'Program' 'Debugging'.
A se80 debug session will open.
6. Change variable W_EXIT to 'E'.
7. Step thru (F6) until ZWBTEST comes up.

Wala



*&---------------------------------------------------------------------*
*& Report ZDEBUGBG *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT zdebugbg.

DATA:
w_exit TYPE c.

FIELD-SYMBOLS <fs> TYPE ANY.

SELECTION-SCREEN BEGIN OF BLOCK one.
PARAMETERS: p_repid LIKE trdir-name DEFAULT 'ZWBTEST'.
SELECTION-SCREEN END OF BLOCK one.

START-OF-SELECTION.
PERFORM loop_time.
PERFORM submit_time.

END-OF-SELECTION.

*---------------------------------------------------------------------*
* FORM loop_time *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM loop_time.
DO.
IF w_exit = 'E'.
EXIT.
ENDIF.
ENDDO.
ENDFORM.

*---------------------------------------------------------------------*
* FORM submit_time *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM submit_time.
ASSIGN p_repid TO <fs>.
SUBMIT (<fs>)
USING SELECTION-SET 'BACKGROUND'.
ENDFORM.
TryMe
 

Postby norinori1 » Wed Jul 28, 2004 2:15 pm

1. Go to Transaction SM66 and find your work porocess.
Select the line work process is on and click on the Debugging button.
If this is a custom program, you can put a wait statement in the code to buy yourself sometime.

2. Go to Transaction SM50. From the tool bar "Program/session"->Program->Debugging.

Good luck
norinori1
 
Posts: 43
Joined: Thu Feb 19, 2004 10:12 am
Location: TX

Postby DeadLock » Sat Jul 31, 2004 3:55 am

goto SM37 and from Program menu(not sure.. try other menu's)
-->Catchjob . it will goto the active job in debugging mode.
Rgds
DeadLock
Image
ABAP Company ...
DeadLock
 
Posts: 123
Joined: Mon Dec 01, 2003 2:30 am
Location: Round the Earth

Postby abaper4u » Mon Aug 02, 2004 5:10 am

Hi all,

Just shedule your job.

Get to overview screen.

Select job


Write JDBG in the command field.

And Enjoy.........
Regards
Abaper
:lol: :lol: :lol: :lol: :lol: :lol:
abaper4u
 
Posts: 245
Joined: Thu Dec 05, 2002 8:05 am

Next

Return to ABAP

Who is online

Users browsing this forum: No registered users and 5 guests



cron


loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.