Execute a transaction in back ground

Hi,
How can i execute an user defined transaction in background
This transaction does not have an selection screen.

hi rajitha,
try this code
hi
use this table
btcevtjob
and a sample code is also there
Try this
Execute the below program
tables: btcevtjob.
parameters: job like btcevtjob-jobname.
data: count like btcevtjob-jobcount.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
DELANFREP = ' '
JOBGROUP = ' '
jobname = job
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
JOBCLASS = JOBCLASS
IMPORTING
JOBCOUNT = COUNT
CHANGING
RET = RET
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write:/ sy-subrc.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
ARCPARAMS = ARCPARAMS
authcknam = authcknam
COMMANDNAME = ' '
OPERATINGSYSTEM = ' '
EXTPGM_NAME = ' '
EXTPGM_PARAM = ' '
EXTPGM_SET_TRACE_ON = ' '
EXTPGM_STDERR_IN_JOBLOG = 'X'
EXTPGM_STDOUT_IN_JOBLOG = 'X'
EXTPGM_SYSTEM = ' '
EXTPGM_RFCDEST = ' '
EXTPGM_WAIT_FOR_TERMINATION = 'X'
jobcount = count
jobname = job
LANGUAGE = SY-LANGU
PRIPARAMS = ' '
REPORT = ' '
VARIANT = ' '
IMPORTING
STEP_NUMBER = STEP_NUMBER
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 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write:/ sy-subrc.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
AT_OPMODE = ' '
AT_OPMODE_PERIODIC = ' '
CALENDAR_ID = ' '
EVENT_ID = ' '
EVENT_PARAM = ' '
EVENT_PERIODIC = ' '
jobcount = count
jobname = job
LASTSTRTDT = NO_DATE
LASTSTRTTM = NO_TIME
PRDDAYS = 0
PRDHOURS = 0
PRDMINS = 0
PRDMONTHS = 0
PRDWEEKS = 0
PREDJOB_CHECKSTAT = ' '
PRED_JOBCOUNT = ' '
PRED_JOBNAME = ' '
SDLSTRTDT = NO_DATE
SDLSTRTTM = NO_TIME
STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS
STRTIMMED = ' '
TARGETSYSTEM = ' '
START_ON_WORKDAY_NOT_BEFORE = SY-DATUM
START_ON_WORKDAY_NR = 0
WORKDAY_COUNT_DIRECTION = 0
RECIPIENT_OBJ = RECIPIENT_OBJ
TARGETSERVER = ' '
DONT_RELEASE = ' '
TARGETGROUP = ' '
DIRECT_START = DIRECT_START
IMPORTING
JOB_WAS_RELEASED = JOB_WAS_RELEASED
CHANGING
RET = RET
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.
ENDIF.
write:/ sy-subrc.
note: pre-requiste for doing this is execute the report and save the variant for the report which you need to execute in bg.
after doing this program execute it give a jobname for this.
then provide the report , variant and authcknam in job_submit FM.
*go to sm37
*enable the option scheduled
*and then enter the period for which u need to execute ur program in background providing necessary details such as jobname , time and date etc
With regards
S.Janagar

