Error in active background jobs

Hi All,
i facing problem while cosing the job
i have written the code
      IF NOT p_imm IS INITIAL.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = l_f_jobcount
            jobname              = l_f_jobname
            strtimmed            = l_flg_start_sofort
          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.
COMMIT WORK .
and it is not showing any error and it should finished the job in sm37 but i am always getting the ststus active rather than finished.
please suggest what could be the reason
Thanks,
Madhu

hi all,
please help me on this..
when there is no data then background job finish the job and in the job log it shows thst no valid data for selection. but if there si any data ... the job status stil active and it never get finished.... and finaly it get cancelled.
even while dubugging it never shows sy-subrc value other than 0. even when i run the background job manually for the submit sdt program it finish the job. I don't understand the reason why it is in active stage while executing id dialog.
Please mention if there is any parameter value missing ..
my code as follows..
do n times.  "n muber of jobs
Start Immediately
      IF NOT p_imm IS INITIAL.
l_flg_start_sofort = 'X'.
(1)Open the job
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = l_f_jobname
        IMPORTING
          jobcount         = l_f_jobcount
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
      IF sy-subrc <> 0.
        MESSAGE e032(sxmsf) WITH l_f_jobname.
      ENDIF.
(2)Report start under job name
      SUBMIT (g_c_prog_c1_lo)
             WITH s_partn IN r_partn
             WITH s_parro IN s_parro
             WITH s_grvsy IN s_grvsy
             WITH s_lgreg IN s_lgreg
             WITH p_updab = p_updab
             WITH p_updbi = p_updbi
             WITH p_enqal = p_enqal
             TO SAP-SPOOL WITHOUT SPOOL DYNPRO
             VIA JOB l_f_jobname NUMBER l_f_jobcount AND RETURN.
*(3)Job closed when starts Immediately
      IF NOT p_imm IS INITIAL.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = l_f_jobcount
            jobname              = l_f_jobname
            strtimmed            = l_flg_start_sofort
          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.
      COMMIT WORK .
      ADD 1 TO g_cnt_job.
      l_r_tbtcjob-jobcount = l_f_jobcount.
      l_r_tbtcjob-jobname = l_f_jobname.
      l_r_tbtcjob_previous = l_r_tbtcjob.
      IF NOT l_flg_first_job IS INITIAL.
        g_v_tbtcjob_first = l_r_tbtcjob.
      ENDIF.
      CLEAR: l_flg_first_job.
    ENDDO.
thanks

