How to select server in which background job should run

Hi,
I want to run my program as background job. I want the user to select the server, in which background job should be run, in the selection screen of my program. When it is sheduled in background the job should run in the selected server.
How to do this?
Regards,
Sriram

Hi,
please write the code like as below.
DATA : D_GROUP like TBTCJOB-JOBGROUP.
use the function moulde JOB_OPEN.
  D_JOBNAME = SY-REPID.
  D_GROUP- BTCSYSREAX =  " pass the target server name Here
     CALL FUNCTION 'JOB_OPEN'
        EXPORTING
             JOBNAME          = D_JOBNAME
             JOBGROUP       =  D_GROUP
        IMPORTING
             JOBCOUNT         = D_JOBNO
        EXCEPTIONS
             CANT_CREATE_JOB  = 1
             INVALID_JOB_DATA = 2
             JOBNAME_MISSING  = 3
             OTHERS           = 4.
submit   <Program name>
              USER SY-UNAME VIA JOB D_JOBNAME NUMBER D_JOBNO
              USING SELECTION-SET '  var1 '   " Give varient name
              AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                JOBCOUNT             = D_JOBNO
                JOBNAME              = D_JOBNAME
                STRTIMMED            = 'X'
           IMPORTING
               JOB_WAS_RELEASED     = D_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.
Hope this will helps you
Regards
Kiran

