Debug background job program
Hi,
i am debugging the program in background mode,
first time i was successful in capturing the job,
second time it is giving error, capture job is failed.
sm37 , jdbg also not working, its given error like bebuggin is not possible in active mode.
in sm50 transaction, it is giving some information message like user reached maxium debugging modes. some error.
please help me, it is very urgent
thanks in advance
points will be rewarded
Hi,
change source code in a way like this:
DATA:
stop_for_capture.
DO.
IF sy-uname NE 'HABICH'. "change to your account
EXIT.
ENDIF.
IF NOT stop_for_capture IS INITIAL.
EXIT.
ENDIF.
ENDDO.
So you have enough time to capture.
proceed by changing value stop_for_capture.
regards
Walter Habich
Edited by: Walter Habich on May 23, 2008 9:56 AM
Similar Messages
-
Guy's
is it possible to debug background job.job
that u schedule in backgroundYou can also try this..
Once the job is completed, get into SM37, place the cursor on your Job and enter 'JDBG' in the command field (where you normally enter the Tcodes). This will take you into debug mode & will replicate the runtime of the Job that is completed.Once in debug mode, you will have to single step through a few times to get into the actual ABAP Program.
Regards,
Suresh Datti -
How to debug background jobs?
Hi all,
How to debug background jobs?
Rgds,
BalajiHi ,
Goto sm37-> select active job , tcode jdbg with out /n or / .
or goto sm50-> select job program/mode-> program-> debuging. -
How to debug background job?
Hi, All:
How to debug background job.
Thanks,Hello,
Take a look a this <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abap+debugger&">blog</a>, it says all what you need to know about strange debuggings (=
Regards -
Hello Experts,
I want to debug standard T- Code 'F110' (Automatic Payment Run).
Basically wat it does is just submit one program SAPF110S
but as a background job
i.e
SUBMIT SAPF110S AND RETURN
USER SY-UNAME
VIA JOB JOBNAME NUMBER JOBCOUNT
WITH PARLAUFD = F110V-LAUFD
WITH PARLAUFI = F110V-LAUFI
WITH PARXVORL = XVORL.
and thats why i m not able to debug it
so how is it possible
Pls help me on this
Regards
RaviHi Nagraj,
I know the standard method of debugging a program, but I am submitting a report program which is executed in Background.
I tried debugging with /h in the command field, but I am unable to debug.
I hope u have understood the question properly.
Regards,
Ravi -
Background job - programs all running at the same time...
Hi experts,
i have an issue regarding background job.i have to run multple programs in background one after another in one program.so i am using function modules job_open,submit and job_close.
my problem all the jobs are statrting at same time .but i want to run after completion of first job second job should start.
please guide me
Thanks
sai
Edited by: Julius Bussche on Feb 19, 2009 9:36 AM
Please use meaningfull subject titlesTry something like
LOOP AT it_filenames INTO ts_filenames.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount.
SUBMIT program
WITH p_file1 = ts_filenames-zzfname
VIA JOB jobname NUMBER jobcount
AND RETURN.
IF sy-tabix EQ 1.
CLEAR: pred_jobcount,
pred_jobname.
GET TIME.
IF sy-uzeit LT '235950'.
sdlsstrttm = sy-uzeit + 10.
sdlstrtdt = sy-datum.
ELSE.
sdlsstrttm = '000010'.
sdlstrtdt = sy-datum + 1.
ENDIF.
ELSE.
sdlsstrttm = ' '. " no_time from LBTCHTOP
sdlstrtdt = ' '. " no_date from LBTCHTOP
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = jobname
predjob_checkstat = ' '
pred_jobcount = pred_jobcount
pred_jobname = pred_jobname
sdlstrtdt = sdlstrtdt
sdlstrttm = sdlstrttm
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.
pred_jobcount = jobcount.
pred_jobname = jobname.
ENDLOOP.
I removed the checkstat, cause if you want to check the status you only have to submit one job with multiple steps. (Put JOB_OPEN and JOB_CLOSE out of the loop)
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount.
LOOP AT it_filenames INTO ts_filenames.
SUBMIT program
WITH p_file1 = ts_filenames-zzfname
VIA JOB jobname NUMBER jobcount
AND RETURN.
ENDLOOP.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = jobname
strtimmed = 'X'.
Regards -
How to run the program in background job,program should run in 3 days.
Dear Gurus,
i have a program , that program should run approximately 3 days to get the result.
i scheduled this program as a background job.
how can i run sto5 t-code for this same program.
i that case how we can trace the output.
Experts please help me out.
Thank u very much.
Regards
sudheerHello Sudheer,
The trace can be set on background jobs by using ST12 transaction. Please make sure that the trace is activated for only few minutes in production environment.
Contact your basis team to activate trace on background job and the transaction used is ST12.
Thanks -
Regarding debugging background job
HI Experts,
how to debug the report which is scheduled in background.
Regards
Ramakrishnacheck for the answers in :
Re: ABAP program to run in Background job -
How to debug the background job in ABAP
Hi Guys,
Can anyone let me know how to debug the background job in ABAP.
Thanks in advance
peterHi,
Goto SM37 and see the log if any is there and based on that you can check the code.
you can't debug background job.
Create a Variant for the Program and
Schedule JOB in background:
Go to SM36 create a Job
enter Program and Variant for that program in STEP..
click on Start Condition
Click on DATE and TIME enter date scheduled Start and END times
click on Period Values
Click on HOURLY/WEEKLY etc
CLick on RESTRICTIONS also to use further criteria.
so your job will be scheduled and run as per your requirement.
and in SM37 Transaction check the status of that JOB
Check this link for scheduling jobs..
http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
Check this
http://jplamontre.free.fr/SAP/Debug%20background%20process.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abap+debugger&
Regards,
Padmam. -
Regarding background job.
Hi All,
I have to debug background job which is currently running.
I know how to get the job in debug mode, that is through SM51 transaction...But once i m done with seeing some values in debug mode. I need to put this job back again in the background. Becasue since this is long running job i can not run it in forground.
Plase guide me in this regards.
-SanjayHi,
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.
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.
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.
goto SM37 and from Program menu(not sure.. try other menu's)
-->Catchjob . it will goto the active job in debugging mode.
Regards,
Raj. -
Scheduled background job for FBV0 transaction is not working.
Hi All,
We have impleted OSS note 971193. This is program which deletes parked documents in the system and it behaves good when we run in the foreground and doesn't work when it is scheduled in background. I debugged background job which is scheduled and program fails after call transaction. I get this following error "Error in Document Deletion. Runtime error RAISE_EXCEPTION has occurred".
Can anyone please help me if you have any info on this or if you see similar kind of problem.
Thanks in Advance.
Regards,
Many idea ?
-
Hi
Gurus
What is Schedule Background Jobs and whatu2019s the use of Schedule Background Jobs
How it will worku2019s
Please give me detail Information about Schedule Background Jobs
Many Thanks
MahiHello Mahi,
The BackGround job - "Program" thats runs in SAP Server and not depend any user interface.
like Antivirus program on your local station that runs (scaning your computer all the time) without any user interface (becide tray Icon) and unless you going to Running Proccess on your computer you don't know that it working.
Schedule BackGround Job its any backGround Job that you schedule to run any time you want and you can make it run recursivly.
you can go to Transaction SM36 to schedule your Programs.
Good Luck
Eli Steklov
Please Reward Points if it Helped -
Some records are missing in the mail, when scheduled a background job.
There is a Z report, which will display some details from SD, MM , WM every day , and the same thing need to be mailed to the user through background Job.
Issue is that spool is correct and it is missing some records ( Billing due list ), even internal table have records and displayed in the spool , in the mail it says
No Entries Found.
Is there any chance of debugging background job.
Good thing is that when executed in foreground it is working fine. Both mail and report display.EM_BODY = '4) VF04 -- Processing Billing document due list.'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
IF IT_FINAL3[] IS INITIAL.
EM_BODY = ' No Entry Found'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
ELSE.
CONCATENATE 'Delivery No' 'Created By' 'Created On'
'Reason' INTO HEAD SEPARATED BY ' '.
EM_BODY = HEAD.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
CLEAR V_TEXT.
CLEAR ITEM.
LOOP AT IT_FINAL3.
CONCATENATE IT_FINAL3-VBELN IT_FINAL3-ERNAM IT_final3-ERDAT
IT_FINAL3-RESO INTO ITEM SEPARATED BY ' '.
V_TEXT = ITEM.
EM_BODY = V_TEXT.
APPEND EM_BODY.
ENDLOOP.
EM_BODY = ' '.
APPEND EM_BODY.
ENDIF.
This is the part where it is failing, where it_final3[] is initial.
but whereas in the spool i can view those records. -
Can we debug programs called in background job?
Hi Everyone,
Here is my question:
I set some breaakpoints in program A which is call by another program B.
And in B, it defines a background job to run A.
but when i run program B , the berakpoints set in A don't work,why???
(I can not run A directly, for it needs a large amount of parameters which can't be input manually)
How to solve it? Thanks
Regards.Hi,
Yes if it is a custom program.
Here how it works.
- Put a endless loop in your code.
- Run the program.
- Go to SM50 and select your process.
- Then go to Program/Session->Program-> Debugging.
- It will open the debugger. Now come out of endless loop by changing values and check whatever you want.
Regards,
pranaya -
Problems creating background job for program (job open, submit and close)
Hi gurus,
im trying to start a background job using the FM BP_START_DATE_EDITOR to show the start date to the job or if it's imediate. this FM it's working fine, after call it im opening a job, submiting it and call the job close FM and the job close FM creates me the job.
The problem it's when i go to the sm37 to see the job status the job has been canceled, and the job log says that i have to give a start date to the job.
What i dont understand it's either the job is imediate or i choose a date to start the job always gives me this error...
Below goes my code,
any ideas will be rewarded
CLEAR: stdt_modify_type, stdt_output.
CALL FUNCTION 'BP_START_DATE_EDITOR'
EXPORTING
stdt_dialog = 'Y'
stdt_input = stdt_input
stdt_opcode = 14
IMPORTING
stdt_modify_type = stdt_modify_type
stdt_output = stdt_output
EXCEPTIONS
fcal_id_not_defined = 1
incomplete_last_startdate = 2
incomplete_startdate = 3
invalid_dialog_type = 4
invalid_eventid = 5
invalid_opcode = 6
invalid_opmode_name = 7
invalid_periodbehaviour = 8
invalid_predecessor_jobname = 9
last_startdate_in_the_past = 10
no_period_data_given = 11
no_startdate_given = 12
period_and_predjob_no_way = 13
period_too_small_for_limit = 14
predecessor_jobname_not_unique = 15
startdate_interval_too_large = 16
startdate_in_the_past = 17
startdate_is_a_holiday = 18
startdate_out_of_fcal_range = 19
stdt_before_holiday_in_past = 20
unknown_fcal_error_occured = 21
no_workday_nr_given = 22
invalid_workday_countdir = 23
invalid_workday_nr = 24
notbefore_stdt_missing = 25
workday_starttime_missing = 26
no_eventid_given = 27
OTHERS = 28.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
MOVE 'X' TO gv_flag.
ENDIF.
DATA jobname LIKE tbtcjob-jobname.
DATA jobcount LIKE tbtcjob-jobcount.
DATA job_release LIKE btch0000-char1.
DATA job_imediate TYPE c.
CLEAR: jobname, jobcount, job_release.
CONCATENATE 'MAPAEXEC' sy-uname sy-datum
INTO jobname SEPARATED BY space.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i003(zmapas).
EXIT.
ENDIF.
SUBMIT z_mapa_execucao_orcamental
VIA JOB jobname NUMBER jobcount
WITH ano EQ ano
WITH so_perio IN so_perio
WITH so_date IN so_date
WITH so_org EQ so_org
WITH so_num IN so_num
AND RETURN.
IF stdt_output-startdttyp EQ 'I'.
CLEAR job_imediate.
job_imediate = 'X'.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
calendar_id = stdt_output-calendarid
event_id = stdt_output-eventid
event_param = stdt_output-eventparm
event_periodic = stdt_output-periodic "?
jobcount = jobcount
jobname = jobname
laststrtdt = stdt_output-laststrtdt
laststrttm = stdt_output-laststrttm
prddays = stdt_output-prddays "??
prdhours = stdt_output-prdhours "?
prdmins = stdt_output-prdmins "??
prdmonths = stdt_output-prdmonths
prdweeks = stdt_output-prdweeks "?
predjob_checkstat = stdt_output-checkstat
pred_jobcount = stdt_output-predjobcnt
pred_jobname = stdt_output-predjob
sdlstrtdt = stdt_output-sdlstrtdt
sdlstrttm = stdt_output-sdlstrttm
strtimmed = job_imediate
targetsystem = stdt_output-instname
start_on_workday_not_before = stdt_output-notbefore
start_on_workday_nr = stdt_output-wdayno
workday_count_direction = stdt_output-wdaycdir
IMPORTING
job_was_released = job_release
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.
IF sy-subrc <> 0.
MESSAGE i003(zmapas).
EXIT.
ELSE.
MESSAGE i004(zmapas) WITH jobname.
ENDIF.
Thanks in advance,
Best Regards
João MartinsHello João.
In debug mode, check the value of variables you passed to parameters sdlstrtdt and sdlstrttm.
As aditional info, I usually achieve your goal without FM BP_START_DATE_EDITOR.
Check this code:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = w_jobname
IMPORTING
jobcount = w_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
CHECK sy-subrc = 0.
CLEAR seltab_wa.
MOVE: t_jobs-param TO seltab_wa-selname,
t_processar-line+34 TO seltab_wa-low.
APPEND seltab_wa TO seltab.
seltab_wa-selname = 'P_LOJA'.
seltab_wa-low = t_processar-ficheiro+7(4).
APPEND seltab_wa TO seltab.
*** Submete o programa para o JOB
SUBMIT (t_jobs-repid)
WITH SELECTION-TABLE seltab
USER sy-uname
VIA JOB w_jobname NUMBER w_jobcount
AND RETURN.
*** Encerra o JOB
l_hora = sy-uzeit.
ADD 60 TO l_hora.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = w_jobname
sdlstrtdt = sy-datum
sdlstrttm = l_hora
targetserver = w_servidor
IMPORTING
job_was_released = l_liberado
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.
Regards.
Valter Oliveira.
Maybe you are looking for
-
Firefox will close unexpectedly then when I try to open it I get a message saying it is already open and I must close it first. I cannot find it open anywhere and then I must reboot to open Firefox again.
-
With Upgraded 9.3 cannot find photo file
Just upgraded to iPhoto 9.3 and had the photo file automatically upgraded. I can open the app with the iPhoto icon. But I cannot find the photo file. And cannot do either from another computer on my network. All that shows is the app icon. Where
-
HT4061 having issues with downloading an app
I'm trying to download an app that is free and i'm getting a verification reuired messge to purchase the app meanwhile it's free--help!
-
Where can i get the demo version of BPA Suite for linux?
Hi guys, The article "Oracle Suite Instalation and Administration Guide" suggests use the installer called install_bpa<version>.<build number>.sh, but I can not find it for download. Thanks in advance.
-
I accidentally restored BF's phone back this latest back-up which was March 2013... Some of his data were saved on iCloud but not everything. I don't understand why it only picked certain things to store in iCloud and not everything! For exmaple, fe