How do we debug jobs in background
hi guys can any one clarify my doubt regrding debugging a job which is scheduled
in back ground..
thanks in advance..........
Hello,
You can debug very easily if your program that you want to debug is a custom program. You can put an endless loop in the code somewhere.
WHILE SY-SUBRC = 0.
CHECK SY-SUBRC = 0.
ENDWHILE.
Now go to SM50, select the work process that is running the program. Click Program/Session->Program->Debugging, it will then open the debugger and you will be looping at your endless loop. Change the value of SY-SUBRC to get out of the loop and debug as normal.
or
1) Fix the break points.
2) Create job.
3) Go SM37
4) Select the job and write "jdbg" in command line.
Check:
<b>Re: Debug the baclground job
Regards,
Beejal
**Reward if this helps
Similar Messages
-
How to run a job in background programatically after 10 sec
Hi Forum,
Can anyone tell me How to run a job in background programatically after 10 sec..
Thanks in advanceHi,
Here is the example code
*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
* Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum " You need to give the Date for execution the Job
sdlstrttm = sy-uzeit " You need to give the Time for execution the Job
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
* Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
* Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Regards
Sudheer -
How to delete a job in background programatically after 10 sec
Hi all,
Can anyone tell me how to delete a job in background programatically after the transaction is trigerred in 10 sec.
Yours help will be greatly appreciated
YathishHave a look at standard report RSBTCDEL. May be helpful to you.
Best Regards,
Vibha
*Please mark all the helpful answers -
How to find process chain using background job in sm37
How to find process chain using background job in sm37
Better is to select the job.
Select (Define) Step (s) or F6.
Select the line and Menu Goto>Variant.
The variant contains the name of the CHAIN and its VARIANT.
Success
We faced an old job and via job monitoring we were informed about a cancelled job every 'interval'.
We noticed that the related chain was deleted but still the job was scheduled each interval again and was cancelled because an event was missing
We could not find the scheduled job via SM37.
Via view V_OP, view over tbtco abd tbtcp, we find the related entry.
We delete these entries via function BP_JOB_DELETE....
Edited by: Jack Otten on Jul 9, 2010 2:50 PM -
How will you schedule the job in background?
How will you schedule the job in background?
Pls go to this link
http://help.sap.com/saphelp_bw33/helpdata/en/4c/89dc37c7f2d67ae10000009b38f889/frameset.htm
Step by Step
http://help.sap.com/saphelp_nw04/helpdata/en/67/13843b74f7be0fe10000000a114084/content.htm
An example of a complex process:
http://help.sap.com/saphelp_nw04/helpdata/en/3c/63073c52619459e10000000a114084/frameset.htm
process chains
process chains
Process chains
http://help.sap.com/saphelp_bw30b/helpdata/en/ad/6b023b6069d22ee10000000a11402f/frameset.htm
Re: Ho to make a variable mandatory or optional?
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
Thanks & regards
nath.......... -
How to prvent job in Background during a particular daytime?
Dear all,
I have a urgent requirment to prevent all job in background for mring 7:oo am to evening 7:00 pm.
Is this possible?
if yes then plz suggest me possible way to accomplish my requirment.
Regards
RickyI think you can accomplish this in 2 different ways.
1. When you define the job start condition using SM36, you can choose Date/Time option and provide Scheduled start and No start after OR
2. If you choose Operation mode and provide an operation mode (night operation, day operation etc). speak with you basis folks to configure this option. -
Error while running a job in background
Hi,
I got the following error message while running the job in background.
"Step 001 started .
Control Framework: Fatal error - GUI cannot be reached.
ABAP/4 processor: RAISE_EXCEPTION
Job cancelled"
What is the reason for this error and how to correct it?ALV Grid control is based on the custom controls on the screen. When the program is scheduled in background, it tries to create GUI related front-end objects and hence the error u201CFatal Error u2013 GUI cannot be reachedu201D. This type of problem is common with all the programs that use the ALV grid control to display the output.
Solution:
Whenever we execute this type of programs in background, we should be passing a blank docking container instead of the custom container as parent to our grid control.
The docking container doesnu2019t need any of the custom controls on the screen; instead it attaches an area to any or all of the four edges of the screen (top, left, right or bottom). The behavior of the areas in the container is determined by the sequence in which they are initialized. Docking Containers are attached to the screen from the inside out. This means that when you create a second container, it is attached to the edge of the screen, and the container that was already there is pushed outwards.
Let us modify the standard program (by taking a copy of it) to enable it to execute it in background.
Following modifications have to be made:
· Define a docking container in the program
data: or_doc type ref to cl_gui_docking_container .
· At the time of creating a custom container, check if the program is being executed in background or foreground. If the program is scheduled in background, then create a docking container instead of custom container.
if cl_gui_alv_grid=>offline( ) is initial.
create object or_custom_container
exporting container_name = c_container.
create object or_grid
exporting i_parent = or_custom_container.
else .
create object or_grid
exporting i_parent = or_doc .
endif .
Now test executing the program in background. The report would be generated. -
Schedule job in background and ftp the data to non-sap system
Hello All,
I have a requirement where in i have to write a program(with selection screen) to download 2 files into application server(frequency: end of each day i.e daily at 23:59), and then in turn i need to put those two files into FTP server using FTP script.
i guess my flow of the code should be
1. write the program with selection screen and
2. get the data from corresponding tables and put it into internal tables.
3. then i have download the data into application server
my question is : how i will schedule the job in background to download the data into application server daily? using job_open, job_submit, job_close?
4. then how i need to move the files from application server to FTP server using FTP SCRIPT?
Also my doubt is once i execute the program ONLY, the background job is triigred (because i wrote job_open, job_submit and job_close inside my program). then how will i input the data into screen daily and download the data into application server in background automatically???? i am confused ...
Please help me to solve the above issues
thanks
sangeetha>
sangeetha s k wrote:
How my data in application server will be transfer to another system using above FM? Because i am not passing application server file path in SAP to that FM. Could you please explain ?
So the path name and the file name are always the same? In that case you could simply create a SM49 entry with hard coded file & path name.
An easy example for the COPY command under WINDOWS OS:
Create a command in SM49 called ZCOPY with following data:
Operating System = Windows NT
OS command: cmd
Parameters for os command: /C copy "C:\tmp\my_file.txt" "z:\tmp\my_file_copy.txt"
Additional parameters allowed: (leave blank)
In this case you would call SXPG_COMMAND_EXECUTE by filling this 2 parameters:
commandname = 'ZCOPY'
operatingsystem = 'Windows NT'
In the case that the file name and the path are not fixed you would set the following in the SM49 definition:
Additional parameters allowed: X
In this case you would call SXPG_COMMAND_EXECUTE by filling this 3 parameters:
commandname = 'ZCOPY'
operatingsystem = 'Windows NT'
additional_parameters = params "<== fill in the path and file name during run time into this variable -
How to run the job under sys id
Hello ,
I wanted to run a job under sys id ( Batch user ) , as my authorisation is not sufficiant to run the repoting agent - Precalculation. Where as Batch user have all the roles for the same .
I am in my login screen , and i wanted to run the job under batch user id ...could you please let me know how can i do it ?
Regards,
ManojHi,
Try to schedule the job in background and see.
Thanks,
JituK -
How to schedule a job Monday thru Friday only
How can I schedule a job Monday thru Friday only? I tried to use a Factory Calendar but we do not have any M-F calendars setup. If I need to create a new factory calendar, how can I create on without any holidays?
Thanks.
RyanHi
see this
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
Regards
Anji -
How to restrict the job start conditions (only "Immediate" type) ?
Hi,
We allow our users to schedule and execute in background mode transactions (example IP19, IW38). We gave them for that authorizations (object S_BTCH_JOB with LIST, PROT, RELE and SHOW - objetct S_PROGRAM with BTCSUBMIT).
We would like that users can schedule and execute their jobs only with the u201CImmediateu201D job start condition (in the Start Time screen for the type of start condition : Immediate, Date/Time, After job, After event, or At operation mode).
Another solution: prohibit the scheduling and the execution background job in a certain time interval ...
How can restrict the job start conditions ?
Thank you.
Patrice.Hi Jan,
Yes, sa38 makes it possible indeed to execute in background into immediate mode a job but
the user have to know the name of the program to be carried out ...
The user knows only the name of these transactions trade. For example, IW38.
In the menu of this transaction, SAP gives the possibility to execute in background :
Program --> Execute in Background --> display of Start Time screen for the type of start condition :
Immediate, Date/Time, After job, After event, or At operation mode).
It is at this time there that we want that the user can only choose the "immediate" mode.
We must thus prohibit the other choices (Date/Time, After job, After event, or At operation mode) ... and
and we don't know how to restrict these other options in this screen "Start Time screen for the type of start condition".
Thank you.
By. -
How to create a new job in sm36 and how do we know the job has been created. where to look for that job name.
please explain.
thanks,
phyroseHi,
Save the variant of report.
Go to sm36. create a new job.
In start condition, specify all the day and time.
and in Step specify the report name and variant.
and then go to sm37 and run that report..........
In sm37, got to that job, select that job and click on display spool list to see the output of that job.
See the status of the JOB whether it is finised or executed with errors etc
If it is executed and the status shows FINISHED then go to the related transaction and see the output of that Report.
see the details for JOb secheduling
Scheduling JOB in background:
Go to SM36 create a Job
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
regards,
Ruchika
reward if useful........ -
How Do You Debug Oracle Report Calls From Forms On The App Server?
I am working on a system which uses oracle forms and reports 10g.
In our system we call, we are calling oracle reports from oracle forms. How do we debug the form code when the form and report both are running on the application server in production.
To my knowledge, this can not be done when the form is running locally since there is only OC4J forms services locally.
I understand one views error messages through the jinitiator console but how does one turn on this facility? How do you determine what line the error occurred?
I am looking for step by step instructions as answer to this issue.
Please be specific. Please write in good English.Good afternoon,
If you have the developer suite installed on your PC, run the report from your form and then follow this tree from the start button on your PC:
Developer Suite Home =>
Reports Developer =>
Oracle Application Server Report Services =>
Reports Queue Manager
Select View => Past Jobs and then find your report in the list, double-click the report entry and you'll see the error message that was generated by the Report Server when you tried to run the report.
Good luck,
Don. -
[abap] Running job in background
Hi !
When I am running a job in background using the functions :
'JOB_OPEN','JOB_SUBMIT','JOB_CLOSE'.
Eventually the job is in finished status, however
I get the following error popup message :
" classification locked (user username)
you cannot classify the batch
because the batch class is
currently being processed.
Do you want to try to carry out the
classification again ?
Please tell me what's the problem, and how to correct the problem ?.
Thanks
mosheMost likely you try to change data which is locked by another user to the same time in some cases - depending on what you were doing the locks are created by the same job in a previous step. In both cases there is only one scenario that works - check, resp. wait until the locks are released.
Christian -
How do you Debug start routine?
Hi gurus
How do you Debug start routine?
Thanks in advance
RajBy inserting a BREAK statement in the routine you won't be able to debugg as the upload process is done in background.
Instead you should insert a code like this:
data flag.
while flag ne 'X'. endwhile.
Then launch the process and go to transaction SM50 select the process and execute Program/Mode -> Program -> Debugging
Maybe you are looking for
-
Reversal process of return excise document
Dear all, My user has created and posted a return excise invoice. On posting it has created an excise invoice number and an accounting number. Now it is noticed that while processing the return excise he had manually inputed some wrong values manuall
-
HT1694 I have followed the instructions but my outlook calendar is not showing up on my iphone5
iphone5 I can't seem to get the outlook calendar to sync with my phone. I have followed the online instructions here but nothing is showing up on phone.???
-
I recently upgraded from iPhone 5s to iPhone 6 Plus. When I go to view my photos, all of them are blank and at the bottom, it says "Downloading..." It has been this way for two days, but hasn't really downloaded any of my photos yet. Does it normally
-
"404: No group with that name (wikigroupname) hosted on this server"
I am running 10.6.8 as our wiki server. After rebooting the server, one of the wiki group seems to be not accessible. When try to access the web page it gives error "404: No group with that name (wikigroupname) hosted on this server", though it still
-
Use iphone and imac bluetooth for talk through
I had this software called Bluephoneelite that allows you to connect your iphone to imac n make calls,save text messages etc etc. however, just wondering if anyone had other software that actually work with iphones bluetooth and able to make calls th