Similar Messages

  • How to find process chain using background job in sm37

    How to find process chain using background job in sm37

    Better is to select the job.
    Select (Define) Step (s) or F6.
    Select the line and Menu Goto>Variant.
    The variant contains the name of the CHAIN and its VARIANT.
    Success
    We faced an old job and via job monitoring we were informed about a cancelled job every 'interval'.
    We noticed that the related chain was deleted but still the job was scheduled each interval again and was cancelled because an event was missing
    We could not find the scheduled job via SM37.
    Via view V_OP, view over tbtco abd tbtcp, we find the related entry.
    We delete these entries via function BP_JOB_DELETE....
    Edited by: Jack Otten on Jul 9, 2010 2:50 PM

  • Upload an excel file in the server  with a background job

    I am trying to upload an excel file in the server, but i only can upload flat files, i can upload files in local with the function ALSM_EXCEL_TO_INTERNAL_TABLE, can i use this function reading an excel file in the server, or is there another possibility of uploadinging an excel file in the server  with a background job ?
    thanks in advance

    Hi
    First read the file from the server to some temporary place at presentation layer and then open it. And if required, save it to the server afterwards. To read/write files to application server you can use:
    1. Statements "OPEN DATASET/CLOSE DATASET".
    2. There are some FMs for server file operations, like "C13Z_FILE_UPLOAD_BINARY" and "C13Z_FILE_DOWNLOAD_BINARY".
    *--Serdar

  • Can we change the selection criteria for RV60SBAT Background Job for Billin

    We have a requirement to add a new selection criteria for RV60SBAT Background Job for Billing. We want to process back order invoices first. So we want a specific background job to select these. So we want to select any orders that are eligible to be invoiced where order date < the date of background job(r sy-datum ). Any ideas where we can introduce this logic for selection criteria?
    Thanks,
       Matt

    Hi Matt
    For your requirement , copy the standard  RV60SBAT program to Z program and in that copied RV60SBAT program , maintain the logic that the backorder invoices should be first processed.Then after that regular background job for billing should take happen .Then your requirement can be fulfilled
    Regards
    Srinath

  • Background job is running for long tome in source system (ECC)

    Hi All,
    Background job is running for long tome in source system (ECC) while extracting data to PSA.
    I checked in ECC system SM66,SM50 the job is still running
    in SM37 the job is Active
    There are only maximum 7000 records the extractor is 2LIS_02_ITM but it is taking 11 to 13 hours to load to PSA daily
    I had checked enhancements every thing is correct.
    Please help me on this how can I solve this issue.
    Regards
    Supraja K

    Hi sudhi,
    The difference between Call customer enhancement...  and  Result of customer enhancement:... is very less we can say this as a second.
    The difference is between LUWs confirmed and 1 LUWs -
       and Call customer enhancement -
    Please find the job log details below, and give me the solution to ressolve this
    01:06:43 ***01:06:43 * ztta/roll_extension........... 2000000000                              *                 R8           050
                     R8           048
    01:06:43 1 LUWs confirmed and 1 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DATA     RSQU          036
    06:56:31 Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 5.208 records                  R3           407
    06:56:31 Result of customer enhancement: 5.208 records                                              R3           408
    06:56:31 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 5.208 records                      R3           407
    06:56:31 Result of customer enhancement: 5.208 records                                              R3           408
    06:56:31 PSA=1 USING SMQS SCHEDULER / IF [tRFC=ON] STARTING qRFC ELSE STARTING SAPI                 R3           299
    06:56:31 Synchronous send of data package 1 (0 parallel tasks)                                      R3           410
    06:56:32 tRFC: Data Package = 0, TID = , Duration = 00:00:00, ARFCSTATE =                           R3           038
    06:56:32 tRFC: Start = 00.00.0000 00:00:00, End = 00.00.0000 00:00:00                               R3           039
    06:56:32 Synchronized transmission of info IDoc 3 (0 parallel tasks)                                R3           414
    06:56:32 IDOC: Info IDoc 3, IDoc No. 1549822, Duration 00:00:00                                     R3           088
    06:56:32 IDoc: Start = 04.10.2011 06:56:32, End = 04.10.2011 06:56:32                               R3           089
    06:56:32 Altogether, 0 records were filtered out through selection conditions                      RSQU          037
    06:56:32 Synchronized transmission of info IDoc 4 (0 parallel tasks)                                R3           414
    06:56:32 IDOC: Info IDoc 4, IDoc No. 1549823, Duration 00:00:00                                     R3           088
    06:56:32 IDoc: Start = 04.10.2011 06:56:32, End = 04.10.2011 06:56:32                               R3           089
    06:56:32 Job finished                                                                               00           517
    Regards
    Supraja

  • Background Job Still Running - Data Can Be Displayed Only Msg Populated in Maintain Versions (OKEQ) Screen

    Hi,
    I try to create 2013 FY in "Setting for Each FY" in OKEQ - Maintain Versions unfortunately I have created Null FY, try to delete Null FY on the time it will ask Job schedule, I have cancelled the job & reopen Maintain Versions (OKEQ) screen on the time system populated the msg "Background Job still running - Data can be displayed only"
    In Settings for Each FY screen there is no New Entries button, all FY are blocked status, changes was not allowed.
    How can I resolve it.
    Waiting for your valuable suggestions.
    Regards,
    Nageswar.

    Dear Rajneesh Saxena
    Thanks for your prompt reply.
    Yes you are correct, on the time of deletion it will ask Background Job Process, for immediate deletion must & should select "NO".
    While "Settings for Each FY" screen populates message "Background Job Still Running - Data Can Be Displayed Only" open  screen in display mode enter the command "=KILL" in command bar press enter, then you will allow to changes get New Entries button also.
    Problem is solved
    Regards,
    Nageswar.

  • How to submit the report in Background job.

    Hello Friends,
    In the selection screen I have 2 radio buttons one for background Process & other for foreground processing. if the user selects the background processing the program should execute in background and output need to be sent to SAP Inbox.
    Issues:
    1) If I am using the JOB_Submit FM or Report Submit the program is going to infinite loop and many continiously jobs are are being scheduled. How to avoid.
    2) Is there any best possible way to send the mail to SAP Inbox.
    Note: I am using OOALV in my program....
    Thanks,
    Ravi

    Hi,
    the first problem looks like you have an infinite recursion. You just need to avoid background scheduling again. There is a system field sy-batch. So if this field is equal to 'X' then you are already in background mode and you don't need to schedule your background job again. Another way is to split your program in two programs. The first will be responsible for scheduling or executing the second one.
    You can use FM SO_NEW_DOCUMENT_SEND_API1 to send message to workflow inbox. You need to user receiver type B. There are so many posts on this forum about sending emails from ABAP which may help you with implementing this requirement.
    Cheers

  • Schedule Abap Server proxy in background job in SAP r/3

    Hi all,
    My scenario is File XI Proxy Interface inbound to SAP...
    My requirement is to schedule the proxy in the background job every night.
    How can I acheive this?
    <removed_by_moderator>
    Read the "Rules of Engagement"
    Thank you,
    Mili.
    Edited by: Juan Reyes on Oct 21, 2008 3:04 PM

    Hi ,
    U don't need to schedule a server proxy ...as the proxy will kick in automatically as soon as the message is processed by file adapter .
    Since yours is File to proxy scenario...
    and you want to execute it overnight ..
    You will have to control when the file is processed by XI file adapter.
    Here what you can do ..
    Let's just say your file gets placed in a Folder 'A' ...and your file communication channel is configured to pick files from folder B.
    Write an abap code on xi box ..(or you can use a V.B. script)
    which will move the file from folder A to Folder B.This code can easily be scheduled..so that it you can get files in folder B from where XI processig will kick in .
    (job scheduling can be done sm36 ..use the wizard)

  • Monitoring of File in FTP Server generated by background job in ECC system

    Hi,
    There is a background job in ECC system, which generates a file in FTP server. However the issue is that even if the background job is successfully executed, there are instances where the file is not generated in FTP server. Is there any way by which we can monitor such file in FTP Server?
    Regards
    Nishu Shah

    Hi,
    I guess this is not a solman question. Anyway, how do you perform the FTP?? custom code?
    Cheers,
    Diego.

  • How to Execute WebDynpro Applications as Background Job ?

    Hi Gurus,
    We have developed a lot of WDJ applications with component reusage; ie,
    quite a lot of business logic are wrapped in WDJ Components which are
    re-used by other WD UIs.
    Now we'd like to automate some of the processes with background jobs
    and faced with a few problems :
    #1. How can we write a background WD application which can be
    triggered by external mechanism and without presenting any UI?
    #2. If we write the background program in a Java DC, how can we
    invoke existing methods in WD components ?
    Anyone got a clue ??
    Ying-Jie Chen

    Hello Amit,
    > Well I can think of a workaround in this case.If you are aware
    > of the suspend-resume functionality of the WD application then
    > its possible to run the WD application virtually in background.
    [ stuffs deleted ...]
    It sounds like a possible alternative to our requirement, I'll
    spend some time to investigate on the WD suspend-resume mechanism !
    > Also let me know why are you preffering the WD if you dont
    > require its UI
    Our application requires the process to be performed with UI interaction;
    with some instances it should be run as a background job. Either case involves
    RFC calls to backend SAP R/3 and it's easy for RFC access with WD
    Component.  Though it's also possible to use CAF application service for
    RFC access; due to some technical constrains, we did not use CAF
    framework. Therefore it ends up where we are now ...
    Thanks for your tip!
    Ying-Jie Chen

  • How to cancel invoice documents in Background Jobs ?

    Dear sd Gurus
    i want to cancel invoice documents in Background Jobs .
    I Have checked this link also VF11 (cancel invoice) in background job
    But i did find Exact Way
    Thanks a lot

    Hi Madhuri,
    I suggest you to use LSMW for this activity. Just do the recording, test it for one billing doc. If successful then run it for all billing doc which you want to cancel.
    MT

  • How to transport variants and scheduled background jobs

    Hi all
       Could anyone let me know if  variants be transported .
       also can scheduled background jobs transported.
    Thanks in advance

    Hi,
    Run the program RSTRANSP and give the name of the program and the variant name.
    It will create a transport request for the variant.
    the rest of the process is the same as is the case with all other transport requests.
    Regards,
    Raghu
    Message was edited by:
            Raghu Reddy

  • Standard background job is running after deleting a user also

    Hi Gurus,
    in my production system environment i observed below thing.
    1)Default standard background jobs were scheduled by earlier basis admin after some days he left and his id also deleted but still some jobs are running with his id and finishing also, how is it possible without having his ID in system?
    2) what is the standard procedure to schedule default standard bg jobs in SAP? either from sap* or DDIC or basis admin?
    one more question regarding Audit logs:
    1)can we activate audit log for selective ids and selective period?
    2)if we activate audit log is there any performance issues will come?
    Thanks in advance
    Venkat

    Hello Venkat,
    1)Default standard background jobs were scheduled by earlier basis admin after some days he left and his id also deleted but still some jobs are running with his id and finishing also, how is it possible without having his ID in system?
    - Please cross check whether multiple jobs are scheduled with that user in different time period. If that user is defined in step then only that job fails otherwise it runs without any issues.
    2) what is the standard procedure to schedule default standard bg jobs in SAP? either from sap* or DDIC or basis admin?
    - Please go through the note suggested by Juan. I recommend to schedule with DDIC or Basis Admin.
    Thanks,
    Siva Kumar

  • Background job not run properly

    Hi,
    When an infopackage is triggred through process chain in BI a background job will be exeuted at R/3 to fetch data from R/3.
    But the bakground job did not execute properly hat is it did not fetch any data but ot finished.
    But when the infopackage is executed manually the background job fetches the data from R/3.
    Why the job is not fetching data when triggered through process chain.
    Please help me to sole this issue.
    Regards,
    Indhu

    Hi Induja,
    In your case, you will have to debug the background job that is activated through BI. Check if proper data is coming from BI.
    You can only debug a background job if it is created under your user id. Thus, to debug the job you first have to own it and then debug by selecting it and either typing 'JDBG' in the command field or through menus available on the top.
    Job overview transaction code - SM37.
    Hopefully the issue is in Development/Test/Quality system and not in Production.
    Hope that helps!.
    Regards,
    Saba

  • Background Job not running

    Hi All,
    A background job has been scheduled to run every minute.It was working fine but a few days back it did not get scheduled for 2 hours . Any suggestions as to why this might have happened.
    TIA.
    Vartika

    Hi Manik,
    The job started working fine after 2 hours. It was only for 2 hrs that it did not work. How to check if the userid was locked or not during that period.
    Thanks
    Vartika

