Future date in background job

hi experts,
               can anybody pls give me sample code for running proram in backgrnd mode <b>(not immediate run but a future time), moreever it should be done thru programs not sm36 and 37.</b>
thanks
pankaj

Hi,
You need to use
JOB_OPEN
JOB_SUBMIT
JOB_CLOSE
In FM JOB_CLOSE, there is a parameter SDLSTRTDT where you can pass the date.
Best regards,
Prashant

Similar Messages

  • Error messege- Please enter a valid date in Background Job

    Hi all,
    background job which is scheduled in sm37 is giving error for dated 01.01.2009 to 30.01.2009.
    But before 31.12.2008 it was working fine
    error messege-
    This is happening in Production and developement client.
    While running the report it showing the error messege- Please enter a valid date
    One function module is used in the report for geting fiscal year from date.
    it is showing the following error messege for perticular date range- 01.01.2009 to 30.01.2009.
    GM_GET_FISCAL_YEAR
    Error
    Fiscal year variant V3 not defined or maintained for date 01.01.2009
    Thanks
    Susanta

    Hi,
    Did you put the date fields to be dynamic in your variant? i.e if in your variant you specified date range of last year, this will not work for this year and eventually give you an error message that the date is not valid...
    Dev.

  • Report to be generated,mailed based on Reminder date through background job

    Hi All,
    We have a requirement where in I need to mail the "Task Monitoring" report to the Personnel administrator based on the reminder date set for different task types mentioned in IT 0019.
    I am using T-code sm36 to set the background job on a monthly basis.
    I am able to mail the report for as per the reminder dates set in the "Task monitoring" report. But I want to know how the system will pick the reminder date on a monthly basis to mail the report accordingly.
    Eg. For the month of Jan, i have set the reminder dates falling in that very month in the selction output of "Task Monitoring" report and mailed.
    Now I want sytem to automatically pick the reminder dates and mail the report. Pls let me know the steps to make the sytem pick the next reminder dates on its own on monthly basis.
    Points would be rewarded for appropriate solutions.
    Thanks.
    Deepali

    Hi,
    After pressing save button to create a variant, system takes me to the Variant Attributes screen. There I select on "Selection variable" accross "Reminder date". I clcik on the "Dynamic date calculation".
    Then when i go to the "Name of Variable column" and i  select "First day of the month" from the drop down. Can u pls explain me how this would help me capture the "Reminder dates" on monthly basis falling on each month when i mail the report on monthly basis.
    Eg. For the month of Jan, i need all the reminder dates falling in this month.
    For the month of Feb, i need all the reminder dates falling in this month. Like this, It goes on all for all the months.
    Thanks.

  • CHaRM Reporting Data Collection Background Job

    Hi CHaRM Gurus,
    I saw lot of thread about data collection for CHaRM Reporting using /tmwflow/Config_lock. Question is do we need to run everytime before run the report or is there anyway can schedule in background to collect data Asynch. There is a SAP Note 1269192 applied in both Solution Manager and Managed system. If any job to schedule what job and the ID to use run what authorization. Because this job need to collect transport request and objects, so definitely required different authorizations.
    Thanks
    RS

    Hi,
    The job is SM:TMWFLOW_CMSSYSCOL, program  /TMWFLOW/CMSSYSCOL2. The data collector program requires additional authorizations for Read RFC user you have defined for client '000' of the satellite systems.
    Authorization object: S_TRANSPRT
    ACTVT = 03 and TTYPE = <*> (full authorization)
    Refer to note 881553 for authorizations.
    Thanks & Regards,
    Kriti Bhalla

  • Error in active background jobs

    Hi All,
    i facing problem while cosing the job
    i have written the code
          IF NOT p_imm IS INITIAL.
            CALL FUNCTION 'JOB_CLOSE'
              EXPORTING
                jobcount             = l_f_jobcount
                jobname              = l_f_jobname
                strtimmed            = l_flg_start_sofort
              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.
    COMMIT WORK .
    and it is not showing any error and it should finished the job in sm37 but i am always getting the ststus active rather than finished.
    please suggest what could be the reason
    Thanks,
    Madhu

    hi all,
    please help me on this..
    when there is no data then background job finish the job and in the job log it shows thst no valid data for selection. but if there si any data ... the job status stil active and it never get finished.... and finaly it get cancelled.
    even while dubugging it never shows sy-subrc value other than 0. even when i run the background job manually for the submit sdt program it finish the job. I don't understand the reason why it is in active stage while executing id dialog.
    Please mention if there is any parameter value missing ..
    my code as follows..
    do n times.  "n muber of jobs
    Start Immediately
          IF NOT p_imm IS INITIAL.
    l_flg_start_sofort = 'X'.
    (1)Open the job
          CALL FUNCTION 'JOB_OPEN'
            EXPORTING
              jobname          = l_f_jobname
            IMPORTING
              jobcount         = l_f_jobcount
            EXCEPTIONS
              cant_create_job  = 1
              invalid_job_data = 2
              jobname_missing  = 3
              OTHERS           = 4.
          IF sy-subrc <> 0.
            MESSAGE e032(sxmsf) WITH l_f_jobname.
          ENDIF.
    (2)Report start under job name
          SUBMIT (g_c_prog_c1_lo)
                 WITH s_partn IN r_partn
                 WITH s_parro IN s_parro
                 WITH s_grvsy IN s_grvsy
                 WITH s_lgreg IN s_lgreg
                 WITH p_updab = p_updab
                 WITH p_updbi = p_updbi
                 WITH p_enqal = p_enqal
                 TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                 VIA JOB l_f_jobname NUMBER l_f_jobcount AND RETURN.
    *(3)Job closed when starts Immediately
          IF NOT p_imm IS INITIAL.
            CALL FUNCTION 'JOB_CLOSE'
              EXPORTING
                jobcount             = l_f_jobcount
                jobname              = l_f_jobname
                strtimmed            = l_flg_start_sofort
              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.
          COMMIT WORK .
          ADD 1 TO g_cnt_job.
          l_r_tbtcjob-jobcount = l_f_jobcount.
          l_r_tbtcjob-jobname = l_f_jobname.
          l_r_tbtcjob_previous = l_r_tbtcjob.
          IF NOT l_flg_first_job IS INITIAL.
            g_v_tbtcjob_first = l_r_tbtcjob.
          ENDIF.
          CLEAR: l_flg_first_job.
        ENDDO.
    thanks

  • 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 jobs are scheduled in future date

    Hi
    A system which is used by a customer test system was installed and scheduled the jobs in 2010( in future date).
    Now we have changed the date to current date. But still all the background jobs are in future date.
    There are around 500 jobs are scheduled. And it not possible to reschedule one by one.
    Is there any way workaround to change it back to current date format.
    Best Regards,
    Jai

    Dear Jai,
    The jobs scheduler should have this dates changed to current.  If its a third party system which are running these batches, then be careful to convey the same message to the 3rd party.
    If its in SAP, then the schedule change date should execute your jobs. At the same time, ensure that the transports between the test systems match to the destination.
    Do let me know for any clarification.
    Thanks
    Madhu

  • How to get data from the called program using SUBMIT in a background job?

    Hi Experts,
    I've a program which creates a background job using JOB_OPEN and JOB_CLOSE function modules.
    Between the above function modules I need to call a program using SUBMIT VIA JOB statement.
    My problem is, How do I fetch some data in an internal table in the called program to the calling program after the SUBMIT statement?
    I tried to EXPORT and IMPORT the data, but they are giving a failed sy-subrc when using this background job.
    Kindly let me know your inputs and valuable suggestions.

    Kumar,
    When we execute a program as a background job then the output will be sent to Spool which needs to be fetched again.I guess we need to use Submit via spool as mentioned by Rajat.
    Check these threads to get some idea
    submit report to spool & import spool id
    Re: Generate Spool for a report
    K.Kiran.

  • Background job not updating data for some steps of program

    We have created a custom program and submitting the standard program RPRCCC_READ_KR1025
    which is used for conversion of AMEX credit card files.
    Since this program can update data for 1 company id at a time,we have created a background job
    for that program with 10 steps and 10 variants of data related to 10 different company codes.
    when this job is executed it is not updating data for all the 10 files , sometimes it updates 5,7,etc...
    If we execute the other files which didnt update in job manually they are getting updated.
    All the files executed with that program can be seen in PRTA transaction.
    Regards,
    Gautham.
    Edit: Solved.
    Since the standard program updates the database every time with commit work
    there should be some time until the next database update,so we can use wait command
    after the submit statement which will do the trick.
    Edited by: Gautham Vangaveti on Aug 5, 2010 7:20 PM

    Hi,
    I mean B(Sub Assembly)
    Item Rollup Flag
    A No
    --B                       Yes
    ---B1 No
    ---B2 No
    ---B3 No
    --C                      Yes
    In this case when we run cost rollup by giving item A, Oracle will consider below structure.
    A
    --C
    Regards,
    Sarvottam.

  • Format of Date Field in RAR background job history page

    Hi Everyone,
    Is it possible to customize the format of the fileds: "last run", "next start" in RAR background job history page?
    By default it is in the format yyyy-mm-dd.
    I am just wondering my customer's requirement is possible or not?

    Hi,
    There is no option to set the date format in the Configuration settings. Check the FM /VIRSA/ZCC_GET_STATREC_DATA which has the CALL FUNCTION 'GET_SYSTEM_TIMEZONE'. RAR will read the time from the system.
    You may look at formatting the the date format here.
    Hope this helps!!
    Warm Regards,
    Raghu

  • Background Job cancelling with error Data does not match the job definition

    Dear Team,
    Background Job is getting cancelled when I run a Job on periodically but the same Job is executing perfectly when I run it manually(repeat scheduling) .
    Let me describe the problem clearly.
    We have a program which picks up files from an FTP server and posts the documents into SAP. We are scheduling this program as a background Job daily. This Job is running perfectly if the files contain no data. But if the file contains data the JOb is getting cancelled with the following messages.
    And also the same Job is getting executed perfectly when repeat scheduling is done ( even for files with data).
    Time     Message text                                                                       Message class Message no. Message type
    03:46:08 Job PREPAID_OCT_APPS2_11: Data does not match the job definition; job terminated        BD           078          E
    03:46:08 Job cancelled after system exception ERROR_MESSAGE                                      00           564          A
    Please help me in resolving this issue.
    Thanks in advance,
    Sai.

    hi,
    If you have any GUI function modules used in the program of job
    you cannot run it in background mode.

  • Error messege in Background Job(SM37) -  Please enter a valid date

    Hi all,
    background job which is scheduled in sm37 is giving error for dated 01.01.2009 to 30.01.2009.
    But before 31.12.2008 it was working fine
    error messege-
    This is happening in Production and developement  client.
    While running the report it showing the error messege- Please enter a valid date
    One function module is used in the report for geting fiscal year from date.
    it is showing the following error messege for perticular date range- 01.01.2009 to 30.01.2009.
    GM_GET_FISCAL_YEAR
    Error
    Fiscal year variant V3 not defined or maintained for date 01.01.2009
    Thanks
    Susanta

    Hi,Because this datein the past

  • Passing data from a background job to RFC calls in different App server

    The program i am working on can be explained in the following steps:
    Step A- We use a standard program that is executed as a background job and the standard program obtains some data for a particular scenario.
    Step B - The job(standard program) during its execution creates many RFCs executed as dialog work processes on various application servers and processes data.In the RFCs various exits are executed.
    We currently write data to database(Z table) in Step A and retreive data in exits in Step B to access the information written to DB(Z table). We want to eliminate writing to database since it consumes time.
    Is there any solution apart from writing data to database and retreiving the same.
    I am not sure if we can use ABAP memory or SAP memory to access the information in the exits since they are executed on different App servers.

    We have not been able to arrive at a solution to the below, any solutions / inputs will be rewarded.

  • Error in background job of downloading data to  PC

    Hi Gurus,
       I hv created a report for downloading data to PC using
    GUI_DOWNLOAD FM when scheduling  job in background
    job is getting canceled...................
    give me some solution....

    thnaks friend.i hv used DATASET as u said...............
    But I M getting dump
    FILE IS NOT OPEN
    this is my code
    TYPES:BEGIN OF T_MARD,
            MATNR LIKE MARD-MATNR,
            WERKS LIKE MARD-WERKS,
            LGORT LIKE MARD-LGORT,
            LABST LIKE MARD-LABST,
            MAKTX LIKE MAKT-MAKTX,
         END OF T_MARD.
    ***********WORK AREAS**********
    DATA: WA_MARD TYPE T_MARD,
          WA_MARD1 TYPE T_MARD.
    DATA:BEGIN OF IT_MARD1 OCCURS 0,
            MATNR(18),
            WERKS(4),
            LGORT(4),
            LABST(13),
            MAKTX(40),
         END OF IT_MARD1.
    TYPES : BEGIN OF TY_BAT,
              LINE(100) TYPE C,
            END OF TY_BAT.
    *********INTERNAL TABLES*******
    DATA:IT_MARD TYPE STANDARD TABLE OF T_MARD INITIAL SIZE 0 WITH HEADER LINE .
    types: BEGIN OF ITAB1,
                FIELD(100),
          END   OF ITAB1.
    DATA : IT_BAT TYPE TABLE OF TY_BAT,
           WA_BAT TYPE TY_BAT,
           wa_itab1 type itab1.
    data : it_tab type table of ALSMEX_TABLINE with header line.
    *DATA: FILENAME1 TYPE STRING valu.
    *DATA: FILENAME1(500).
    DATA: FILENAME1 TYPE RLGRAP-FILENAME .
    LOOP AT IT_MARD1.
          CONCATENATE IT_MARD1-MATNR IT_MARD1-LABST IT_MARD1-MAKTX
                      INTO wa_ITAB1    SEPARATED BY ' '.
          APPEND wa_itab1 to IT_tab.
          CLEAR wa_ITAB1.
        CLEAR WA_MARD.
      ENDLOOP.
      CONCATENATE 'D:\STOCKINH\'  SY-DATUM '.TXT' INTO FILENAME1.
    open dataset filename1 for output in binary mode." ENCODING DEFAULT.
    IF sy-subrc = 0.
    EXIT.
    ENDIF.
    LOOP AT it_tab into wa_itab1.
    TRANSFER wa_itab1 TO filename1.
    CLEAR wa_itab1.
    ENDLOOP.
    close dataset filename1.
      MESSAGE S001(38) WITH 'Files Generated'.
      WA_BAT = 'ftp -s:d:\ftp\ftp_upload.txt'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR FILENAME1.
       FILENAME1 = 'D:\STOCKINH\ftp_upload.BAT'.
    open dataset filename1 for output in binary mode." ENCODING DEFAULT.
    IF sy-subrc = 0.
    EXIT.
    ENDIF.
    LOOP AT it_bat INTO wa_bat.
    TRANSFER wa_bat TO filename1.
    CLEAR wa_bat.
    ENDLOOP.
    close dataset filename1.
      CLEAR:  IT_BAT.
      REFRESH IT_BAT.
      WA_BAT-LINE = 'open 10.100.103.199'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'epossync'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'sync@1234'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'lcd D:\STOCKINH\20080201.TXT'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'cd /home/epossync/AMIT'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'binary'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'hash'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'put D:\STOCKINH\20080201.txt'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = ' '.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'bye'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
    CLEAR FILENAME1.
    FILENAME1 = 'D:\STOCKINH\ftp_upload.txt'.
    open dataset filename1 for output in binary mode." ENCODING DEFAULT.
    IF sy-subrc  = 0.
    EXIT.
    ENDIF.
    LOOP AT it_bat INTO wa_bat.
    TRANSFER wa_bat TO filename1.
    CLEAR wa_bat.
    ENDLOOP.
    close dataset filename1.

  • Data capturing in background job scheduling

    HI,
    I hava a specific requirement in background job scheduling.
    in my layout i have to show <b>pagenumber / total number of page numbers.</b>
    for that iam useing a variable with value '$$$' and iam replacing this variable with total number of pages..
    when we run in foreground it is working fine. but in background the variable is not being replaced..
    how can i modify the data in spool..

    REPORT ztest no STANDARD PAGE HEADING
                                     MESSAGE-ID zfi
                                     LINE-COUNT 65(1)
                                     LINE-SIZE 165.
    DATA:        v_sum(3)  TYPE c VALUE'$$$'.
    CONSTANTS:  c_slash    TYPE c VALUE '/'.        "Stores /
    parameters : p_1 type c.
    START-OF-SELECTION.
      WRITE : 'Hi'.
      SKIP 80.
      WRITE : 'Helloo'.
    END-OF-SELECTION.
    *To print the total no. of pages in report heading.
      PERFORM f_replace_totpage.
      TOP-OF-PAGE
    TOP-OF-PAGE.
    Display Standard Report Header
      PERFORM f_report_header.
    *&      Form  f_replace_totpage
         To print the total no. of pages in report heading.
    FORM f_replace_totpage .
      DATA: l_tot_page(3) TYPE c,
            l_pgcnt TYPE i,
            l_licnt TYPE i VALUE '3'.
    Assign value of total number of pages into l_tot_page.
      l_tot_page = sy-pagno.
    To replace the value of v_sum ($$$) by total number of pages after
    reading the content of fourth line of each page.
      WHILE l_pgcnt LE l_tot_page.
        l_pgcnt = l_pgcnt + 1.
        READ LINE l_licnt OF PAGE l_pgcnt.
        REPLACE v_sum WITH l_tot_page INTO sy-lisel.
        MODIFY LINE l_licnt OF PAGE l_pgcnt.
      ENDWHILE.
      CLEAR: l_tot_page,
             l_pgcnt,
             l_licnt.
    ENDFORM.                    " f_replace_totpage
    *&      Form  f_report_header
          Report Header display
    FORM f_report_header.
      FORMAT COLOR 1 INTENSIFIED ON.
    Text-246 - Page:
    WRITE:/1 text-247, 45 text-241, 110 text-242, 150 space.
    WRITE:/1 text-243, sy-repid, 110 text-244, sy-datum, c_slash, sy-uzeit,
             150 space.
      WRITE:/1 text-245, sy-uname, 110 text-246, sy-pagno,c_slash,v_sum,
             150 space.
      FORMAT COLOR OFF.
      ULINE.
    ENDFORM.                    " f_report_header

Maybe you are looking for

  • Bluetooth with os 10.8.5 not working

    After updating the system the bluetooth is unresponsive.  In the preferences "on" and "discoverable" are checked. I cannot uncheck either of these boxes. What aroused my concern was that my track pad was listed as not connected but the basic function

  • IOS 6 FaceTime and iMessage

    I got my iPhone 4 just over a week ago and I had it for one day and then the new software came out so I was like awesome I will update it and I did on my iPhone and also on my iPod 4th gen but now I am having problems using FaceTime and iMessage. Whe

  • Select characters/symbols won't display on iPod 160GB Classic since restore

    I don't know if anyone has come across this yet or not. My new iPod 160GB Classic crashed after 1 week. Since restoring, I've noticed that certain characters/symbols won't display in artist/title names on my iPod that used to display just fine before

  • Add domain

    Hi, i tried to add an additional domain into our website, but BC system always said that domain already there, but i can't see it in domain list How can i resolve this problem?

  • In an approval workflow, how do I wait for either Approval or Reject to proceed?

    I have a field that will get set to Approved or reject in the form.  In the workflow I inserted the action "Wait for a field to change in current item".  The program is it reads: WAiT FOR "SOMEFIELD" TO EQUAL "VALUE" the value could be "Approved" or