Bakcground Job Creation

Hello everybody,
I have the next requirement, I need an option in the menu in a Z dynpro program to execute the transaction in a background job, the problem is that i need it to work just like this option works with selection screens, that in the Program option in the menu it has the Execute in background, so it generates automatically the job, I've seen the functions JOB_OPEN, JOB_SUBMIT and JOB_CLOSE they will work the problem is with the variant cause there is no variants and i don't know how the system generates some kind of temporal variant with a name such as &00000000054 and so on, does anyone know how can i do this, thanks in advance.
Regards,
Julio Cesar

You don't need a temporary variant for this.  Just use the SUBMIT statement and pass your data(captured in the screen) to another "Z" program using the WITH statement.  Problemm solved.
data:   l_valid,
        ls_params like pri_params,
        l_jobcount like tbtcjob-jobcount,
        l_jobname  like tbtcjob-jobname.
* Get Print Parameters
  call function 'GET_PRINT_PARAMETERS'
       exporting
            no_dialog      = 'X'
       importing
            valid          = l_valid
            out_parameters = ls_params.
* Open Job
  l_jobname = 'Z_SUBMITTED_PROGRAM'.
  call function 'JOB_OPEN'
       exporting
            jobname  = l_jobname
       importing
            jobcount = l_jobcount.
* Submit report to job
  submit z_submitted_program
       with P_parm1 = <some_value>
       with P_parm2 = <some_value>
       via job     l_jobname
           number  l_jobcount
       to sap-spool without spool dynpro
           spool parameters ls_params
              and return.
* Schedule and close job.
  call function 'JOB_CLOSE'
       exporting
            jobcount  = l_jobcount
            jobname   = l_jobname
            strtimmed = 'X'.
Regards.
Rich Heilman
Edited by: Rich Heilman on May 21, 2008 3:51 PM