Similar Messages

  • How to Run a Custom Transaction in Back Ground after give the Input?

    Hi,
        I have problem that how to execute a Custom Transaction in Back Ground after end user will save a variant for input. In my Transaction there is no menu to save a Variant & to Execute in Back Ground.
    Please suggest me how to do this in my Custom Transaction.

    Hi Ramana,
    what kind of report you want to  execute? the report is Executable Report or Modulepool prog. ??
    if it is a executable program so when u execute (F8) from SE38 when u find the selection-screen in the menu bar ->Program ->Execute in Background( F9) option exits there u can schedule your report in Background or else use toce SM36 ( Define Background Job).
    Why you want to run it in background with transaction code if you have this options?
    Regards,
    Sunil kairam.

  • Field missing when running the KSB1 transaction in Back ground

    Hi,
    With the help of  Zreport am executing the KSB1 transaction in back ground and after execution of KSb1 am retrieving the report output and am displaying.
    Issue is when am running Zreport in back ground the the output of KSB1 is giving the output by hiding the last column, where as am running Zreport in foreground the output of KSB1 giving the output with out hiding last field. Please guide me why the variance is coming in output when am running the Zreport in background........ and please advise me to rectify the problem....

    In background it cant be displayed if report width is more than 255 chars. Check line size.
    Satya

  • CALL transaction in back ground

    Hi
    i am writeing the bdc program for iw32 transaction using call transaction
    iw32 for updating the status of a order
    it is working good in all screesns mode and error mode
    but it is not updating the status of a order in no screens mode
    any answers

    In all screens mode you should be doing nothing but pressing enter until the end of processing.
    But as you had said you check something to set the status, if I ain't wrong I think you should go through your code so that even the status is set when the transaction is run and you need to only keep pressing enter to go through all the screens.
    Check where in all screens mode where user interaction is being done by you and try modifing the code. Try putting in code for the status selection. Then it will not give any error and will go through without any user-interaction.
    Hope what I had to say is useful to you.
    3Cheers,
    Raga Suman.

  • Execute job in the back ground - own layout

    Hi All,
    Is there a way to Execute in the Background using the layout I saved?
    Thanks

    Hi,
    To achieve the functionality, you have split the program in two different parts.
    In first program, pop up the dialog box and pass the value to second program and submit the second program for background processing.
    Check the links below:
    http://www.sapdev.co.uk/reporting/rep_submit.htm
    How do JOB_OPEN, JOB_SUBMIT, & JOB_INSERT Work?
    Regards,
    Ni3

  • Back ground execution of t.code with variant !!

    Hi Team,
              I need excute the Z transaction code ( which is assigned to to stnadard program).
      How can i execute this transaction in back ground with the given specified variant.  (program should be executed for every 5 mts).
    Regards
    Badari Talanki

    Hi Badari,
    when you set the Background Job via <b>SM36</b>, you can mention the Variant. and set the time , so that the report will run for every 5 minutes with the mentioned variant. Check it.
    Regards
    Vijay

  • Call transaction method in back ground Processing?

    HI Friends,
    I am working on interface program to post documents of 309 movement type into MIGO transaction .
    my program is executing succesfully when i am processing  in fore ground.
    but when i am processing in background it is giving error .
    can any help in this requirement?
    *Solution rewarded*

    My Program will do transfer Posting from material to material.
    when i am executing the program in back ground mode The Program statement call transaction fails with the following error
    CALL_TRANSACTION MIGO_TR Return code = 1,001  RECORD:          0
    S
    Field GODYNPRO-ACTION . is not an input field
    S
    Field GODYNPRO-REFDOC . is not an input field
    S
    Field GOITEM-UMMAKTX . is not an input field
    S
    similar statement when executing in foreground it is posting document succesfully.
    kindly revert back for any other information.

  • Any restictions on back ground job when submit the session?

    Hello friends
    below is my code part. problem is when i execute this program in back ground the data is not picking from APQI. but in fore ground it is picking . for this SESSION submission in back ground am i missing any thing here. please suggest me , any restiction is their in back ground? if possible please send a sample code to submit SESSION automatically in background.
        SUBMIT rsbdcsub AND RETURN
                        USER sy-uname
                        WITH mappe    =  p_group
                        WITH von      =  sy-datum
                        WITH bis      =  sy-datum
                        WITH z_verarb =  'X' .
          SELECT userid credate groupid qstate FROM apqi
             INTO TABLE it_apqi
             WHERE userid  = sy-uname
             AND   credate = sy-datum
             AND   groupid = p_group
             AND   qstate  = 'E'.              "Only look for 'Error' status
       DESCRIBE TABLE it_apqi[] LINES temp.

    Codes for Submitting the session through RSBDCSUB (via Job)...
    " The function module JOB_OPEN is called to create the job.
        call function 'JOB_OPEN'
             exporting
                  delanfrep        = 'X'  "Delete job after execution
                  jobname        = fv_jobname  "Job name
             importing
                  jobcount         = fv_jobcount  "Internally generated
             exceptions
                  cant_create_job  = 1
                  invalid_job_data = 2
                  jobname_missing  = 3
                  others           = 4.
        if sy-subrc = 0.
          submit rsbdcsub
                 with       mappe = v_filec
                 with            von = sy-datum      "From
                 with            bis = sy-datum      "To
                 with     z_verarb = 'X'
                 with         fehler = ' '
                 with      batchsys = space
                 with         logall = ' '
                 via  job          fv_jobname
                      number       fv_jobcount
                 and return.
          call function 'JOB_CLOSE'
               exporting
                    jobcount             = fv_jobcount
                    jobname              = fv_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
                    others               = 8.
    Hope this helps!
    Edited by: Vin on Jun 4, 2009 10:58 AM

  • Problem in Back Ground Job

    Hi Experts,
    I want to execute a program in Back ground but my program has selectionscreen.
    I don't want to Provide Variant for this screen that's why i am passing these values Thru INITILIZATION event.
    But Background is not moving forward. It is waiting for I/p.
    Can you please help me on this.
    Thanks,
    Murali Krishna K

    Murali,
    For a program to be executed in background you need to create a variant and provide the variant name in the def. of the background job. giving the values at INITIALIZATION  will NOT work.
    On the second thought, you might have declared your parameters as OBLIGATORY. Take out that and make them optional. Now you schedule this in background without a variant and give the values in the INITILIZATION event.
    Regards,
    Ravi
    Note : Please close the thread of the issue is resolved.
    Message was edited by: Ravikumar Allampallam

  • Avoid page break in back ground execution of report

    Hi Friends,
    Normally when we execute any report in back ground it will have page break. eg: FL3N
    But we dont see this in foreground execution of a report.
    may i know how to avoid this page break when we execute in background.
    Thanks in advance
    NNS

    Hi Badari,
    when you set the Background Job via <b>SM36</b>, you can mention the Variant. and set the time , so that the report will run for every 5 minutes with the mentioned variant. Check it.
    Regards
    Vijay

  • What is back ground processing

    what is difference between background and fore ground processing of a report. what are the various methods to execute a report in back ground.  and when we need schedule a report in back ground how shall we handle selection screen parameters.
    thanx in advance.

    Hi,
    <u><i>Background Processing</i></u>
    There are two ways for you to handle,
    one manually setting up the job through SM36 which is better and convinient,
    secondly through program using FM's JOB_OPEN, SUBMIT, JOB_CLOSE.
      Find below steps in doing both:
    Procedure 1:
      1. Goto Trans -> SM36
      2. Define a job with the program and variant if any
      3. Click on start condition in application tool bar
      4. In the pop-up window, click on Date/Time
      5. Below you can see a check box "Periodic Job"
      6. Next click on Period Values
      7. Select "Other Period"
      8. Now give '15' for Minutes
      9. Save the job
    In SM37 u can check the status of the jobs that u have assigned to background...
    Here u mention the job name or the report name to check the status of the job...
    After mentioning the job name or program name u just execute it.. ( without any name also u can execute then it gives u all the jobs set by your user name..
    the status colud be released,active,finished etc..
    Procedure 2 via Program:
    Below is a sample code for the same. Note the ZTEMP2 is the program i am scheduling with 15mins frequency.
    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
          L_RELEASE(1) TYPE c.
       CALL FUNCTION 'JOB_OPEN'
         EXPORTING
           JOBNAME                = 'ZTEMP2'
        IMPORTING
          JOBCOUNT               = P_JOBCNT
        EXCEPTIONS
          CANT_CREATE_JOB        = 1
          INVALID_JOB_DATA       = 2
          JOBNAME_MISSING        = 3
          OTHERS                 = 4.
       IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
       SUBMIT ZTEMP2 VIA JOB 'ZTEMP2' NUMBER P_JOBCNT
              TO SAP-SPOOL WITHOUT SPOOL DYNPRO
              WITH DESTINATION = 'HPMISPRT'
              WITH IMMEDIATELY = SPACE
              WITH KEEP_IN_SPOOL = 'X' AND RETURN.
       CALL FUNCTION 'JOB_CLOSE'
         EXPORTING
           JOBCOUNT                          = P_JOBCNT
           JOBNAME                           = 'ZTEMP2'
           STRTIMMED                         = 'X'
           PRDMINS                          = 15
        IMPORTING
          JOB_WAS_RELEASED                  = L_RELEASE
        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.
       ENDIF.
    Hope the above helps you.
    Regards
    Reshma

  • Back Ground Job- Lay out settings

    Hi Frnds,
      We will be executing some big reports in the Back ground  , now before executing the report i have to select the Lay out , is there any option for this .??
    And when i execute the report in back ground i get the data Page wise , but when i execute the report in foreground , i get the report continuous in one page .
    Is there any option of getting that report continuously in one page when i execute in back ground ??
    Regards
    Rakesh

    Hi Rakesh
    Output of background program are totally based on Printer settings you have selected.
    Take help of your BASIS team to configure a new printer specially for background job, which can display full report in one page.
    Basis team is only responsible for it.
    try and revert

  • BACK GROUND FILE CREATION

    IF SY-BATCH = ' X'
    IF NOT i_down[] IS INITIAL.
            OPEN DATASET p_pf_01 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
            LOOP AT i_down.
              v_down-co_name = i_down-co_name.
              v_down-plant   = i_down-plant.
              v_down-d_adr   = i_down-d_adr.
              v_down-matnr   = i_down-matnr.
              v_down-maktx   = i_down-maktx.
              v_down-mat_typ = i_down-mat_typ.
              v_down-str_loc = i_down-str_loc.
              v_down-d_sotxt = i_down-d_sotxt.
              v_down-lifnr   = i_down-lifnr.
              v_down-name1   = i_down-name1.
              v_down-kunnr   = i_down-kunnr.
              v_down-pspnr   = i_down-pspnr.
              v_down-vbeln   = i_down-vbeln.
              v_down-posnr   = i_down-posnr.
              v_down-d_taxid = i_down-d_taxid.
              v_down-meins   = i_down-meins.
              v_down-budat   = i_down-budat.
              v_down-xblnr   = i_down-xblnr.
              v_down-rmenge  = i_down-rmenge.
              v_down-imenge  = i_down-imenge.
              v_down-bwart   = i_down-bwart.
              v_down-bmenge  = i_down-bmenge.
              v_down-mblnr   = i_down-mblnr.
              v_down-remak   = i_down-remak.
              CONCATENATE  v_down-co_name
                           v_down-plant
                           v_down-d_adr
                           v_down-matnr
                           v_down-maktx
                           v_down-mat_typ
                           v_down-str_loc
                           v_down-d_sotxt
                           v_down-lifnr
                           v_down-name1
                           v_down-kunnr
                           v_down-pspnr
                           v_down-vbeln
                           v_down-posnr
                           v_down-d_taxid
                           v_down-meins
                           v_down-budat
                           v_down-xblnr
                           v_down-rmenge
                           v_down-imenge
                           v_down-bwart
                           v_down-bmenge
                           v_down-mblnr
                           v_down-remak
                     INTO
                         i_csv_file-csv_record
                     SEPARATED BY c_coma.
              IF p_pf_01 IS NOT INITIAL.
                TRANSFER i_csv_file-csv_record TO p_pf_01.
                IF sy-subrc = 0.
                  l_flag1 = 'X'.
                ENDIF.
              ELSE.
                MESSAGE s045(zz) WITH text-039.
              ENDIF.
            ENDLOOP.
            CLOSE DATASET p_pf_01.    
    ENDUIF.
    When i execute that Logic in Back Ground , i am not getting file in APP server
    could any one help on this pls

    Hi ,
    Are you giving any value to field  p_pf_01 or not? May this field is used for Presentation server file.
    Put a break-point at Open Dataset statement and debug.
    Hope this helps you..
    Regards,
    Ashok

  • Error in Back ground job schedule for call transaction

    Hi Experts ,
    I have a Program which as Three BDC in it . 1 - to create contact person , 2- customer 3-sales order
    Using call transaction if i run with all screens and no screens it's running fine..
    if i schedule it background job
    conact and customer works fine but sales order not works ..
    can anyone give me the solution ?

    Hi Phani and Pavan ,
    It works Fine for Back ground anf fore ground i.e ( N and A )  sales order is created here .
    but Sales order not created when i schedule it in back ground  as
    Program - execute in back ground  .
    sales not created when i schedule it in background job  only using SM36 or Program - execute in back ground  ?
    Edited by: Pradeep Annaiah on Jan 13, 2009 5:29 AM

  • Custom Transaction code .... back ground run

    Hi All,
    We have custom transaction ZPRS(Module pool program)... which contains selection screens ..
    usually user run give the values on selectin screens and press submit.. it displays the list of values on table control..
    But user asking instead of table control .. after selection screen input they have run in BACK GROUND.
    Please suggest how to that... I know submit is for executable program,...
    Thanks...
    reddy.

    >
    Dave L wrote:
    > so, a little very basic analysis here....
    The first bit of analysis would include looking at the date of the initial post
    Rob

Maybe you are looking for

  • Re : select-options in abap objects

    Dear friends, I want to give select-options in abap-objects program. How to give that. Thanking You with regards, Mani

  • Calendar.app won't sync with Google calendar after Yosemite update

    I recently clean installed Yosemite on my 11" Macbook Air and my Google calendar will not sync with Calendar.app. Everything else on my Google account syncs with no problem, but the calendar refuses. I tried with another google account and had the sa

  • TS3694 iTunes 11.1.4 I install issue

    During iTunes 11.1.4 I received the following error message "R6034, Apple attempted to load C runtime library". I removed iTunes and tried reloading only to get same error. What should I do?

  • Unable to use Page clause in EQL Endeca 3.0

    Hello All, I am trying to map Top 25 most visited locations from the data I have. I wrote following query which has correct syntax but I am unable to get the Top 25 results. When the query get processed I am getting following warning: Query: RETURN T

  • SSL Load Balancing (Java applets problem)

    Hi, I have implemented loadbalancing of two webservers using CSS 11503. Servers are containing SSL pages which need to be loadbalanced. I have tried configuring the content rule for ssl using port 443 application ssl advanced-balance ssl commands.The