Similar Messages

  • Internal error occurs in background job scheduling

    Hi Experts,
    We are facing an error message "Internal error occurs in background job scheduling" while trying to execute a custom report(Z report) in background in SA38.
    Please find the following observation on our side on this message.
    1) This message is not coming for only one report not for others.
    2) SU53 screen shot shows that SE38 check is failed, but the weird thing is not happening for other report.
    3) Persons having SE38 auhtorization are able to run this report.
    Please advise.
    Thanks in advance,
    Viven

    What is the message ID and number? Have you tried OSS search and debugging?
    What does this program do, in a nutshell?

  • Error in triggering background job

    HI, I've been facing an error which a background job is being scheduled. The scenario is something like this ...
    1) A third party schedulling system triggers a SAP job and monitors the progress
    2) In SAP, the master job is been copied with a different user name and then released for processing.
    3) There are multiple jobs which get triggered but there is one job which is causing a problem.
    4) The job makes a copy an stays in a scheduled status without getting released. While i try to manually release the job it give me an error that cannot create record in the database.
    5) Upon checking the system log it gives me this -  Error: INSERT background sched. table(job $$$$).
    There is already an entry for the specified job in the table TBTCS.
    6) While checking the TBTCS table i've found multiple entries out there. Should this table be empty or have information about the runtime of this job.
    Please help as this background job is causing concerns in archiving processess defined.
    Thankx in advance for your help.
    Arvind.

    the earlier problem of background job was solved by changing the  output device assigned to user wf-batch .
    regarding the transport request :
    when i was trying to execute the step : "Schedule bakgrd for missed deadlines " MANUEL it was giving me an option of SAVE AND SCHEDULE . which was creating the transport request . but when i executed it automatically it worked fine without asking a request to me ... i don't know why )-: ... probablly we can specify a different interval then the standard of three minutes and which will be transported (it's just a guess) . i have  executed it  automatically ...
    well thanks all for u r help

  • How to stop Active Background Jobs

    Hi All,
    We have some immediate hotfix to be applied during which there should not be any background job running. At the same time, we don't want to kill the processes forcibly.
    Is there any other way to pause/stop the active background jobs and enable later to run where it has been paused/stopped?
    Thanks
    Vijay

    Hi,
    I knew these reports to suspend/release scheduled jobs.
    So, do we need to wait until the jobs are complete? This should not be the case, as there might be some other jobs which will start while we wait for the existing job to complete.
    Any other thoughts.
    Thanks
    Vijay

  • Error while scheduling Background Job for User/Role Full Synchronization

    Hi all,
    We have installed RAR 5.3 Component and uploaded the authorization data & established the connectors to the backend system.
    We have performed all the post installation activities and everything is complete.
    When we have scheduled User -Full Synchronization with the Back End system as  a part of Post Installation Activity we are receiving the below error message
    "Error while executing the Job:Cannot assign an empty string to host variable 2."
    Also the VIEW LOG/ Terminate Job buttons are disabled  in this screen.
    Can somebody please help us in resolving the above issue
    Thanks and Best Regards,
    Srihari.K

    Hi,
    We are copy pasting the error log (Part as it is huge) below here. We could able to do Full Synch for Roles and also for Profiles. Only for User Synch we are getting this error and none of the users are sychronized to RAR
    Jan 13, 2009 12:34:27 AM com.virsa.cscext.dao.CSCDAO populateGenObjUser
    INFO: Update user WILSONA of HL2-QAHR
    Jan 13, 2009 12:34:27 AM com.virsa.cscext.dao.CSCDAO populateGenObjUser
    INFO: Update user WINDC of HL2-QAHR
    Jan 13, 2009 12:34:27 AM com.virsa.cscext.dao.CSCDAO populateGenObjUser
    INFO: Update user WLADICHJ of HL2-QAHR
    Jan 13, 2009 12:34:27 AM com.virsa.cscext.dao.CSCDAO populateGenObjUser
    INFO: Update user WUK of HL2-QAHR
    Jan 13, 2009 12:34:27 AM com.virsa.cscext.dao.CSCDAO populateGenObjUser
    INFO: Update user ZENGS of HL2-QAHR
    Jan 13, 2009 12:34:27 AM com.virsa.cscext.dao.CSCDAO populateGenObjUser
    INFO: Update user ZHENGL of HL2-QAHR
    Jan 13, 2009 12:34:27 AM com.virsa.cscext.dao.CSCDAO populateGenObjUser
    INFO: All System Flag:false=====Last Batch Flag:true
    Jan 13, 2009 12:34:27 AM com.virsa.cc.xsys.bg.BatchRiskAnalysis loadUserData
    INFO: @@@ User sync completed for params true: Syskey List is [HL2-QAHR]
    Jan 13, 2009 12:34:27 AM com.virsa.cc.xsys.bg.BgJob run
    WARNING: *** Job Exception: Cannot assign an empty string to host variable 2.
    com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 2.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.types.VarcharResultColumn.setString(VarcharResultColumn.java:57)
         at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:511)
         at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:355)
         at com.virsa.cscext.dao.CSCDAO.updateIgnoredUserData(CSCDAO.java:1388)
         at com.virsa.cscext.dao.CSCDAO.populateGenObjUser(CSCDAO.java:1169)
         at com.virsa.cc.xsys.bg.BatchRiskAnalysis.populateGenObj(BatchRiskAnalysis.java:868)
         at com.virsa.cc.xsys.bg.BatchRiskAnalysis.insertBAPIUserData(BatchRiskAnalysis.java:142)
         at com.virsa.cc.xsys.bg.BatchRiskAnalysis.loadUserData(BatchRiskAnalysis.java:390)
         at com.virsa.cc.xsys.bg.BatchRiskAnalysis.performBatchSyncAndAnalysis(BatchRiskAnalysis.java:1275)
         at com.virsa.cc.xsys.bg.BgJob.runJob(BgJob.java:402)
         at com.virsa.cc.xsys.bg.BgJob.run(BgJob.java:264)
         at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.scheduleJob(AnalysisDaemonBgJob.java:240)
         at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.start(AnalysisDaemonBgJob.java:80)
         at com.virsa.cc.comp.BgJobInvokerView.wdDoModifyView(BgJobInvokerView.java:436)
         at com.virsa.cc.comp.wdp.InternalBgJobInvokerView.wdDoModifyView(InternalBgJobInvokerView.java:1225)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
         at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:319)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Jan 13, 2009 12:34:27 AM com.virsa.cc.xsys.bg.BgJob setStatus
    INFO: Job ID: 13 Status: Error
    Jan 13, 2009 12:34:27 AM com.virsa.cc.xsys.bg.BgJob updateJobHistory
    FINEST: --- @@@@@@@@@@@ Updating the Job History -
    2@@Msg is Error while executing the Job:Cannot assign an empty string to host variable 2.
    Jan 13, 2009 12:34:27 AM com.virsa.cc.xsys.bg.dao.BgJobHistoryDAO insert
    INFO: -
    Background Job History: job id=13, status=2, message=Error while executing the Job:Cannot assign an empty string to host variable 2.
    Jan 13, 2009 12:34:27 AM com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob scheduleJob
    INFO: -
    Complted Job =>13----
    Please let us know how to resolve this error
    Thanks and Best Regards,
    Srihari.K

  • Error in Schedule Background Job for Deadline Monitoring of swu3

    While Auto Customization swu3 i am getting error message 'Output device "" not known' in 'Schedule Background Job for Deadline Monitoring'
    Please advice what could be cause of it

    the earlier problem of background job was solved by changing the  output device assigned to user wf-batch .
    regarding the transport request :
    when i was trying to execute the step : "Schedule bakgrd for missed deadlines " MANUEL it was giving me an option of SAVE AND SCHEDULE . which was creating the transport request . but when i executed it automatically it worked fine without asking a request to me ... i don't know why )-: ... probablly we can specify a different interval then the standard of three minutes and which will be transported (it's just a guess) . i have  executed it  automatically ...
    well thanks all for u r help

  • Write the Error log from background Job to the Spool request

    Hi ,
    I have a situation where in i need to capture the error log of a Z program which runs as a background job and write that log into the spool request. My Z program calls runs RSEINB00 program using the SUBMIT statement. When this Job fails the error log can be seen in SM37. But i need this error log to be sent in to a spool.
    I can read the error log using the BP_JOBLOG_READ FM and can also create a spool using the RSPO_SPOOL_OPEN FM.
    The problem is, when the Submit statement executes, due to internal valdation in the RSEINB00 program the program terminates. Due to this it is not able to perform the SY-SUBRC Check and thus doesn't read the log.
    Can anybody suggest me how to overcome this problem. I am attaching the code for your refernece.
    SUBMIT RSEINB00
           USING SELECTION-SET 'TEST2'
                           TO SAP-SPOOL
                           LIST NAME 'LOCL'
                           IMMEDIATELY space
                           KEEP IN SPOOL 'X'
           AND RETURN.
    <b>If sy-subrc <> 0.</b>           
                 CALL FUNCTION 'BP_JOBLOG_READ'
                  EXPORTING
                    CLIENT                      = SY-MANDT
                    JOBCOUNT                    = i_tbtco-jobcount
                    JOBLOG                      = i_tbtco-joblog
                    JOBNAME                     = i_tbtco-jobname
                   TABLES
                     JOBLOGTBL                   = l_joblog
                 IF SY-SUBRC <> 0.
                 else.
                    message i002 with l_joblog-msgv1.
                 ENDIF.
    <b>
    ENDIF.</b>
    Rgds,
    Kewal
    P.S. : any other approach to solve this problem will be appreciated too and the points will be rewarded suitably.

    If I select a job in SM37 and I click on "spool" I get a list with separate spool entries for each of the steps, e. g.
    Programmname/Kommand   Programmtyp   Spoolliste
    Z_MM_STAT_UPDATE_WERK  ABAP             1707445
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_WERK  ABAP             1707459
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_MARA  ABAP             1721423
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_WERK  ABAP             1721437
    Z_MM_STAT_UPDATE_MARA  ABAP             1721446
    Z_MM_STAT_UPDATE_WERK  ABAP             1721447
    Z_MM_STAT_UPDATE_VKORG ABAP             1721471
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_VKORG ABAP             1721521
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_VKORG ABAP             1721816
    It's in German but I'm sure you get the idea. For each Z_MM_STAT_UPDATE and variant I have a separate spool list that I can display.
    Markus

  • How to Cancel a ACTIVE background Job scheduled in SM37.

    Hi Friends,
    I have scheduled a Background job. The job is ACTIVE now. How can I cancel this job?
    Regards,
    Viji

    There is a last ditch method for jobs that don't get canceled for some reason or the other
    Go to SM50 - first try canceling the job from there
    If that doesn't work, note down the Process ID (PID) of the job
    Take direct OS access to your system (You would need your Basis person for this) and terminate the job
    If the server is Windows based, you can end it using the task manager and end that process id

  • Error messege in Background Job(SM37) -  Please enter a valid date

    Hi all,
    background job which is scheduled in sm37 is giving error for dated 01.01.2009 to 30.01.2009.
    But before 31.12.2008 it was working fine
    error messege-
    This is happening in Production and developement  client.
    While running the report it showing the error messege- Please enter a valid date
    One function module is used in the report for geting fiscal year from date.
    it is showing the following error messege for perticular date range- 01.01.2009 to 30.01.2009.
    GM_GET_FISCAL_YEAR
    Error
    Fiscal year variant V3 not defined or maintained for date 01.01.2009
    Thanks
    Susanta

    Hi,Because this datein the past

  • ODS Activation - Background Job in SM37 is still active

    Hello Gurus,
    When I try to activate an ODS Request, the START button is disabled. Then when I select JOBS button on the same screen, it shows the previous ODS activation job with ACTIVE status. But the previous job is already showing as ready for reporting with no problems. Is there any setting where the START button is enabled after the completion of the background job
    Thanks in advance

    Hi,
    There is no setting to enable to START button , it will be enabled automatically once the activation job is completed. Did you check if the activation job that was running was for the latest request? You can check this by looking into the job log where the request ID will be available. Sometimes even if the activation job is running in the background, the request in the ODS will still be in green status-not available for reporting and you tend to think that the activation has not started or the activation for the previous request is still running.
    First check the request ID in the job log to ensure which request is being activated and if the activation is completed. After this you can either stop the job or let it run based on the situation.
    Regards,
    Shilpa

  • Error handling in background jobs

    Dear All,
    I have a program to update certain tables which I schedule as a background job.
    I need to find a way to handle errors and communicate the update status to the administrator/ job monitor.
    Some of the methods I can think of are:
    1. Use write statements in the program to write the status. Admin/ Job monitor can look up the job spool in SM37 and get the status.
    2. Store the status against each updated table in a custom table. Admin / Job monitor can check thru SE16.
    Is there any other way to communicate the job status.
    Thanks and Regards,

    I used the option :
    Use write statements in the program to write the status. Admin/ Job monitor can look up the job spool in SM37 and get the status. The same has been implemented in production by now.
    Cheers.
    Ashwin

  • ORA-20000 error when executing background jobs in BI System

    Hello Experts,
    We newly installed NW2004s System. Few BI related background jobs are showing Error no: 4 or Error no: 3 in SM50. Also few BI related background jobs are giving error "ORA-20000 occurred when executing SQL statement (parse error offset=0)". Please let me know what does Error 4 or 3 mean in SM50 and how to resolve Ora-20000 error?
    Thanks

    This may be to do with insufficient authorization for the user (for creating statistics for example). Check OSS note 963760.

  • Error occured in background job......

    Hi,
    SUDDENLY ALL THE BACK GROUND JOBS  STATUS  ARE SHOWING CANCELLED. WHAT CAN BE REASONS?
    ashutosh

    sir,
    Actually what happend,  all background job  automatic   showing their status been canceld due to unknow problem.
    what's should be the reasons?
    ASHUTOSH

  • Error in TLB background job"Version does not exist"

    Hi Gurus,
    We are getting error of "Version does not exist " in TLB background run..The T-lane is between 2 DCs .we have checked everything but unfortunately
    we are not able to detect the root cause for the error.
    Your help will be appreciated.
    Thanks in advance
    Suyash

    Hi Suyash,
    I hope than your planning version is active!
    I also suppose than you have maintained mean of transport and products at Tr.Lanes level. 
    I think that you have some master data inconsistency in the version.
    Please run the reports; /SAPAPO/OM17, /SAPAPO/TSCONS, /SAPAPO/TSLCREORGSNP
    You can also run Model Consistency check (t.code /SAPAPO/CONSCHK). First you have to define the Model (t.code /SAPAPO/SCC07) and the Profile (t.code /SAPAPO/CONSPRF).
    Thanks, Marius

  • Print error scheduling a background job

    HI
    I am using
    Transaction F110 – Automatic Payment.
    When I am scheduling job for printing in background,I am getting error
    The error <Status Text in spool > states front end unavailable.
    Any inputs asap pls

    You are getting the error because, the printer selected to print the output trying to use front end default printer. You might have selected LOCL as the printer. Chage the printer.
    Regards
    Sridhar

Maybe you are looking for

  • When I go into password and security and I click I forgot my answers it doesn't work

    I try to buy something and it says I have to answer my security questions before I can proceed since I havn't used iTunes on this computer. First off, I have for 2 years already so that makes no sense.. and second of all, I made this account like 6 y

  • LCD Screen Issues

    So my old laptop died last year after four years of faithful service, in spite of being treated as no laptop should. Since I'd had it for so long, my family got me a (pre-used) new one. Since my old one had been treated like crap, I was determined to

  • Has anyone had a problem installing IOS8 on an I pad mine has just jammed up cannot do anything with it.

    I have an Ipad 2 and just tried updating to IOS8 but after 1 hour it is not doing anything anyone else had a problem

  • Site showing nothing but index?

    Hi, When I was in college I used Dreamweaver in CS3 to build my website. I let my site sort of lie fallow for years and now I'm having to update it, but I barely remember how to use Dreamweaver at all. For some reason when I tried to update my site,

  • Flash Player and Snow Leopard

    Have 10.6.1 installed. Websites w/video (i.e. YouTube , ESPN) freeze up my browsers (FireFox and Safari). Hearing that it may have something to do with the internet plug-ins, specifically the flash player. All worked when 10.6.1 was first installed.