10-03-2008 3:26 AM
Experts really need your help soon,
How to debugg the program in back ground mode.
In below code, zsvcmdc1 program which does the changes to some fields in Va02 . I need to find out immediately why the program is missing to update one of the Va02 field when we run the program in backgroud mode.
I tried by excuting the program, se38 --> program name + F8 --> Program --> Execute back ground ...
But this way i could not debugg the program...why bacause itis direclty getting excecuted and in sm37 the program is with status Finished .
Please help me how can I debugg and solve
form document_chg_batch.
move gcon_charn to gc_select.
perform check_documents_selected.
check gc_select eq gcon_chary.
perform read_selected_lines.
call function 'JOB_OPEN'
exporting
jobname = gcon_jobname
importing
jobcount = gc_jobcount
exceptions
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
others = 4.
** Get print parameters for batch job.
perform get_print_parameters.
submit zsvcmdc1
with s_data in git_data
* Following line inserted, D31K913010, 28/10/99 INF
with p_runnum eq gc_runnum
with p_rsean = p_rsean
with p_rcoll = p_rcoll
with p_rtheme = p_rtheme
via job gcon_jobname number gc_jobcount to sap-spool
and return
keep in spool gcon_charx
without spool dynpro.
call function 'JOB_CLOSE'
exporting
jobcount = gc_jobcount
jobname = gcon_jobname
strtimmed = gcon_charx
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.
message i046 with gcon_jobname sy-datum sy-uzeit sy-uname.
endform. " DOCUMENT_CHG_BATCH
Below is fore ground code
** Reads all the selected lines, and submits the records for change in
** online mode.
form document_chg_online.
move gcon_charn to gc_select.
perform check_documents_selected.
check gc_select eq gcon_chary.
perform read_selected_lines.
submit zsvcmdc1
with s_data in git_data
* Following line inserted, D31K913010, 28/10/99 INF
with p_runnum eq gc_runnum
with p_rsean = p_rsean
with p_rcoll = p_rcoll
with p_rtheme = p_rtheme
and return.
endform.
THANKS IN ADV.
10-05-2008 10:58 AM
Hi,
For a batch job or long running program (SM50):
Select the program to be debugged
Menu: Program/Session -> Program -> Debugging
In the job overview(SM37) you can debug each job with the ok-code JDBG.
Warning : This is like a restart of the job.
-> All possible updates will be executed !
Regards,
Sunil
10-03-2008 12:11 PM
Hi,
You can intrduce a endless loop with an exit condition to exit from debug mode in your code at the point where you want to debug and then go to SM50 and use menu path Program/Session>Program>Debugging. Please make sur you have necessary authorization to do so.
The sample code can be like this
data : l_exit(1) type C.
do.
if l_exit = 'X'.
exit.
endif.
enddo.
So if you want to go out of the endless loop just set l_exit to 'X' in debug mode.
Hope it helps.
Rudra
10-05-2008 10:58 AM
Hi,
For a batch job or long running program (SM50):
Select the program to be debugged
Menu: Program/Session -> Program -> Debugging
In the job overview(SM37) you can debug each job with the ok-code JDBG.
Warning : This is like a restart of the job.
-> All possible updates will be executed !
Regards,
Sunil