Maybe you are looking for

  • Where are the front USB ports on the HP Envy 700-210 Desktop?

    I bought the Envy 700-210 desktop because it has so many USB ports.   However, I can only find 8 - 2 on top and 6 in the back.   According to the specifications, there are supposed to be some in the front.   Do I have to take something apart to find

  • Adobe Reader/Acrobat forms issues!

    This is a long one, and I know it's been posted before, but I just wanted to try again anyway. I've just created a form using Adobe Designer, one that contains fields that someone can fill out when the form is open with Adobe Reader. The form I've cr

  • How to use resource bundle entries for column names/title in .rpt file

    <p>Our application needs to be able to support reporting in multiple languages. Hence we do not want to put language specifiec column names in the rpt file but rather use text for a particular locale during runtime which in java world is easily achie

  • Hardware colour calibration tips...

    Hi there, I've recently purchased one of the new glossy 15" MacBook Pros and a glossy 24" Led Cinema Display. I'm no expert in colour on Macs, so i want to be sure i have everything set up as well as possible. I design for web mostly (so print calibr

  • I am using

    the PORT IN/OUT vis from LabVIEW 6i on Windows 95 to read data off an 8255 PPI. The PPI is on a third party card I am using which generates an interrupt on IRQ7 when the data is ready, how do I then trigger a read in LabVIEW when the interrupt is ass