RUN IN BACKGROUD

1. i use thiS FM to run in bachgroud but i have ERR.
2.i run submit(without FM) and it takes a lot of time what the solution. 
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING DESTINATION = 'LOCAL'
COPIES = COUNT
LIST_NAME = 'TEST'
LIST_TEXT = 'SUBMIT ... TO SAP-SPOOL'
IMMEDIATELY = 'X'
RELEASE = 'X'
NEW_LIST_ID = 'X'
EXPIRATION = DAYS
LINE_SIZE = 79
LINE_COUNT = 23
LAYOUT = 'X_PAPER'
SAP_COVER_PAGE = 'X'
COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
NO_DIALOG = ' '
IMPORTING OUT_PARAMETERS = PARAMS
VALID = VALID.
IF VALID <> SPACE.
  CALL FUNCTION 'JOB_OPEN'
       EXPORTING
            jobname          = name
       IMPORTING
            jobcount         = number
       EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            OTHERS           = 4.
  IF sy-subrc = 0.
    SUBMIT rm07mlbd TO SAP-SPOOL
    SPOOL PARAMETERS PARAMS
    WITHOUT SPOOL DYNPRO
     WITH datum IN r_datum
     WITH lgort IN r_lgort
     WITH werks IN r_werks
     WITH matnr IN r_matnr
     WITH xsum = 'X'
     VIA JOB name NUMBER number
     AND RETURN.
    IF sy-subrc = 0.
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                jobcount             = number
                jobname              = name
                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.
      IF sy-subrc <> 0.
      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.

Try this:
CALL FUNCTION 'JOB_OPEN'
       EXPORTING
            jobname          = name
       IMPORTING
            jobcount         = number
       EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            OTHERS           = 4.
  SUBMIT rm07mlbd
        VIA JOB name NUMBER number
        TO SAP-SPOOL
        SPOOL PARAMETERS params
        WITHOUT SPOOL DYNPRO
        WITH datum IN r_datum
        WITH lgort IN r_lgort
        WITH werks IN r_werks
        WITH matnr IN r_matnr
        WITH xsum = 'X'
        AND RETURN.
  CALL FUNCTION 'JOB_CLOSE'
       EXPORTING
            jobcount             = number
            jobname              = name
            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.
CALL TRANSACTION 'SMX'.
Regards.

