Problem in Submiting Background Job

Hi,
I am submitting a Program in Background  by using JOB_OPEN and SUBMIT Program and JOB_CLOSE.
After submiting Job was terminated with following log.
04/07/2009 11:34:05 Job started                                                                                00           516          S
04/07/2009 11:34:05 Step 001 started (program YSDU_CUSTOMER_DUP_CHECK, variant &0000000000002, user ID JAGASEK)      00           550          S
04/07/2009 11:34:05 Cannot perform frontend function in batch input mode                                             FES          002          E
04/07/2009 11:34:05 Job cancelled after system exception ERROR_MESSAGE                                               00           564          A
Please help me.
Thanks,
Sekhar.J

Hi sekhar J,
It looks to me like you may be calling a function from SFES (SAP FrontEnd Services) e.g. FM GUI_UPLOAD, these cannot be used in background mode for obvious reasons.  If the program is reading/writing a local file you will need to use a dataset on the application server instead.  If ths is the case there are plenty of posts cocerning datasets on sdn.
Regards,
Simon

Similar Messages

  • Submitting background jobs using an excecutable program

    Hi all
    Would anyone give an example program to submit jobs in background using job_open, job_submit, job_close F.M's,
    please dont give complex coded program,  easily understandable code with some useful comments will be apprecieated.
    Thanks

    Create a job using job_open
    Create your job with JOB_OPEN. The module returns a unique job
    number. Together with the jobname, this number identifies the
    job. Other parameters are available, but are not required.
    JOBNAME = 'Freely selectable name for the job(s) you create'.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    JOBNAME = JOBNAME
    IMPORTING
    JOBCOUNT = JOBNUMBER
    EXCEPTIONS
    CANT_CREATE_JOB = 01
    INVALID_JOB_DATA = 02
    JOBNAME_MISSING = 03
    OTHERS = 99.
    IF SY-SUBRC > 0.
    <Error processing>
    ENDIF.
    Adding job step
    Add a job step: ABAP program
    CALL FUNCTION 'JOB_SUBMIT'
    EXPORTING
    AUTHCKNAM = SY-UNAME " Runtime authorizations
    " user
    JOBCOUNT = JOBNUMBER " Value from JOB_OPEN
    JOBNAME = JOBNAME " Value from JOB_OPEN
    REPORT = 'REPORT' " Report to be run
    VARIANT = 'VARIANT' " Variant to use with
    " report
    PRIPARAMS = USER_PRINT_PARAMS " User printing options
    ARCPARAMS = USER_ARC_PARAMS " User archiving options
    " Both sets of options
    " come from
    " GET_PRINT_PARAMETERS
    EXCEPTIONS
    BAD_PRIPARAMS = 01
    INVALID_JOBDATA = 02
    JOBNAME_MISSING = 03
    JOB_NOTEX = 04
    JOB_SUBMIT_FAILED = 05
    LOCK_FAILED = 06
    PROGRAM_MISSING = 07
    PROG_ABAP_AND_EXTPG_SET = 08
    OTHERS = 99.
    IF SY-SUBRC > 0.
    <Error processing>
    ENDIF.
    **Closing job
    Submit job for processing: immediate start
    CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
    JOBCOUNT = JOBNUMBER " Job identification: number
    JOBNAME = JOBNAME " and name.
    STRTIMMED = 'X' " Schedules the job for
    " immediate start. The job
    " is started immediately
    " only if the user has the
    " RELE authorization to
    " release a job to run.
    IMPORTING
    JOB_WAS_RELEASED = JOB_RELEASED " If user has authorization
    " to release jobs to run, job
    " is automatically released
    " when it is scheduled. This
    " field is set to 'x' if the
    " job has been released.
    " Otherwise, the job is sche-
    " duled but must be released
    " by an administrator before
    " it can be started.
    EXCEPTIONS
    CANT_START_IMMEDIATE No longer used. Replaced by IMPORTING
    parameter JOB_WAS_RELEASED.
    INVALID_STARTDATE = 01
    JOBNAME_MISSING = 02
    JOB_CLOSE_FAILED = 03
    JOB_NOSTEPS = 04
    JOB_NOTEX = 05
    LOCK_FAILED = 06
    OTHERS = 99.
    IF SY-SUBRC > 0.
    <Error processing>
    ENDIF.
    *Please note it's not my original code..I have done what you could do!! Just visited help.sap.com and typed Background jobs and got sample codes..

  • Problem in VL04 Background job

    Hi Experts,
    When I enter the shipping points ,sales area ,office and other mandatory feild and execute in foreground the deliveries are shown.
    But when I do the execution in background .
    In the SM37 screen the job gets cancelled.
    The job log says :
    Job started
    Step 001 started (program RV50SBT1, variant &0000000000059, user ID E383327)
    Make an entry in all required fields
    Job cancelled after system exception ERROR_MESSAGE
    Fill in all required entry fields
    Please explain how can I run the delivery lists without errors &
    as there no incomplete procedure predefined in the VL04 screen what would be the possible solution.
    Can you please help to solve this out.
    Regards,
    Vijay.
    Edited by: Vijay sharma on Mar 11, 2008 3:55 PM

    But still am getting the same problem.
    Solution :
    In Systems - > User profile - > owndata - > Parameter(tab)
    Give LE_VL10_VL04_OLD(as Parameter ID) and 'X' (as Value )
    Regards,
    Vijay,
    Edited by: Vijay sharma on Apr 7, 2008 8:32 AM

  • Problem in RAR Background Jobs

    Hi Experts,
    We are facing a problem during Batch Risk Analysis-
    Batch Risk Parameters-
    System- RP1
    Options-
    User
    Role
    Profile, Critical Actions and Role/Profile Analysis
    Management reports
    User and Role permission Level risks analysis run fine, but at User Critical Analysis after 44% Systme is throwing an error-
    Error log-
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.bg.CriticalTcdRoleAnalysis deleteExistingData
    INFO: Job ID:371 Critical Role/Profile data deleted
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.riskanalysis.AnalysisEngine riskAnalysis
    INFO:  Job ID:371 : Exec Risk Analysis
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.riskanalysis.AnalysisEngine riskAnalysis
    WARNING:  Job ID:371 : Failed to run Risk Analysis
    com.virsa.cc.dataextractor.dao.DataExtractorException: Cannot extract data from system (ECC Production System); for more details, refer to ccappcomp.n.log
         at com.virsa.cc.dataextractor.bo.DataExtractorSAP.searchUser(DataExtractorSAP.java:551)
         at com.virsa.cc.dataextractor.bo.DataExtractorSAP.userIsIgnored(DataExtractorSAP.java:529)
         at com.virsa.cc.xsys.meng.MatchingEngine.matchCritRoleProf(MatchingEngine.java:1203)
         at com.virsa.cc.xsys.riskanalysis.AnalysisEngine.performCriticalRoleAnalysis(AnalysisEngine.java:3634)
         at com.virsa.cc.xsys.riskanalysis.AnalysisEngine.riskAnalysis(AnalysisEngine.java:320)
         at com.virsa.cc.xsys.bg.CriticalTcdRoleAnalysis.performBkgTcdAnalysis(CriticalTcdRoleAnalysis.java:244)
         at com.virsa.cc.xsys.bg.CriticalTcdRoleAnalysis.loadAnalysisResult(CriticalTcdRoleAnalysis.java:78)
         at com.virsa.cc.xsys.bg.BatchRiskAnalysis.performBatchSyncAndAnalysis(BatchRiskAnalysis.java:1407)
         at com.virsa.cc.xsys.bg.BgJob.runJob(BgJob.java:427)
         at com.virsa.cc.xsys.bg.BgJob.run(BgJob.java:284)
         at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.scheduleJob(AnalysisDaemonBgJob.java:249)
         at com.virsa.cc.xsys.riskanalysis.AnalysisDaemonBgJob.start(AnalysisDaemonBgJob.java:81)
         at com.virsa.cc.comp.BgJobInvokerView.wdDoModifyView(BgJobInvokerView.java:444)
         at com.virsa.cc.comp.wdp.InternalBgJobInvokerView.wdDoModifyView(InternalBgJobInvokerView.java:1236)
         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:321)
         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)
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.bg.CriticalTcdRoleAnalysis deleteExistingData
    INFO: Job ID:371 Critical Action data deleted
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.riskanalysis.AnalysisEngine riskAnalysis
    INFO:  Job ID:371 : Exec Risk Analysis
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.riskanalysis.AnalysisEngine performActPermAnalysis
    INFO:  Job ID:371 : Before Rules loading,  elapsed time: 0 ms
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.riskanalysis.AnalysisEngine performActPermAnalysis
    INFO:  Job ID:371 : Analysis starts: SUHAILS
    Jul 23, 2009 4:02:45 PM com.virsa.cc.xsys.meng.MatchingEngine matchActRisks
    WARNING:  Error :
    com.virsa.cc.dataextractor.dao.DataExtractorException: Cannot extract data from system (ECC Production System); for more details, refer to ccappcomp.n.log
    Have anyone experienced same issue? Please suggest what could be the reason and solution.
    Thanks,
    Sabita

    Hi, I had included this reply in another thread with relatively the same issue:
    In the Configuration tab (Additional Options), do you have "Enable Offline Risk Analysis" set to "Yes"?
    If yes, the error could occur because of updating the conflict permission details in the offline table VIRSA_CC_PRMVL. I believe this will occur in users who are assigned to big roles that contain lots of authorizations.
    As a test workaround, if you had set "Ignore Critical Roles & Profiles" to yes, you can enter those big roles into the list and run the batch risk analysis for only those users with errors.
    As another test workaround, If you had set "Consider Org Rules" to yes, set it to "No". After that, run again batch risk analysis for the users with errors.
    I agree it is not a direct solution to the problem (which I am also facing right now and dealing with SAP) but helps to identify where the problem is.
    Would be interesting to know what solution SAP had provided for your issue.

  • BackGround Job for Transaction VF06

    Hi Experts,
    We are having problems with the background Job for transaction VF06. We run this job every day except weekends but this job runs and takes only 0 sec without creating Invoices.
    Allthough running this transaction Manually creates Invoice with same variant.
    Kindly help me on this.
    Thanks and Regards,
    Neha Kapoor

    Hi,
    I have the seen the Log it tells:
    Date       Time     Message text                                                                 Message class Message no. Message type
    29.06.2008 22:00:48 Job started                                                                       00           516          S
    29.06.2008 22:00:48 Step 001 started (program RV60SBAT, variant SOIE AUTO BILL, user ID GGBATCH)      00           550          S
    29.06.2008 22:00:48 Job finished                                                                      00           517          S
    But Invoices are not getting created.
    Thanks and Regards,
    Neha Kapoor

  • Background job not invoking in CC.

    hi,
    I am facing a problem in running background job in CC. Actually its invoking a wrong url and when i am checking in application deployed url is different.
    We are at CC SP9.
    Url invoked is "is http://hostname:51700/webdynpro/dispatcher/virsa/ccappcomp/BgJobStart?daemonId=/usr/sap/FAP/DVEBMGS17/j2ee/cluster/server1/.&threadId=4&daemonType=WS
    As per deployment
    Url should be "http://chmsxp41.eame.syngenta.org:51700/webdynpro/dispatcher/sap.com/grc~ccappcomp/BgJobStart"
    Please suggest.
    Thanks & Regards,
    Pravin

    Please check SAP Note 999785.
    Somewhere between SP04 and SP06 the URL changed, and you need to re-configure that on database level (change "virsa/ccappcomp" to "sap.com/grc~ccappcomp").
    Frank.

  • Failure of background Job

    Hi Friends,
    i have created back ground job in R3 in order to load delta records from out bound Queue to Delta Queue.
    The frequeny is once in 24hours with my user id.
    This load is OK since few months, I never faced any problem with this background job.
    Suddenly i have observed that this job was failed yesterday and no further information in Job log.
    and today this job is OK.
    The point is yesterday my user id was locked due to some other reasons and today my id is OK.
    So, i am expecting the background job is failed due to locking of my user id. But i am not sure.
    any one please let me know if this is the reason.
    Thanks in Advance.
    Tony

    Hi,
    That is correct. If the user id gets locked or invalidated, the job is fail. In cases like these the best solution is to create a generic id and use that for job scheduling.
    Cheers,
    Kedar

  • How to delete Background job

    hi all,
    i am working on ECC6.0.
    i am not able to find the path to delete background job completly.
    can any body give me the navigation for the same in ECC6.0
    Thanks in advance

    hi
    hopen ths wll help
    To delete a background job explicitly, use:
    BP_JOB_SELECT to obtain the jobname and job number of the job that you wish to delete.
    You can select jobs according to all of the criteria available in the interactive background processing management system:
    Jobname: Using a well-planned naming convention for your jobs will help you to select them precisely.
    Job number
    Name of the user who scheduled a job
    Specifications for the start-time window/no start time scheduled
    Start dependent upon predecessor jobs
    Start dependent upon an event and event argument
    Job status (preliminary, scheduled, ready, running, finished, aborted).
    BP_JOB_DELETE to delete the job. The job log is deleted as well, if the job has already been run.
    A job cannot delete itself. Also, a job that is currently running cannot be deleted. However, you can have it deleted automatically if it is completed successfully. See the DELANFREP parameter of JOB_OPEN.
    Sample Program: Deleting a Background Job
    Data declarations: BP_JOB_SELECT
    DATA JSELECT LIKE BTCSELECT.
    DATA SEL_JOBLIST LIKE TBTCJOB OCCURS 100 WITH HEADER LINE.
    Sample selection criteria
    JSELECT-JOBNAME = 'Name of job'.
    JSELECT-USERNAME = SY-UNAME.
    CALL FUNCTION 'BP_JOB_SELECT'
    EXPORTING
    JOBSELECT_DIALOG = BTC_NO
    JOBSEL_PARAM_IN = JSELECT
    IMPORTING
    JOBSEL_PARAM_OUT = JSELECT
    TABLES
    JOBSELECT_JOBLIST = SEL_JOBLIST
    EXCEPTIONS NO_JOBS_FOUND = 1
    SELECTION_CANCELED = 2
    OTHERS = 99.
    In this example, the program loops over the internal table
    SEL_JOBLIST and deletes each of the jobs that was selected.
    Alternative: Have the user select the job to be deleted
    with BP_JOBLIST_PROCESSOR. For an example, please see
    Sample Program: Wait for Predecessor Job with JOB_CLOSE.
    LOOP AT SEL_JOBLIST.
    CALL FUNCTION 'BP_JOB_DELETE'
    EXPORTING
    FORCEDMODE = 'X'
    JOBNAME = SEL_JOBLIST-JOBNAME
    JOBCOUNT = SEL_JOBLIST-JOBCOUNT
    EXCEPTIONS
    OTHERS = 99.
    ENDLOOP. *
    FORCEDMODE deletes the job header even if other portions of the
    job cannot be deleted from the TemSe facility, where they are
    held.
    FORCEDMODE can be used without fear of causing problems in the
    System. Any TemSe problem that affects background jobs can be
    resolved directly in the TemSe system and does not require the
    job header.
    regards
    navjot
    reward if helpfull

  • 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 Martins

    Hello 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.

  • Problem with background job using SUBMIT under different user

    Hi All,
    I am submitting a background job under different user name. I am submitting this job by using JOB_OPEN , SUBMIT report and JOB_CLOSE. But submit statement is returning sy-subrc 8, becuase of this the job_close is failed. Can you please help me to solve this problem.
    Thanks in advance.
    Tjgupta

    Hi,
    The user is having all authorizations. is there any difference with user types?
    This user is having  user type " as communication data".
    Thanks,
    Tjgupta

  • Submitting a updates in a prog to a background job

    Hello everyone,
    I am generating a alv report with production orders.In the toolbar i created a button for updating data.When i select some production orders in the alv list and select the button then transaction co02 is called and some updates are done.I done that the updating by using bdc recording and the updates are working fine.
    But my problem is
    1. when the user selects the updates button in the toolbar these updates should take place via. a background job.
    2. Before submitting the background job the program needs to check if a version of a prog is running,the check should look for the prog name and the triggering user, if a match is found the user should receive a error message.
    3. If a match is not found then the background job should be scheduled immediately and should be created with a name of prog name and the triggering user.
    I need to these steps,can anyone please give me a sample code for this.
    Thank you.
    dp.

    The approach I would probably take for this would be:
    1. Write the records that need processing to a "Z" table from the ALV, and delete these back out (or mark as "done") once processed by the batch job.
    2. It is possible to check for a batch job name and its status, but I've usually found an easier and more reliable way is to use a lock object to check this e.g. you could use and existing object such as ESRDIRE with a dummy lock argument such as 'CO02_IS_LOCKED' .  The batch job should contain code to set the enqueue... if this enqueue fails it means another job / program is already processing the requests so this instance can stop, otherwise the batch program can continue the CO02 processing.  In other words, you are creating a doorway through which only one instance of the job can pass at a time.
    3. A couple of easy ways to do this are (a) event triggered jobs, wherein you define the job and have it fire up when an event is raised (e.g. by calling function BP_EVENT_RAISE) or (b) use the SIMPLE_BATCH_JOB_SUBMIT (which calls the JOB_OPEN, JOB_SUBMIT, JOB_CLOSE functions for you).
    Jonathan

  • Submitting a update in a porg to a background job?

    Hello everyone,
    I am generating a alv report with production orders.In the toolbar i created a button for updating data.When i select some production orders in the alv list and select the button then transaction co02 is called and some updates are done.I done that the updating by using bdc recording and the updates are working fine.
    But my problem is
    1. when the user selects the updates button in the toolbar these updates should take place via. a background job.
    2. Before submitting the background job the program needs to check if a version of a prog is running,the check should look for the prog name and the triggering user, if a match is found the user should receive a error message.
    3. If a match is not found then the background job should be scheduled immediately and should be created with a name of prog name and the triggering user.
    I need to these steps,can anyone please give me a sample code for this.
    Thank you.
    dp.

    The approach I would probably take for this would be:
    1. Write the records that need processing to a "Z" table from the ALV, and delete these back out (or mark as "done") once processed by the batch job.
    2. It is possible to check for a batch job name and its status, but I've usually found an easier and more reliable way is to use a lock object to check this e.g. you could use and existing object such as ESRDIRE with a dummy lock argument such as 'CO02_IS_LOCKED' .  The batch job should contain code to set the enqueue... if this enqueue fails it means another job / program is already processing the requests so this instance can stop, otherwise the batch program can continue the CO02 processing.  In other words, you are creating a doorway through which only one instance of the job can pass at a time.
    3. A couple of easy ways to do this are (a) event triggered jobs, wherein you define the job and have it fire up when an event is raised (e.g. by calling function BP_EVENT_RAISE) or (b) use the SIMPLE_BATCH_JOB_SUBMIT (which calls the JOB_OPEN, JOB_SUBMIT, JOB_CLOSE functions for you).
    Jonathan

  • Problems with background job

    Hi,
    I have problems when creating a job that is supposed to be run once in background. I use the common steps as described below. My problem is that the report is executed twice.
    - First it is executed synchronously when the job is created
    - Then it is executed in the normal job step as I want it to do
    I don't want it to be executed the first time because it creates data!!!
    Code:
    CALL FUNCTION 'JOB_OPEN'
         EXPORTING
              jobname  = w_jobid
         IMPORTING
              jobcount = w_jobnr
              sdlstrtdt = sy-datum
              sdlstrttm = sy-uzeit.
    SUBMIT (p_prog)
    WITH p_idocnr = p_idocno
               USER            p_user
               VIA   JOB       w_jobid
                     NUMBER  w_jobnr
                     AND       RETURN.
    CALL FUNCTION 'JOB_CLOSE'
         EXPORTING
              jobcount         = w_jobnr
              jobname          = w_jobid
              strtimmed        = 'X'
         IMPORTING
              job_was_released = w_jobrel.
    Does anyone have a clue of what I should do to prevent this?
    //  Regards  Hans

    Hi again,
    1. U are right.
    2. It will happen if we use SUBMIT.
    3. As per the help documentation,
        it will run the program in separate session,
       ( as soon as submit statement comes)
    4. and run the INITIALIZATION event.
    The VIA JOB addition also loads the program accessed in a separate internal mode when the SUBMIT statement is executed and the system performs all the steps specified before START-OF-SELECTION. This means the events LOAD-OF-PROGRAM and INITIALIZATION are triggered and selection screen processing is performed. If the selection screen is not processed in the background when VIA SELECTION-SCREEN is specified, the user of the calling program can eidit it and schedule the program accessed in the background request using the function Place in Job. If the user cancels selection screen processing, the program is not scheduled in the background job. In both cases, execution of the program executed is completed after selection screen processing and the system returns to the calling program due to the AND RETURN statement.
    regards,
    amit m.

  • Background job Problem

    Hi,
    I scheduled a Program for background job running for every 10 minutes.
    When i go to SM37  I am seeing all the background jobs, it is creating a newline for every 10 min in the list.
    my problem is , Is there any settings to change for showing only one job that means over writing the old job and show the latest job.
    Thanks in advance,
    fractal

    Assuming that intention is to monitor jobs that are either failed or active, you can deselect rest of the radio buttons at the selection screen so as to see failed / active jobs.
    Other than this, I dont think there is any solution / way to do this.

  • Problem related to Outbound Delivery creation via Background Job

    Hi ,
    We are using the program RVV50R10C for creating OBD incase of STO .
    Z variant is created to take care of selection parameters which inlcudes Shipping Point , Delivery creation date , Calc Rule, Delivery priority and shipping conditions.
    The job is scheduled to run for every 10 minutes .
    As planned the job is running for every 10 minutes but the OBD are created after 1 hour .
    What are possible causes of this error.?
    Please note that there exists enough stock.
    Regards
    Ramesh Ch

    I think you will have the same problem when doing it manually with VL10B.
    The creation is based on entries in an index. there is a userexit where you can influence how and when an entry goes into the index.  E.g. you can speed up the overall performance if you do not update the index all the time, instead you are doing this with a background job from time to time.
    Check if this is the case in your system.
    this note may give you some hints:
    Note 356061 - Incorrect index compilation caused by own checks

Maybe you are looking for

  • Photoshop Elements 9 question...Can you resize a photo to email smaller??

    I can not figure this out? I am new to Adobe and I can not figure out if you can resize to email the picture smaller? Any help would be greatly appreciated!!! Thanks Jennifer

  • Stops capturing after a few minutes

    FCut Express 4 importing firewire tape from camcorder. Final Cut stops capturing after a few minutes. Same problem if I use iMovie

  • XI Mail Adapter: Sending an XML attachment

    Hi I want to send an xml attachment using the XI Mail adapter. I have configured the adapter correctly and am currently receiving the email message. My issue is that my attachment has a .txt extention and I want it to have a .xml extn. I have seen a

  • Stop outlook from starting when clicking links in safari

    In the past I used to work with Outlook for Mac (my former company worked with Outlook). For a couple of years I switched to working with the Mac Agenda, Mail, Contacts, etcetera. But whenever there is a link in Safari for opening an agenda, or a con

  • How can i make 'hide toolbar' the default in finder

    Want to get rid of the Finder toolbar aka "Hide Toolbar" as the norm.  If it is a matter of turning the feature off completely and never seeing the side bar stuff and all the buttons, so be it. In short instead of this: I would like this for every wi