Is it possible to delete a running background job programatically?

Hi Gurus,
is it possible to delete a running background job programatically? if yes how can we do that?
Thanks in advance

Or as sais by Sandeep you can use that fm.
Before calling that select the required data from table TBTCO and pass to the fm.

Similar Messages

  • Alv show in report but when see in spool (after run background job) there i

    my program have some error when i run result alv show in report but when see in spool (after run background job) there is no data, (other program can see result in spool)
    Please help
    here is some example of my program
    ********************************declare internal table*****************************
    internal table output for BDC
    data : begin of t_output occurs 0,
    bukrs type anla-bukrs,
    anln1 type anla-anln1,
    anln2 type anla-anln2,
    zugdt type anla-zugdt,
    result(70) type c,
    end of t_output.
    *****get data from loop********************************
      loop at t_anla.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = t_anla-anln1
             IMPORTING
                  OUTPUT = t_anla-anln1.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = t_anla-anln2
             IMPORTING
                  OUTPUT = t_anla-anln2.
    check record is correct or not
        select single bukrs anln1 anln2 zugdt
        into w_output
        from anla
        where bukrs = t_anla-bukrs and
        anln1 = t_anla-anln1 and
        anln2 = t_anla-anln2
       zugdt = '00000000'
    if record is correct
        if sy-subrc = 0 and w_output-zugdt = '00000000'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Yes : this asset can delete'.
          append w_output to t_output.
    if record is not correct
        elseif sy-subrc = 0 and w_output-zugdt <> '00000000'.
    there is error record  this asset have value already
          v_have_error = 'X'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Error : this asset have value already'.
          append w_output to t_output.
        else.
    there is error record this asset donot exist in table anla
          v_have_error = 'X'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Error : this asset doest not exist'.
          append w_output to t_output.
        endif.
    *end of check record is correct or not
        clear w_output.
      endloop.
    ******************************show data in ALV***************************************************
    show data from file in ALV
      perform display_report_ALV.
    *&      Form  display_report_ALV
    form display_report_ALV.
      DATA: LT_FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV,
          LT_EVENTS TYPE SLIS_T_EVENT,
          LV_REPID LIKE SY-REPID.
      PERFORM ALV_DEFINE_FIELD_CAT USING LT_FIELD_CAT.
      PERFORM ALV_HEADER_BUILD USING T_LIST_TOP_OF_PAGE[].
      PERFORM ALV_EVENTTAB_BUILD USING LT_EVENTS[].
      LV_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = LV_REPID
                IT_FIELDCAT        = LT_FIELD_CAT
                I_SAVE             = 'A'
                IT_EVENTS          = LT_EVENTS[]
           TABLES
                T_OUTTAB           = t_output
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
      IF SY-SUBRC NE 0.
        WRITE: / 'Return Code : ', SY-SUBRC,
          'from FUNCTION REUSE_ALV_GRID_DISPLAY'.
      ENDIF.
    endform.
    *&      Form  alv_define_field_cat
          text
         -->P_LT_FIELD_CAT  text
    FORM ALV_DEFINE_FIELD_CAT USING  TB_FCAT TYPE SLIS_T_FIELDCAT_ALV.
      DATA: WA_FIELDCAT LIKE LINE OF TB_FCAT,
        LV_COL_POS TYPE I.
      DEFINE FIELD_CAT.
        CLEAR WA_FIELDCAT.
        ADD 1 TO LV_COL_POS.
        WA_FIELDCAT-FIELDNAME = &1.
        WA_FIELDCAT-REF_TABNAME = &2.
        WA_FIELDCAT-COL_POS = LV_COL_POS.
        WA_FIELDCAT-KEY = &3.
        WA_FIELDCAT-NO_OUT = &4.
        WA_FIELDCAT-REF_FIELDNAME = &5.
        WA_FIELDCAT-DDICTXT = 'M'.
        IF NOT &6 IS INITIAL.
          WA_FIELDCAT-SELTEXT_L = &6.
          WA_FIELDCAT-SELTEXT_M = &6.
          WA_FIELDCAT-SELTEXT_S = &6.
        ENDIF.
        WA_FIELDCAT-DO_SUM = &7.
        WA_FIELDCAT-OUTPUTLEN = &8.
        APPEND WA_FIELDCAT TO TB_FCAT.
      END-OF-DEFINITION.
      FIELD_CAT  'BUKRS'  'ANLA'     'X' '' 'BUKRS' 'Company Code' '' ''.
      FIELD_CAT  'ANLN1'  'ANLA'     'X' '' 'ANLN1' 'Asset Number' '' ''.
      FIELD_CAT  'ANLN2'  'ANLA'     'X' '' 'ANLN2' 'Asset Sub Number' '' ''.
    FIELD_CAT  'ATEXT'   'T5EAE'     'X' '' 'ATEXT' 'Result' '' ''.
      FIELD_CAT  'RESULT'  ''     'X' '' 'RESULT' 'RESULT' '' ''.
    ENDFORM.                    " alv_define_field_cat

    Hi,
    Check this code..
    FORM display_report_alv.
      DATA: lt_field_cat TYPE slis_t_fieldcat_alv,
      lt_events TYPE slis_t_event,
      lv_repid LIKE sy-repid.
      PERFORM alv_define_field_cat USING lt_field_cat.
      PERFORM alv_header_build USING t_list_top_of_page[].
      PERFORM alv_eventtab_build USING lt_events[].
      lv_repid = sy-repid.
      IF sy-batch EQ 'X'.  ----> " System Field for Backgroud..if Background use list display
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program = lv_repid
            it_fieldcat        = lt_field_cat
            i_save             = 'A'
            it_events          = lt_events[]
          TABLES
            t_outtab           = t_output
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
      ELSE.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = lv_repid
            it_fieldcat        = lt_field_cat
            i_save             = 'A'
            it_events          = lt_events[]
          TABLES
            t_outtab           = t_output
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
      ENDIF.
      IF sy-subrc NE 0.
        WRITE: / 'Return Code : ', sy-subrc,
        'from FUNCTION REUSE_ALV_GRID_DISPLAY'.
      ENDIF.
    ENDFORM.                    "display_report_ALV

  • Alert monitor for long running background jobs

    Hello,
    I have to configure an alert moniter for long running background jobs which are running more than 20000 secs using rule based. I have created a rule based MTE and assigend MTE class CCMS_GET_MTE_BY_CLASS to virtual node but i dont find a node to specify the time.
    could any one guide me how can i do this.
    Thanks,
    Kasi

    Hi *,
    I think the missing bit is where to set the maximum runtime. The runtime is set in the collection method and not the MTE class.
    process:  rz20 --> SAP CCMS Technical Expert Monitors --> All Contexts on local application server --> background --> long-running jobs. Click on 'Jobs over Runtime Limits' then properties, click the methods tab then double click 'CCMS_LONGRUNNING_JOB_COLLECT', in the parameters tab you can then set the maximum runtime.
    If you need to monitor specific jobs, follow the process (http://help.sap.com/saphelp_nw70/helpdata/en/1d/ab3207b610e3408fff44d6b1de15e6/content.htm) to create the rule based monitor, then follow this process to set the runtime.
    Hope this helps.
    Regards,
    Riyaan.
    Edited by: Riyaan Mahri on Oct 22, 2009 5:07 PM
    Edited by: Riyaan Mahri on Oct 22, 2009 5:08 PM

  • How To Run Background Job on Specific Date of Every Month

    Hi,
    I am looking for an option there we can Run Background job On Specific Date!
    Example: Task Name: Zprg1 > each month of "18", and same I want to repeat after 3 Days means on "22", then want to repeat after 5 days means on "28"
    please suggest.

    Hi swapZ,
    this is very easy:
    1. Schedule the Job Zprg1 on the 18th of this month and enter a mothly period:
    2. copy this job to new name  Zprg1_plus3 and repeate the action of point 1 with the date 22.04.2015.
    3. copy this job to new name  Zprg1_plus5 and repeate the action of point 1 with the date 28.04.2015.
    You will get thre jobs running every month on 18. 22. and 28.
    Best regards
    Willi Eimler

  • Schedule background job programatically

    Hi,
    I want to schedule background job programatically  .
    Also, I want to specify the scheduled start time & start date .
    Please suggest .
    Moderator message - This question has been asked and answered many times before. Please search before posting.
    Edited by: Rob Burbank on Apr 16, 2009 12:27 PM

    Hi
    Please check this link
    [http://help.sap.com/saphelp_46c/helpdata/en/fa/096ee5543b11d1898e0000e8322d00/frameset.htm]
    Thanks,
    Hari

  • SQL error "-911" while running background job

    Hi Experts,
        We are getting the below runtime error while a background job is run.
    SQL error "-911" when accessing table "DD02L".
    Error Text of the Database: "SQL0911N The current transaction has been rolled 
      back because of a deadlock or timeout. Reason code "2". SQLSTATE=40001 row=1"
    The error is happening at a delete statement.
    Please let me know what might be the reason of this error and how this can be resolved.
    Thanks,
    Jissa.

    Hi,
    The system is taking very long for processing delete statement.
    can u send me ur code, so based on that i will give u some idea.
    Ram.

  • Running background job with class type "A"

    Hi All,
    Can anyone let me know is it possible to run an background job in R/3 with class type "A" with respect to a specific info package. Thanks.
    Regards,
    Ashok

    I do not think this is possible (ie unless you think of modifying SAP code).

  • Running background job in Bw

    Hi
    I am trying to run a background job for an ODS but when i click on background job it says
    "The return to a file on the app. server is only permitted in the backgrnd"
    then when i go to sm37 no job is there,
    I figured out what may be the problem and where it says
    <b>SPecification for return type</b> and gives the options i tried selecting store in app server.it did give me a job number but in sm37 the job was cancelled itself as said no authority.
    should i select the option <b>store in workstation</b> and if i do this will all the records be stored in this file.can i not go in sm37 and run the job to see the output.and if so please let me know how.
    thanks

    NO i think i was not clear in my ques.
    I want to run a background job for an ODS data.i want to see the data in the ods.and as there are many records to look at will take a lot of time. so h ow should i run the bckground job.
    .I tried option store in app.server.it says i dont have authority to save file on the application server.If we save a file on the application server can we delete it afterwards and what effect will it have on the app server if we store the file.
    Second option i tried..store file on the workstation and after giving the file name when i select execute background gets the following error.
    "<b>SPecification for return type and gives the options i tried selecting store in app server.</b>".
    Please let me know how to do it.

  • How to delete/deactivate a background job.

    Hi Gurus!
    Is there any way to delete a background job?
    I have a send job which sends email notifications to internet mails.
    I want to deactivate or completely delete the job.
    Please guide on what to do.
    I'll give points for answers.
    Regards,
    Vhong

    Hi,
    To delete the job, go to sm36, choose 'own jobs' and delete your job.
    As I experienced Selecting and deleting the job in sm37 does not delete the job, but just delete the scheduled or released job in database.
    P.S:
    It is kind of weird that, each time you schedule and save a job, it is scheduled in background. Even if you want to change the step definition and you save, you will see that the job is scheduled for the second time with the latest version. The last save does not cancel the previous job schedule. So you have to do it manually.
    Hope this helps
    Derya

  • Setting up archive delete functionalities using background job

    Hi,
    Through SARA transaction there we can set up a archive delete job by selecting the files, job timing details. Instead of this, we want to set up this functionality using a background job as per the variant and timing requirements.
    Is there any option to set up a background job of archive delete functionality by selecting the files through a program or function moduel. Please suggest me if anyone has done this in previous.
    Thanks,
    Siva

    Hello,
    Take a look at OSS note 205585 which describes how to schedule archive delete jobs indirectly using program RSARCHD.
    Hope this helps.
    Best Regards,
    Karin Tillotson

  • Running Background jobs in peticular period every day

    Hi All,
    I want to run a background job to run every three minutes between 3:00 to 4:30 PST every day.
    Can we run this kind of backgroud job.
    Where to give end time for this. 
    Thanks
    Anil

    Hi,
    Yes you can, when you create the job in sm36 you have the ability to have "no start after %date,time%"
    I mean you can restrict the required date and time from Start0 "Condition ->Date & Time"  tab of SM36
    Scheduled start -- time --
    No Start After  -- time --
    With Regards,
    Krishna.

  • How to delete variant form background job

    Hi,
    I have one background job with 5 variants associated with iy.
    Now i want to remove 2 variant from that background job.
    is it posible???
    if yes then how to do that?
    Thanks,

    Hi.
    Go to SM37, execute report to see it, click on modify, and change steps.
    If you have problems, delete job, and create a new one.
    Best regards.
    Valter Oliveira.

  • How to set dynamic value for field Month when running background job ?

    Dear guys,
    I have a Z* report in our company, in the selection screen there is a period field (Month and Year) and this report running in background job periodically. My Question is how i can set for Month field become dynamic follow month value of date when this report executed ?
    Example :
    When Z* report running in background on 16.04.2008, Month Value will be 04 and when running on 16.05.2008, Month Value will be 05.
    Please advice.
    Regards
    Gunawan

    Dear guys,
    I have a Z* report in our company, in the selection screen there is a period field (Month and Year) and this report running in background job periodically. My Question is how i can set for Month field become dynamic follow month value of date when this report executed ?
    Example :
    When Z* report running in background on 16.04.2008, Month Value will be 04 and when running on 16.05.2008, Month Value will be 05.
    Please advice.
    Regards
    Gunawan

  • Error in MRP Run- Background Job.

    Hi PP Gurus,
    I defined scope of planning for two plants and defined counter too. And set background job through Transaction code MDBT taking 24Hrs as Schedule selection parameter.
    When I'm accessing MDBT after 24Hrs system is throwing following messages in Scheduling log:
    1. Please check the destination for Parallel MRP (message no. MD251)
    Diagnosis of Message:
    No destination have been entered in Customizing or none of the destinations (application server) entered are active. In Customizing for MRP, you define the logical destinations (servers) to be used for parallel processing.
    2. Job cancelled after system exception ERROR_MESSAGE (Message no. 00564)
    Though I tried to enter to Customization through Message no. 1 but system is not allowing for it.
    What could be the problem. No help is available through any OSS note also.
    Please suggest the required solution in terms of Configuration or any other changes?
    Thanks & Regards,
    Abu Arbab

    Hi,
    Two more queries:
    1. If I don't want to go for Parallel Processing MRP, I don't have to select 'Parallel Processing' in Transaction code MDBT variant. But when I'm trying to change it system is not allowing me. It's not allowing me to go further without selection of it. What could be the reason behind it? Either Customization problem or any other?
    2. If set 'Parallel Processing destination' through Customization, system is giving only Development server as available destination and also Customization Request is getting generated. But the request is going to be transported to Production server. Since Parallel Processing destination was selected 'Development server' earlier and now MRP will run on 'Production server', it has to be changed to 'Production server'. But as already mentioned Customization Request will be getting generated and further it is freeze for Customization. How could get rid of these issues?
    Please come back with prompt comments.
    Thanks & Regards,
    Abu Arbab

  • Issues while executing background job programatically

    HI All,
    My Selction screen has a push button(BG) and the standard F8(Execute) button
    1. If the user click the f8 button i.e sy-ucomm = ONLI , the report should run in foreground mode
    2. If the user click the push button button  BGi.e sy-ucomm = FC01 , the report should run in background mode
        and create file in sharepath.( i have used fm JOB_OPEN ,SUBMIT etc for this)
    3. If the user click the F9 button i.e sy-batch = X , the report should run in background mode
        and create file in sharepath
    a)When I click the push button i.e point 2  , then the report executes in online mode only .I dont see any
    jobs in SM37
    Pls help!!!
    -Faiz

    Hi Faizur,
    you have the option to run the job in background for Point 3 right so option 2 is not required.
    if a job is scheduled to run in background, then SY-BATCH will be 'X' and the program will run in the back ground.
    In your case the program will be executed in the foreground.
    Hope this details will help you. if not please let me know the exact point 2 & 3 requirements.
    Regards,
    Phani

Maybe you are looking for