Creation of background job from SE38

hello all...
In the selection screen of my report program, there are two radiobuttons - read mode or update mode.
In read mode, the program reads an excel file and gives the output in teh form of errors, if at all, after some chekcs on this excel file.
In update mode, the program should check the excel file, get an internal table with errors from the excel file as well as run BDC for the correct records in excel file. So the output here has two blocks, first one - errors in excel file, second one - errors in BDC update.
But this update mode should run in background.
HOW TO CALL THE BACKGROUND JOB FROM THIS REPORT PROGRAMME when the update mode is selected??
Advance Thanks
omkar

Hi Vishal,
1. How are u running the BDC ?
2. If u are using call transaction syntax,
   then there is an extension to it.
    MODE mode
  (See help F1 on call transaction)
The processing mode can take the following values:
'A' Display screen
'E' Display only if an error occurs
'N' Do not display
'P' Do not display; debugging possible
3. We can use N
4. N means, it won't display any screens
   of that BDC transaction.
5. It does not exactly mean the BACKGROUND JOB
   generated thru sm36.
Regards,
Amit M.
Message was edited by: Amit Mittal

Similar Messages

  • 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

  • How to trigger a background job from BADI method.

    hi friends,
    i need to trigger a background job from the badi method CHANGE_AT_SAVE for the BADI BOM_UPDATE.
    for this i think i need to create an event which i should give with parameters during job creation.
    can you pls help me solve this issue.
    thank u all.

    Hi Saravanan,
    Here is an example of what you have to do.
    Regards,
    Eric
    Reward any helpful sugestion.
    *&      Form  generar_job
    FORM generar_job .
    Generar Variante
      PERFORM generar_variante.
      w_fecha = sy-datum + 3.
      CALL FUNCTION 'DATE_COMPUTE_DAY'
        EXPORTING
          date = w_fecha
        IMPORTING
          day  = w_weekday.
    Si la fecha cae en sabado o domingo se debe continuar el lunes.
      CASE w_weekday.
        when '1'.
          ADD 2 TO w_fecha.
        WHEN '6'.
          ADD 2 TO w_fecha.
        WHEN '7'.
          ADD 1 TO w_fecha.
      ENDCASE.
      w_jobname = 'ZQM_CIERRE_LOTE_INSPECCION'.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobgroup         = 'QUEUE'
          jobname          = w_jobname
        IMPORTING
          jobcount         = w_jobcount
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'JOB_SUBMIT'
          EXPORTING
            authcknam               = sy-uname
            jobcount                = w_jobcount
            jobname                 = w_jobname
            report                  = 'ZQM_CIERRE_LOTE_INSPECCION'
            variant                 = w_var
          IMPORTING
            step_number             = w_stepnum
          EXCEPTIONS
            bad_priparams           = 1
            bad_xpgflags            = 2
            invalid_jobdata         = 3
            jobname_missing         = 4
            job_notex               = 5
            job_submit_failed       = 6
            lock_failed             = 7
            program_missing         = 8
            prog_abap_and_extpg_set = 9
            OTHERS                  = 10.
        IF sy-subrc EQ 0.
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              jobcount             = w_jobcount
              jobname              = w_jobname
              sdlstrtdt            = w_fecha
              sdlstrttm            = w_hora
            IMPORTING
              job_was_released     = w_rel
            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 EQ 0.
            IF w_rel EQ 'X'.
              WRITE:/ w_jobname, 'FUE LIBERADO. VER SM37.'.
            Guardamos los destinatarios
              PERFORM destinatarios_job.
            Guardamos la información a utilizar al ejecutar el job
              PERFORM guardar_datos_job.
            ELSE.
              WRITE:/ w_jobname, 'NO FUE LIBERADO'.
            ENDIF.
          ELSE.
            WRITE:/ w_jobname, 'NO FUE CERRADO'.
          ENDIF.
        ELSE.
          WRITE:/ w_jobname, 'NO FUE ENVIADO'.
        ENDIF.
      ELSE.
        WRITE:/ w_jobname, 'NO FUE CREADO'.
      ENDIF.
    ENDFORM.                    " generar_job

  • Kicking off Background Job from Another SAP system

    Hi,
    Does anybody know how to kick off a background job from a separate SAP system?? 
    i.e I have a job on our CRM system that is dependant on a Job finishing from our ECC6 system first.
    Does anyone know how to do this?  I know I might be able to use events, is there anything else I should be making use of??
    Many Thanks

    Hi Daniel,
    Guess there is one more solution. In system A write a report (let us name it X) that would trigger a job in system B through an RFC call.
    Now in System A create a job with 2 steps. First step would be normal one, the second one for report X. Only when step 1 is over would step 2 start. So indirectly end of the existing Job A would trigger the required Job B.
    Regards.
    Ruchit.

  • Regarding Triggering the job from se38

    When i trigger a job from se38, i get a message saying " Event or Parameter has been raised on the server " can any one make me understand what does it mean.

    Hi
    SE38 functions are,
        Create variants
         Display variant directory
         Display and change values and attributes
         Copy, delete and rename variants.
    Find the link below,
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/67ee407552742ae10000000a155106/frameset.htm
    I think this will help you,
    Regards
    Sibvanand

  • Creating a Step for Background Job from within ABAP Program

    Step-1: I have a Report in ECC, which is scheduled as Background Job, which writes the file to the Application Server(UNIX)
    Step-2:  Trigger a Unix Command to ftp the file to other server.
    Both Step-1 & Step-2 can be done from SM36. 
    Another Scenario:
    Users can run the report in background from SE38 or using the transaction code for the report, In this case we want to call the external command.
    Instead of calling the External Command as below in the report, I want to create a Step from within the program when it is scheduled in background mode.
    CALL 'SYSTEM' ID 'COMMAND' FIELD lc_unixcom.    [ Here lc_unixcom has the External Command ].
    Any ideas??? Appreciate help.

    Hi,
    For submitting a report step, you may use either SUBMIT ... VIA JOB ... or JOB_SUBMIT function module.
    For external commands, this should be done only by calling JOB_SUBMIT function module.
    Sandra

  • Starting Background Job from program...

    Hello I am using following to create a background job.
      DATA: number TYPE tbtcjob-jobcount,
            name TYPE tbtcjob-jobname VALUE 'METZ: INVOICING FROM SHIPMENT',
            print_parameters TYPE pri_params.
      data vari  LIKE varid-variant.
      data shipm    LIKE vttk-tknum.
      data use  LIKE   btch2170-username.
      vari = '3350_1' .
      shipm = p_shipment.
      use = 'K5_BATCH'.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = name
        IMPORTING
          jobcount         = number
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
      IF sy-subrc = 0.
        SUBMIT Z5L_START_INVOICING with p_shipm = shipm
                                   with p_vari = vari
                                   with p_submit = 'X'
                                   USER use VIA JOB name NUMBER number
                                   and return.
        IF sy-subrc = 0.
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              jobcount             = number
              jobname              = name
              strtimmed            = 'X'
            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.
          ENDIF.
        ENDIF.
      ENDIF.
    I am using the addition USER but the job gets started with user who is log on or who is using this trasaction.
    It should start with user 'K5_BATCH' but it is not...........
    Please help........
    Edited by: Alvaro Tejada Galindo on Apr 7, 2008 1:00 PM

    I found the following info:
    Open Job Scheduling Without Dialog (Including COMMIT WORK)
    Use JOB_OPEN to create a background job.  The function module returns the unique ID number which, together with the job name, is required for identifying the job.
    Once you have "opened" a job, you can add job steps to it with JOB_SUBMIT and submit the job for processing with JOB_CLOSE.
    I think you will first have to use the JOB_SUBMIT  statement like mentioned above

  • Pass parameter to background job from report

    Hi All,
    I have following requirement.
    I am executing a Report. At end of report I am executing an event.
    On the bases of event a background job runs.
    Problem is that, I want to pass one field data from report to background job.
    I already tested SET PARAMETER/GET PARAMETER is not working.
    Is there any way any one can suggest, without using Tables.
    Regards

    Hi,
    If you submit via job it will not be executing the program ..After SUBMIT statement the control will come to the program immediately..
    Check this example..
    DATA: p_jobcnt LIKE tbtcjob-jobcount,
          l_release(1) TYPE c.
    Open the job
    CALL FUNCTION 'JOB_OPEN'
         EXPORTING
              jobname          = 'ZMY_OBJ'
         IMPORTING
              jobcount         = p_jobcnt
         EXCEPTIONS
              cant_create_job  = 1
              invalid_job_data = 2
              jobname_missing  = 3
              OTHERS           = 4.
    Submit the job.
    SUBMIT ztest_program VIA JOB 'ZMY_OBJ' NUMBER p_jobcnt
           TO SAP-SPOOL WITHOUT SPOOL DYNPRO
           WITH destination = 'LOCL'
           WITH immediately = space
           WITH keep_in_spool = 'X' AND RETURN.
    Close the job.
    CALL FUNCTION 'JOB_CLOSE'
         EXPORTING
              jobcount             = p_jobcnt
              jobname              = 'ZMY_OBJ'
              strtimmed            = 'X'
              prdmins              = 15
         IMPORTING
              job_was_released     = l_release.
    Thanks,
    Naren

  • How to Trigger a Job from se38 Report

    Hi,
    I need to trigger a job from an se38 report program.
    Currently the code I'm using is:
      SUBMIT YARTZ_SPOOL
             USER SY-UNAME
             VIA JOB 'YARTZ_JOB2'
             NUMBER 1
             TO SAP-SPOOL
             SPOOL PARAMETERS l_print_parms
             WITHOUT SPOOL DYNPRO
             AND RETURN.
    But the SY_SUBRC return I get is 8 which stands for 'Error In job Scheduling'
    Is the method used correct?
    Or am i going wrong in scheduling the job? As far as Job scheduling goes, I used the Date/Time schedule and scheduled it at a time 20 minutes later.
    Thanks.

    Hi,
    use the code
      IF p_bjob = 'X'.
        CONCATENATE sy-cprog sy-datum sy-uzeit
                    INTO jobname SEPARATED BY '_'.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname          = jobname
          IMPORTING
            jobcount         = jobcount
          EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            OTHERS           = 4.
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
          IMPORTING
            out_archive_parameters = arc_params
            out_parameters         = print_params
            valid                  = valid
          EXCEPTIONS
            archive_info_not_found = 1
            invalid_print_params   = 2
            invalid_archive_params = 3
            OTHERS                 = 4.
        IF valid = chk.
          SUBMIT YARTZ_SPOOL
                          WITH <selection-screen parameters if any>
                          AND RETURN
                          USER               sy-uname
                          VIA JOB            jobname
                          NUMBER             jobcount
                          TO SAP-SPOOL
                          SPOOL PARAMETERS   print_params
                          ARCHIVE PARAMETERS arc_params
                          WITHOUT SPOOL DYNPRO.
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              jobcount             = jobcount
              jobname              = jobname
              strtimmed            = 'X'
            EXCEPTIONS
              cant_start_immediate = 1
              invalid_startdate    = 2
              jobname_missing      = 3
              job_close_failed     = 4
              job_nosteps          = 5
              job_notex            = 6
              lock_failed          = 7
              invalid_target       = 8
              OTHERS               = 9.
          IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ELSE.
            MESSAGE i029 WITH jobname.
          ENDIF.
        ELSE.
          MESSAGE s000 WITH text-003.
          STOP.
        ENDIF.
      ENDIF.
    reward points if useful
    regards,
    Anji

  • Invoice creation by background job

    Hi experts,
    How to create invoices using a background job?
    Please provide the steps.
    Thanks

    Go to transaction VF06 - Background processing
    In the documents to be billed input the
    Sales orgn
    Dist channel
    Division
    shipping point
    In case you would like to further filter data, choose billing dates, billing types, customer data etc otherwise leave them blank
    Now from menu bar, select Program -> Execute in background
    Now, Print screen parameter screen opens
    click enter button
    Now, start time screen opens
    Select the appropriate button
    since you want to schedule a background job
    click date/time button and enter schedule start date and time information as per your requirement.

  • Different Subroutines in Background jobs and Dialog jobs

    Hi guys,
    I want to execute some subroutines when the program is running  using a background  job  , and some other subroutines completely different when the user use dialog job ( program -> execute in background ) . I know that sy-batch  = 'X'  in both cases  , but, there is something else to identify them ? , any ideas .
    thank you .

    It will be - he meant that they start the background job from SE38/SA38 not run it online.
    SY-SLSET is a starter point for checking the variant used - dynamic variants are used when you don't pick one from the list.  However, this would not help if the user picked a variant and then scheduled the job dynamically.  Another option is to use function GET_JOB_RUNTIME_INFO in your program.  Assuming your scheduled jobs are named differently, you can check for the condition by checking the name of the running job.  Dynamically created jobs will have the program name as the job name.

  • DP background job version value shows *to{q}ZsmfF*

    Hi,
    I am using DP background jobs in Mass processing. The Version field in the mass processing job displays value as "toZsmfF".
    I tried to change the version to 700 in transaction SAPAPO/MC8D. But the version field is disabled.
    I also tried after removing the DP background job from all the process chains where ever it was used. After that also the version field, planning book,data view are not active to change (greyed -unable to change). How can change the  version value in the DP background jobs.
    Thanks and regards
    Murugesan

    This is becasue the DP job executed without initializing the planning area for the version. Created new job with differenet name and assigned with version.

  • Importing background jobs

    Is there a way to import SAP background jobs from one client to another? In SM37, there ia an option to export the job, but I don't see an option to import it.
    Thanks

    Hi,
    The 'export' option you see is just a possibility to export to Excel the table of jobs in the selection.
    Regards,
    Eli

  • Custom Background Job Cancelling

    Hi Folks,
    I'm working on a custom development and I'm experiencing some trouble - I would greatly appreciate any help / effort from anyone in providing me with some ideas as to what the cause may be.
    Basically my development is made up of two parts - Part 1) A custom RFC used to trigger a custom program in the background - here i'm using job_open / submit program / job_close. This works fine and a job is successfully created to run the custom program
    Part 2) - The custom program, running in the background job tries to create a background job  to trigger standard program (f.05) with a variant. Again using job_open / submit program / job_close. However on this occassion when the second background job starts it cancels immediately -  stating "Make an entry in all required fields". . However the variant is fine and all the parameters for the standard program are filled. I can even trigger this program and variant seperately and it works.
    Are there conflicts in creating a background job from a background job ? I'm confused as to why this is not working and i would appreciate any help or ideas anyone could give me on this.
    Thanks alot for your time.
    Regards
    DK
    Overview
    RFC -> Create Background Job # 1 -> Background Job # 1 created successfully - Custom program running in Background Job # 1 tries to run standard program in backgroun - Background Job # 2 created successfully but immediately cancels - Job log message - "Make an entry in all required fields". Job cancelled after system exception ERROR_MESSAGE.

    Hi Guys,
    Thanks for your answers. The job log does say "Make an entry in all required fields" - but all the required fields are specified under the variant. I can even run this program with the same variant with no problems. I'm wondering what would affect the submit to program to prevent it passing the variant correctly - here is my submit
        SUBMIT sapf100 VIA JOB l_jobnam NUMBER l_jobcnt
        USING SELECTION-SET l_vari
        AND RETURN.
    l_vari = Variant Name
    l_jobname = job name
    l_jobcnt  = job count
    here is the message from the job log. your help is appreciated - thanks
    10.09.2009 14:22:18 Job started                                                             
    10.09.2009 14:22:18 Step 001 started (program SAPF100, variant &0000000000018, user ID XXXX)
    10.09.2009 14:22:18 Make an entry in all required fields                                    
    10.09.2009 14:22:18 Job cancelled after system exception ERROR_MESSAGE

  • RFC to cancel background job

    I need to cancel a background job from running by using a Remote Function Call.  Can anyone provide an example of an RFC for this?  Ideally, it would cancel all jobs owned by a certain user.

    BAPI_XBP_JOB_ABORT wants the JOBCOUNT as well as the JOBNAME.  How can I get the JOBCOUNT?  I don't believe there is a way to capture the ID from the external application kicking off the SAP job.

Maybe you are looking for