Similar Messages

  • A question about Job Creation

    Hi Expert,
    By JOB_OPEN, JOB_SUBMIT, JOB_CLOSE, we can schedule a job.
    When the first two FMs is executed, the job is still in 'scheduled' status. Only when the FM JOB_CLOSE is executed, the job will be in 'released' status.
    In my applicaiton, I need to check the job status. If the job is in 'scheduled' status, I think that the job creation is not successsful; Otherwise, the job creation is successful.
    But the issue is, if job is in 'scheduled' status, how can I know whether all three FMs is executed in the job creation or only JOB_OPEN and JOB_SUBMIT are executed while JOB_CLOSE still not starts?
    In the later case, the applicaiton should wait some time and check the job later.
    Thanks for your support
    Best Regards, Johnney.

    Hi,
    Suppose there two APIs.
    In API1, there are four steps:
    1. call FM JOB_OPEN
    2. call FM JOB_SUBMIT
    3. Save the Jobname and Jobcount in the DB
    4. CAll JOB_CLOSE
    in  API2, there are two steps:
    1. get the Jobname and Jobcount from the DB
    2. Call FM BP_JOBLIST_STATUS_GET to get the job status.
    API1 and API2 are executed asynchronically. Consider the following case:
    After STEP3 is executed(STEP4 has not yet been started), the API2 starts to run. Now the job status that API2 get is 'Scheduled'.
    This is not correct, because the job creation is still not finished. The API2 should wait some time and check later.
    So my question, is how API2 know that the job creation is not finished.
    Thanks & Best Regards, Johnney.

  • Job creation table

    Dear All,
    May i know what is the table to store a background job's master data? I mean the table which stored the job creation date, change date, change by, event.
    Please comment.

    Hi Friend,
       Check the following table:
           BTCUED
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • Smbd(383) deny job-creation

    I am getting this error whenever I use Windows or Mac connect to my macbook air Lion
    I am getting this error.
    Aug 7 15:26:18 MBAir sandboxd[385] ([383]): smbd(383) deny job-creation
    It won't let me connect until I restart the file sharing in system preferences. It consistently doing it after a reboot and I have to restart the service everytime I restart my macbook air.
    Does anyone know what is this error?

    I have the same problem.
    I enable SMB file sharing on my mac mini 2011. When i access it from my windows 7 PC it works.
    But if i restart the mac mini i can't access SMB shares from windows until i restart the SMB file sharing in system preferences.
    No solution.
    Come on Apple !

  • PJM/ATO Job Creation

    Cannot successfully create a dj for an ATO item that has a project # referenced using the WICDOL module: AutoCreate Final Assembly Orders. Order is scheduled and booked. Status is Awaiting Job Creation. Run AutoCreate. Job completes with a warning. If the same item is ordered and scheduled without a project number I can create a WIP job with no difficulty. A TAR has been opened but the progress has been slow. Any thoughts would be greatly appreciated.

    Hi,
    Just try by giving task number, along with project number. Iam assuming that you are giving project number to all items in the SO i.e. Model, option class,option, etc.
    Reg
    Sreenivas Amisagadda

  • SQL job creation/modification/deletion auditing?

    I have a job 'pop-up' 3 days ago on one of our Servers and of course 'nobody' is coming forward and saying 'I did it'. Is there a way to determine who created the job after the fact?
    Going forward, is there a way to be notified via email when jobs are created/modified/deleted in SQL 2005 Enterprise? Trigger maybe? I'm not having much success searching the web on this.

    --Job creator / owner
    select a.name 
    as job_name ,b.name
    as job_owner from sysjobs a
    , sys.syslogins b
    where a.owner_sid
    = b.sid

    Trigger on sysjobs table
    create
    trigger trigg on msdb.dbo.sysjobs
    after
    insert ,
    update
    as
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name
    = 'name_of_mail_profile',
    @recipients = '[email protected]',
    @body = 'New job creation alert',
    @subject = 'Automated Message'
    -- Who ran the job ?
    select a.name 
    as JOB_NAME , b.message
    from msdb.dbo.sysjobhistory b
    , msdb.dbo.sysjobs a
    where
    a.job_id=b.job_id
    and a.job_id
    = 'AD5AAF63-4C4D-496A-AAFB-98F981E69BC2'
    and b.step_name =
    '(Job outcome)'
    Thanks, Leks

  • Batch Job creation by adding entries to SAP tables

    Hi Experts,
    I understand there are at least 4 SAP tables involved with Batch Jobs.
    I need to create many variants and manually creating them using sm36 is tedious.
    If I add entries in the TBTC* tables, can the batch jobs be created without causing inconsistency ?
    The batch jobs are all similar, based on a zprogram that selects from sap tables data and updating to a ztable. There are  many variants I need to create and assign to the batch jobs. So, if I can update the entries in the tables to achieve the same, it would be much quicker and reduce human error and make checking the job setup faster and easier.
    Please advise.
    regards
    M Russo

    Hi,
    There are many function modules which helps you to create the variants.
    You need to create a simple report to automate your variant creation and batch submission.
    use function module RS_CREATE_VARIANT to create variant use the structure RSPARAMS to specify the value of your selection screens
    Go to the function group BTCH . Use JOB open close to submit the batch jobs with variants anor any ther fm in the BTCH function goup.
    Hope this helps rather than directly writing to tables.
    Thanks

  • Batch job creation for sending email if the invoice is aged

    Positive confirmation: Send system notification to the requestor if:
    a) An invoice is received and GR is not yet posted in the ECC system.
    b) An 'aged' invoice and GR is not yet posted in the ECC system.
    This requirement is for USA only. i.e., we have only one company code which is 8960.
    Identifiers of the invoice are
    Company Code = u20188960u2019
    Invoice Document Type = u2018R9u2019
    Use table EKBE for relationship between Invoice, Goods Receipt and Purchase Order.
    The field EKPO-BEDNR contains the Shopping Cart Number
    Implementation Strategy
    1. To send email if the invoice is aged.
    Create a program that will run as a job. This job will frequently check for invoices related to SRM Shopping Carts received from E2OPEN. If an invoice is aged and there is no Goods Receipt posted through confirmation from SRM, then an email will go out from ECC system to the requestor. Using the Shopping Cart number on PO, find the requestor information (email ID) from SRM through an RFC call. This job will run once in a day and should have a parameter in the program for the age of the Invoice.
    Both the emails should contain a link (To be taken from SRM system, to be supplied) to log into SRM system. The email will also contain the Shopping Cart number and the Description of the item, and a message to Confirm this, including age of the invoice if aged.
    Please let me know how to create the batch job.
    Regards,
    Venkat
    Edited by: VenkatG on Sep 1, 2009 3:14 PM

    Do not pass the COMMIT_WORK flag... Leave it blank. Any transaction for the data integrity, one should never use COMMIT WORK related statements. Normally SAP transactions will have the COMMIT WORK at the end of transaction which is enough for any thing that is added part of the customer exits...
    Hope this helps.
    Regards
    Anjaiah

  • Job Creation via BAPI using BackgroundJob

    Hello,
    I'm working on Access and I'm submitting a JOB in SAP; till we were in release 4.7 my database worked but after the relase change I'm not able to us it again.
    When I call my function in order to do "AddABAPStep" the system give me a Run-time error '4701'
    "Non-BAPI methods with export parameters are currently not supported"
    Hereafter the instruction that doesn't work :
            oJobrun.AddABAPStep ExternalUserName:=pMUsrUser, JobName:=Jname, Jobcount:=Jcount, AbapProgramName:=xabap, AbapVariantName:=xvar, Return:=oReturn
    Is there someone that is able to help me ?
    Thank you in advance
    Guido Chiappa
    Edited by: Guido Chiappa on Jul 14, 2011 11:31 AM

    Hi,
    May help you:----
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/edab9790-0201-0010-479a-98fcc7ebc7bd?quicklink=index&overridelayout=true
    Regards,
    Suman

  • Batch job creation for sales order

    Hi,
    How to create a job and schedule it so that it assigns reason of rejection to sales order line items for a particular sales org which are not delivered and after doing so, the status of the sales order is set to complete.
    regards
    sachin

    Hi,
    Execute transaction SM36
    Define Job name, Job class, Target server
    Click on 'START CONDITION' button
    Click on 'Date/Time' button
    Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.
    Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE
    Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.
    Click on 'Job overview' button or execute SM37 transaction.
    Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.
    You will now see all your scheduled JOBS.
    regards,
    mahantesh

  • DB13 bakcground job - error

    Hi,
    I have scheduled for the update optimizer statistics immediately in DB 13 it failed with the error as
    "Job started                                                                 
    Step 001 started (program RSDBAJOB, variant &0000000000012, user name SBUDDAR
    Execute logical command SAPDBA On host sap2dqsrv
    Parameters: -u / -analyze DBSTATCO
    Can't exec external program (No such file or directory)
    WaitForSingleObject failedwith %d (No such deviceor address)
    Job finished"
    similarly for  " Check optimizer stattistics"                                         
    "Job started                                                                             
    Step 001 started (program RSDBAJOB, variant &0000000000013, user name SBUDDARA)         
    Execute logical command SAPDBA On host sap2dqsrv                                        
    Parameters: -u / -checkopt DBSTATC_TAB                                                  
    Can't exec external program (No such file or directory)                                 
    WaitForSingleObject failedwith %d (No such deviceor address)                            
    Job finished"
    similarly for "Adapt next extents"
    "Job started                                                                          
    Step 001 started (program RSDBAJOB, variant &0000000000015, user name SBUDDARA)      
    Execute logical command SAPDBA On host sap2dqsrv                                     
    Parameters: -u / -next PSAPBTABD                                                     
    Can't exec external program (No such file or directory)                              
    WaitForSingleObject failedwith %d (No such deviceor address)                         
    Job finished"
    Our environment is windows 2003 server, SAP 4.6C.
    Please help us how resolve above issue.
    Thanks and Regards
    Satya

    Hi Eric,
    Thank you for the information that is really helpful. After following that note, I can successfully ran it.
    When I ran database check in db13 calendar in production, I got the following issue.
    BR0978W Database profile alert - level: ERROR, parameter: COMPATIBLE, value: 10.2.0.2.0 (<> 10.2.0)               
    BR0978W Database profile alert - level: WARNING, parameter: DB_FILE_MULTIBLOCK_READ_COUNT, value: 8(not default)  
    BR0978W Database profile alert - level: ERROR, parameter: FILESYSTEMIO_OPTIONS, value:   (<> SETALL)              
    BR0978W Database profile alert - level: WARNING, parameter: LOG_CHECKPOINTS_TO_ALERT, value: FALSE (<> TRUE)      
    BR0978W Database profile alert - level: WARNING, parameter: OPTIMIZER_INDEX_CACHING, value: 0 (>< 100,20)         
    BR0978W Database profile alert - level: WARNING, parameter: OPTIMIZER_INDEX_COST_ADJ, value: 100 (>< 50,10)       
    BR0978W Database profile alert - level: WARNING, parameter: OPTIMIZER_MODE, value: CHOOSE (not default)           
    BR0978W Database profile alert - level: ERROR, parameter: QUERY_REWRITE_ENABLED, value: TRUE (<> FALSE)           
    BR0978W Database profile alert - level: ERROR, parameter: RECYCLEBIN, value: ON (<> OFF)                          
    BR0978W Database profile alert - level: ERROR, parameter: REMOTE_OS_AUTHENT, value: FALSE (<> TRUE)               
    BR0978W Database profile alert - level: ERROR, parameter: REPLICATION_DEPENDENCY_TRACKING, value: TRUE (<> FALSE) 
    BR0978W Database profile alert - level: WARNING, parameter: TIMED_STATISTICS, value: TRUE (not default)           
    Similarly for my quality..
    BR0970W Database administration alert - level: ERROR, type: ARCHIVE_STUCK, object: E:\oracle\QA1\saparch\QA1arch, value: 93.62%  
    BR0970W Database administration alert - level: WARNING, type: MANY_EXTENTS, object: (index) SAPR3.D010TAB~0, value: 80.67% (> 80 
    BR0970W Database administration alert - level: ERROR, type: TABLES_NOT_IN_TABLE_TABLESPACE, object:(index) SAPR3.MLICHECK~0, va  
    BR0280I BRCONNECT time stamp: 2009-04-27 04.01.26                                                                               
    BR0972I Checking database operations...                                                                               
    BR0973W Database operation alert - level: ERROR, operation: 0811132000.opt, time: 2008-11-13 20.00.05, condition: Last successfu 
    BR0280I BRCONNECT time stamp: 2009-04-27 04.01.26                                                                               
    BR0974I Checking database messages in E:\ORACLE\QA1\SAPTRACE\BACKGROUND\alert_qa1.log ...                                        
    BR0976W Database message alert - level: ERROR, line: 5846, time: 2009-01-01 07.29.39, message:                                   
    Checkpoint not complete                                                                               
    BR0976W Database message alert - level: ERROR, line: 5864, time: 2009-01-01 07.29.52, message:                                   
    Checkpoint not complete                                                                               
    BR0976W Database message alert - level: ERROR, line: 5882, time: 2009-01-01 07.30.10, message:                                   
    Checkpoint not complete                                                                               
    BR0976W Database message alert - level: ERROR, line: 5900, time: 2009-01-01 07.30.29, message:                                   
    Checkpoint not complete                                                                               
    BR0976W Database message alert - level: ERROR, line: 38376, time: 2009-04-24 22.07.48, message:                  
    Checkpoint not complete                                                                               
    BR0976W Database message alert - level: ERROR, line: 38411, time: 2009-04-24 22.16.10, message:                  
    Checkpoint not complete                                                                               
    BR0280I BRCONNECT time stamp: 2009-04-27 04.01.26                                                                
    BR0977I Checking database profile...                                                                             
    BR0978W Database profile alert - level: WARNING, parameter: DB_BLOCK_BUFFERS, value: 0 (< 8960)                  
    BR0978W Database profile alert - level: WARNING, parameter: DB_FILE_MULTIBLOCK_READ_COUNT, value: 128 (> 8)      
    BR0978W Database profile alert - level: ERROR, parameter: LOG_ARCHIVE_START, value: FALSE (<> TRUE)              
    BR0978W Database profile alert - level: WARNING, parameter: LOG_BUFFER, value: 54942720 (>< 1100,300 KB)         
    BR0978W Database profile alert - level: WARNING, parameter: LOG_CHECKPOINT_INTERVAL, value: 0 (< 3000000000)     
    BR0978W Database profile alert - level: WARNING, parameter: LOG_CHECKPOINT_TIMEOUT, value: 1800 (> 0)            
    BR0978W Database profile alert - level: WARNING, parameter: OPTIMIZER_FEATURES_ENABLE, value: 10.2.0.1 (<> 8.0.4)
    BR0978W Database profile alert - level: WARNING, parameter: OPTIMIZER_INDEX_COST_ADJ, value: 100 (<> 10)         
    BR0978W Database profile alert - level: WARNING, parameter: OPTIMIZER_MODE, value: ALL_ROWS (<> CHOOSE)          
    Can you please help me how to correct this error?
    Thanks and Regards
    Satya
    Edited by: Satyanarayana Buddarapu on Apr 28, 2009 12:47 AM

  • Back ground Job Creation  and maintanance ?

    Gurus
    I have a report, which will take more than the normal 10 min time.
    ISo i have to run it in the back ground session.
    Please let me know how to create a back grund job and maintain and process it?
    Also please tell me the Tcodes associated with this process.
    Thanks a lot.. Points will be awarded....of course...
    Meenakshi.N

    On the report screen, press F9 (or program -> execute in background). Give the printer name and to send to spooler or print immediately option in the initial screen. Press OK.
    Then, give the start time (options will appear) and click on "Save" button.
    Now, to see the status of the job, go to SM37.and execute by your username. Here you can see the job status, spool etc.
    Let me know if you have any questions.

  • Job creation issue

    hi all,
    we have a requirement as follows:
    we need to create a job2 which will trigger automatically on a daily basis after a job1 completes .Also,this job2 should take all the vendor numbers from lfa1 table that are updated daily ( job1 is updating vendors daily into lfa1)  and these vendors numbers should be used as a selection screen variant for running a program that job2 will trigger.
    After this,email should be sent to users that thses vendors are processed or not processed by our job2.
    Any pointers on how to design this requirement.
    Thanks

    Hi
    You can easily find out the newly created vendors from LFA1 for the selection condition. Create Job1 with the first program to update the LFA1 table.
    And then define your job2 for the next program to get the details of newly created vendors from LFA1. For this job, maintain the start condition with 'After Job option'. In that option mention name of Job1.
    In the Job2 program write the code to send email.
    Hope this is clear to you.
    Thanks
    Sourav

  • External job creation ORA-27370

    Hi Team,
    In oracle documentation it is mentioned
    The CREATE EXTERNAL JOB privilege is required for database users who want to execute jobs that run on the operating system outside the database. By default, this privilege is granted to all users who have been granted the CREATE JOB privilege.
    So as per documentation it is not mandatory to be sysdba could yo please make sure the user who run the job is having  CREATE EXTERNAL JOB privilege
    However although user has CREATE EXTERNAL JOB
    running the following
    When running the following statement below:
    SQL> BEGIN
    DBMS_SCHEDULER.create_job (job_name => 'test_shell',
    job_type => 'EXECUTABLE',
    job_action => 'ls -l',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
    enabled => TRUE,
    COMMENTS => 'Calling shell script from Oracle');
    END;
    getting
    ERROR at line 1:
    ORA-27370: job slave failed to launch a job of type EXECUTABLE
    ORA-27300: OS system dependent operation:accessing extjob wrapper failed with
    status: 13
    ORA-27301: OS failure message: Permission denied
    ORA-27302: failure occurred at: sjsec 3
    ORA-06512: at "SYS.DBMS_ISCHED", line 185
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
    ORA-06512: at line 2
    using the following it worked
    Create the script /tmp/run_test.sh with:
    #!/bin/bash
    date >> /tmp/run_test.log
    b. Change permissions to 755 /tmp/run_test.sh
    c. Execute the script and confirm that the file /tmp/run_test.log is created.
    d. As sys execute:
    begin
    dbms_scheduler.create_program
    program_name => 'RUN_TEST',
    program_type => 'EXECUTABLE',
    program_action => '/tmp/run_test.sh',
    enabled => TRUE,
    comments => 'testing script'
    end;
    begin
    dbms_scheduler.create_schedule
    schedule_name => 'EVERY_MIN',
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
    comments => 'Every 1-mins'
    end;
    begin
    dbms_scheduler.create_job
    job_name => 'RUN_TEST_JOB',
    program_name => 'RUN_TEST',
    schedule_name => 'EVERY_MIN',
    comments => 'test script ',
    enabled => TRUE
    end;
    So is it mandatory to use sysdba?
    Thanks in Advance,
    Jo.

    Thanks Grey,
    The db version is 11.2.0.3 the OS user is the owner of oracle software for permissions all were done as per note 1059981.1
    Regards,

  • Regarding Bakcground jobs

    Hello Experts,
    I want to know about the 'sequential background job'.  how it works and what are the main parameters we need to pass to the function module called JOB_CLOSE through ABAP code in programming.
    Please help me in this regard,
    Thank you.
    Regards,
    Anand.

    Hi,
    i think kbs anand is refering to his post from yesturday "run a program in packeges". I suggested to call a sub-programm in background so it can get processed in parallel batch jobs.
    but i dont know whats up with the "sequential background job".
    kbs anand can you please explain what you want to do in detail, so we can help you better?
    regards
    Stefan Seeburger

Maybe you are looking for

  • "The company code does not exist or has not been fully maintained" in mm01

    Hi all, I am creating a material, it needs me to provide company code. when I gave out my company code, it reports: "The company code ZXXX does not exist or has not been fully maintained". what should the problem be? thanks and regards, Smaosn Zhu

  • In app purchase Error

    So for the past three days I've had an in-app purchase error. One morning I tried to purchase an item in my app and it said "The Apple ID you entered couldn't be found or your password was incorrect. Please try again." I thought it was strange so I w

  • Calculation of basic date and schedule date

    I update material master from routing with CA97 to material master work scheduling data with base quantity 1000 When MRP running, planned order for 54000 PCS is schedule with work scheduling data. when i schedule planned order (change) the calculatio

  • Can only render Audio of QT,video is black

    I received a Quick Time file via Dropbox. It's 1280x720, 23.98fps, Compressor H264, Square Pixel. It plays in QT player.  But after I imported it in FCP v7 the video doesn't move, only the Audio plays after being rendered for Playback. The Video cann

  • Mouse pointer disappearing

    mouse pointer disappearing mostly in safary and its back when i change to direfent tags