Similar Messages

  • How can we let the program run in backgroud automatically?

    normally,we need to find peak off time run big program
    that read pooled table and slowly.
    How can we let the program run in backgroud automatically?
    BTW:before that pop a window just give runner a notice.

    Here is an example, try this one.
    REPORT ztest.
    PARAMETERS: p_vbeln LIKE vbak-vbeln,
                p_bkrun NO-DISPLAY.
    DATA: ls_vbak LIKE vbak.
    DATA: v_answer,
          v_jobcount LIKE tbtcjob-jobcount.
      IF p_bkrun IS INITIAL.
    *-- not background processing
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
                  textline1      = 'This may time out.'
                  textline2      = 'Do you want to run in background?'
                  titel          = 'Warning!!!'
                  cancel_display = space
             IMPORTING
                  answer         = v_answer.
        IF v_answer = 'J'.
    *-- run in the background
          CALL FUNCTION 'JOB_OPEN'
               EXPORTING
                    jobname          = 'ZTEST'
               IMPORTING
                    jobcount         = v_jobcount
               EXCEPTIONS
                    cant_create_job  = 1
                    invalid_job_data = 2
                    jobname_missing  = 3
                    OTHERS           = 4.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            EXIT.
          ENDIF.
    *-- submit the program in the background
          SUBMIT ztest
            WITH p_bkrun = 'X'
            WITH p_vbeln = p_vbeln
            USER sy-uname
            VIA JOB 'ZTEST' NUMBER v_jobcount AND RETURN.
    *-- close the job
          CALL FUNCTION 'JOB_CLOSE'
               EXPORTING
                    jobcount             = v_jobcount
                    jobname              = 'ZTEST'
                    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.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          EXIT.
        ELSE.
          CLEAR v_answer.
        ENDIF.
      ENDIF.
      CHECK v_answer IS INITIAL.
      SELECT SINGLE * FROM vbak
                      INTO ls_vbak
                     WHERE vbeln = p_vbeln.
      IF sy-subrc <> 0.
        WRITE:/ 'Invalid Order Id.'.
      ENDIF.
    END-OF-SELECTION.
      CHECK v_answer IS INITIAL.
      IF p_bkrun IS INITIAL.
        WRITE:/ 'Here is the result running the program in foreground.'.
      ELSE.
        WRITE:/ 'Here is the result running the program in background.'.
      ENDIF.
      WRITE:/ ls_vbak-vbeln,
              ls_vbak-vkorg.

  • QuickView (run in backgroud) - How to auto save data to local file

    I am using Quickview to extract data. I want to run the Quickview query in background and auto save the data extracted into local file (ASCII file). Currently when I specify File Store (as my Output Format) and enter a file name (e.g C:\Temp\test.asc). Upon completion of extraction there is a little window popup that need me to select data format (e.g DAT, ASC) and click <Transfer> button to proceed to save data into local file.
    Is there a way that I can save data into local file without have to manually select ASC data format and click <Transfer> button. I will not be  able to schedule my QuickView query to run in background if I can't resolve this problem.
    Note that I don't have access to ABAP programming, therefore this option is out.
    Thanks in advance to anybody who can share your expertise experience.

    Tyr Fm's
    1. WS_UPLOAD
    2. GUI_UPLOAD
    But using gui_upload and ws_upload can only upload data from txt.
    actualy we have software to convert pdf to text file it freely availabe in internet...
    after conversion you can use thesr fms.
    plzz reward points usefull
    Cheers,
    Chandru

  • Mail and Ipod run in backgroud

    I have an iphone 3g with os 3.1 ( not jailbreak) and also after this upgrade i have the same problem that i had with the previous version of os 3.0; when i make a call or i open the address book i see that the mail or ipod apps run in background. i have read that the os 3.1 should resolve this bugs but it isn't true, the bugs exist yet.

    What makes you think it's a bug? _3rd party_ apps cannot run in the background. Native Apple apps can, in some cases. The two apps you mention are supposed to run in the background. The iPod app so you can listen to music while doing other tasks (web browsing, etc.) and Mail to fetch mail at the specified interval or accept mail pushed to the phone.

  • Convert Spool to PDF and mail for the jobs not run in background.

    Dear All,
    I need to convert the spool job into pdf and mail as attachment for job not run in background.
    I am printing the bills  using the program  SD70AV3A to print the bills in a batch using the SUBMIT.
    But i am not using the spool options since its going to into waiting state in spool...and i need to change the printer properties to G
    to get the printer to print the reports as these jobs run in backgroud....but this solution is not acceptable solution.
    SUBMIT SD70AV3A
             WITH RG_KSCHL-LOW = 'ZRR'
             WITH RG_NACHA-LOW = '1'
             WITH PM_VERMO = '2'
             WITH PM_NSORT = '1'
             WITH RG_VBELN IN range.
    *        TO SAP-SPOOL
    *        SPOOL PARAMETERS print_parameters
    *        WITHOUT SPOOL DYNPRO
    *        VIA JOB name NUMBER number
    *        AND RETURN.
    so how do i get the spool number from the above after the job is submitted....and then convert into pdf and mail
    please suggest some solution. I have searched on net but most the solutions are say to run the job as background job...
    i have also looked into the program RSTXPDFT4 but it asks for the spool id ....how can i get spool id for the job that has been completed.
    please suggest some solution.
    Thanks
    Bhargava.

    Hi,
    Spool to PDF : FM 'CONVERT_ABAPSOOLJOB_2_PDF'
    Table TSP01 to get spool number
    You ,may need to convert OTF to PDF: FM CONVERT_OTF
    and the to binary : FM 'SMCS_XSTRING_TO_BINARY'
    To send mail use class: cl_document _bcs.
    Regards,
    Maria João Rocha

  • Spool get lost while job runs in background

    Hi
    We wrote a custom program where in we use two custom bapi's which were copied from original bapi's. When we run this interface program in backgroud, we have lost the spool. But when we run the test with limited data in foreground, it works fine. What are the possible solutions to correct this issue. Is there anyway we can force this spool to stay even though any BAPI fails in the middle or fail to provide proper error?
    Does this cause because of any memory leak? or insufficient memory? But there are no short dumps... in system.
    If we direct to print the spool during background job execution, it comes back with spool object not found error.
    Any help would be highly appreciated.
    Thanks
    Pandiri

    What exactly do you mean by: we have lost the spool? Did you check in SM37 (job overview), and the spool icon is missing, or are you looking at SP01 and you don't see any output / spool requests?
    When running program in background, are you providing the correct print parameters?
    When you run it in foreground, do you create a spool request during the report?
    Is report aborting when running in backgroud, because than you won't get any output / spool request, just a message stating that program was aborted / failed somewhere along the  line?
    Need some additional info before we can make an educated guess....

  • Running TimerTask

    I want to run TimerTask for fixed number of times. How can i stop the timer after running it certain no of times.

    You know how to increment a variable?I am facing difficulty in Stopping Schedular not in arriving at some condition (Incrementing variable) . So any help in stopping schedular is appreciated.
    I am using cancel() of Timer class. But, Some thread is running in backgroud and program is not terminating

  • F110- SAPF110 V, SAPF110S payment doc spliting

    Dear all,
    Please HELP!
    The issue is after f110, each vendor should have one payment document and this payment doc should group all type of doc type for open invoices. Yet, we got same payment document number twice. each payment document number group different doc type.I need to figure out the "PAYMENT DOCUMENT SPLITTING" issue after F110 via debugging
    I believe the main program for F110 is SAPF110V and SAPF110S is the program handle the posting. However, after I put the break point in SUBMIT SAPF110S AND RETURN in SAPF110V, then do step by step debug. Debugging doesn't go to SAPF110S. I am not sure what's wrong.
    Can anyone tell me the program name that post cleared document during F110 processing?
    Thank you very much in advance!!
    Molly

    I think you will not be able to debug F110 payment run, because in F110 payment run and proposal run are backgroud job.

  • Program not working in background

    Hello,
    I have a Z program that uses open dataset stmts that writes the file out into a specified directory in the appl server path.
    The prgram runs fine in foreground.  But when scheduled in background it fails.
    The job logs are :
    Dierctory does not exist 
    Job cancelled after system exception ERROR_MESSAGE
    The destination path can read, write and edit files in the directory.
    i tried to create .txt file & also without any extension.
    Can someone suggest me what i am doing wrong.
    Thanks
    Ricky

    Hi,
    Has anyone got any solution to this problem. I'm able to create forlder and write some files using ABAP program in foreground process and also in background with JDBG but the same doesnt happen when run in backgroud.
    The user id used to run the program has SAP ALL access so doesnt seem to be an  authorisation issue.
    I'm using function module TMP_GUI_CREATE_DIRECTORY to create folder and
      GUI_DOWNLOAD to write files in designated folders. The program doesnt have any BDC
    Help would be appreciated.
    Regards,

  • Can MC.9 be scheduled as background job?

    Hi experts,
       I would like to schedule MC.9 to run monthly. However, I find that no spool list is generated for the background job. I wonder if there is any way to make it to run in backgroud mode with result shown in spool. Or is there any similiar report which serves the same purpose?
       Thanks in advance. Points will be awarded for useful answers.

    If I am not wrong, Spool generation depends on your system settings. I am sure that I have executed all MC** reports and got the spool list. Chk your basis administrator for your system config.

  • Differentiate foreground and background processing

    Hi All,
    I want to execute a certain report in background. If the user tries to execute the program in foreground, the system should prompt him not to run it in foreground. In the same way, the message should not come if the program is run in backgroud.
    That is, the system should differentiate whether the program is run in foreground or in background. How to differentiate them?
    If i could differentiate, i could code a message to display when the user runs the program in foreground.
    Please help me.

    if sy-batch = 'X'  '' then it is runing in background other wise it is running in foreground
    <enter ur code here, to display when running in background>
    else
    <enter ur code here, to display when running in foreground>
    endif.
    Madhavi

  • Data (.dat) download and upload from a PC in background

    Hi All,
    In my program of R/3, I have used in last ws_download for downloading a .dat file (after processing) to my local machine and I have a similar ws_upload function module used in ISU to populate/update records in the (mirror image type) table in ISU(both different system and server).
    Now file is created in default path set and name is sy-datum with some variable, after my program in R/3 is executed and after this I am suppose to run upload function module program in ISU to update/populate data in the table maintained here. there are few condition and logic check before data is updated / inserted in ISU. here also it takes that file directly from the default set path and sync file name. (i.e. no user interaction for file & location selection)
    Now the problem is, the data file was not getting downloaded, when the program was run in back ground. and nor the program to upload works when run in back ground. so I came to know that these two function modules dont run in backgroud.
    So can anybody provide me with an alternative.
    Also these programs would be scheduled daily after 12 midnight in back ground mode only.
    Awaiting for your answers
    Thanks

    Hi All,
    Finally I was able to fix my problem of transferring data across the two diff servers.
    As suggested by few I used Open & Close dataset, to put data file on respective directory on application server. ( both R/3 and  ISU ).
    Now to transfer a data file, we wrote a shell script (xxx.sh) in the same directoy of application server, where the ftp command, target ip, user, dest loc, 'PUT' command & file name to be trasnferred coded. Then External Command (check out Tx sm69 & sm49 ) was assigned in SAP  to this shell script. 
    Now after my program executes Open dataset i.e writing a file on appl server, i call a function module SXPG_EXECUTE_COMMAND, where in  i pass external command name (note - authorization needed to execute this function module).
    Upon execution it will write on appl server (R/3)  and transfer the file to ISU appl server dest location.
    To add, prog now very well runs in background.
    Regards.
    Message was edited by:
            navin devda

  • Report Painter Report- Export to Excel

    Hi Gurus,
    How to export report painter report to excel.
    I could not use the following methoads
    1. Under Settings Option, Office Integration, MS Excel is provided. For Secutity reasons, it was blocked. So can't be used.
    2. Could not run as backgroud and store in spool, as it immidiately prints to the configured printer.
    Any other way to export to excel file?
    Thanks
    Reagrds

    Hi ...
    Have selected check box for expert mode and display navigation bar and office integration is it inactive or microsoft excel ?
    If you have selected check box for expert mode, you will notice there is an icon export report or simply press Shift + F2.
    Kumar

  • Convert spool to htm

    Hello,
    I'm looking for a way to convert a sap spool output to .htm format and send it with mail.
    The report is running in backgroud , so i can't
    use "exporting list to memory" in the submit command.
    Thanks,
    koby.

    Hi,
    1) Take the spool request no. from SP01
    2) Go to SE38 and use this program RSTXPDFT4 and enter the spool no. and convert it into PDF and store it in your hard disk with the path and download the file.
    3) This you can use it to attach in email offline and can send to the vendor.
    Best regards,
    Sridhar

  • Change app permissions

    I have just downloaded vRotate but touched do not allow access by accident.  I have deleted and reloaded from the clod but cannot change it to allow access to my videos.
    Can anyone tell me how to change this?
    Regards
    Jules

    cb_ca wrote:
    Thanks for confirming.
    BTW allandroid portedprogram, you can not change any of their permission,with the exceptof RUN IN BACKGROUD,and RUN WHEN MINIMIZED
    Do not forget that android program are made to run on Google android OS, and it is a well known fact that Google send all of their data to the NSA
    Using the Playbook and the Z10 and the Z30 and loving them
    Martin

Maybe you are looking for