Trigger programs to run in background

hello experts,
In my program I have,
do 2 times.
SUBMIT <PROGNAME>  USING SELECTION-SET  'VARIANT'.
enddo.
its just running once. if i have 2 submits  to run 2 different programs its still running just the first one .how can I make my program to run both the programs one after another.plz advise!!!
regards,

Have u used the RETURN statement addition with SUBMIT
SUBMIT REPORT AND RETURN.
Have a look at this link.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba50d35c111d1829f0000e829fbfe/frameset.htm
Regards,
Lakshman.

Similar Messages

  • Getting the variant name when the report program is run in background

    Hi All,
    How to get the variant name for the report program when run in background? My requirement is to create an email attachement with the name 'variant.XLS', where variant = selection screen variant, when the report program is run in background. The system field SY-SLSET holds the variant name only when run online.
    Any pointers to this will be highly appreciated.
    Thanks and regards,
    Nilesh.

    Hello Nilesh,
    Please find the algo:
    1. Call the FM: GET_JOB_RUNTIME_INFO to get the background job details.
    2. Select data from TBTCP using these details:
    DATA:
    FP_EVENTID   TYPE BTCEVENTID
    FP_EVTPARM   TYPE BTCEVTPARM
    FP_ACTIVE    TYPE BTCXPGFLAG
    FP_JOBCNT    TYPE BTCJOBCNT
    FP_JOBNM     TYPE BTCJOB
    FP_STEPCNT   TYPE BTCSTEPCNT.
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
        IMPORTING
          EVENTID                 = FP_EVENTID
          EVENTPARM               = FP_EVTPARM
          EXTERNAL_PROGRAM_ACTIVE = FP_ACTIVE
          JOBCOUNT                = FP_JOBCNT
          JOBNAME                 = FP_JOBNM
          STEPCOUNT               = FP_STEPCNT
        EXCEPTIONS
          NO_RUNTIME_INFO         = 1
          OTHERS                  = 2.
      IF SY-SUBRC <> 0.
    *   Error calling FM: GET_JOB_RUNTIME_INFO
      ENDIF.
    DATA: FP_VARIANT TYPE BTCVARIANT.
      SELECT JOBNAME JOBCOUNT STEPCOUNT VARIANT
      FROM   TBTCP
      INTO TABLE L_IT_TBTCP
      WHERE  JOBNAME   = FP_JOBNM
      AND    JOBCOUNT  = FP_JOBCNT
      AND    STEPCOUNT = FP_STEPCNT.
      IF SY-SUBRC = 0.
        SORT L_IT_TBTCP BY JOBNM JOBCNT STEPCNT.
        READ TABLE L_IT_TBTCP INTO L_WA_TBTCP INDEX 1.
        IF SY-SUBRC = 0.
          FP_VARIANT = L_WA_TBTCP-VARIANT.
        ENDIF.
      ENDIF.
    Hope this helps.
    BR,
    Suhas

  • How can I read the EXCEL file while Program is running in background.

    Hi all Expert,
    How can I read the EXCEL file while Program is running in background.
    Thanks

    you need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
    loots of information if you can search forum.. thanks

  • Report program when run in background job getting cancelled immediately

    Hi
    When i run a program in foreground i am able to see the output. But when run in background not able to run the job successfully. The job is getting cancelled immediately.
    I am using the below function module for output display. Should i need to pass any parameters in the below function module so that i can run the program in background  successfully.
      CALL METHOD DETAIL_GRID->SET_TABLE_FOR_FIRST_DISPLAY     
          EXPORTING                                            
            IS_LAYOUT         = IS_LAYOUT                    
            I_SAVE            = 'A'                        
            IS_VARIANT        = GS_VARIANT                   
          CHANGING                                           
            IT_FIELDCATALOG   = IT_FIELDCATALOG               
            IT_OUTTAB         = BLOCKED_STOCK_TAB_ALV[].     
    Please suggest.
    Thanks and regards
    Rajani Yeluri

    Hi Rajani.
      ALV require the DRYPOR(screen) for display but incase you run in back ground which have to write to spool but in spool we can only write in format of LIST REPORT not inter-active report like ALV. That why
    system cancelled your process immediately.
    Hope it helps.
    Sayan.

  • Download Excel when program is run in background

    Hi all,
    I need help urgently in downloading my report into an excel file automatically when my report is has completed its run in background.
    Appreciate if help can be provided.
    Many thanks in advance.

    Check out the sample program of the provided link ..
    http://www.sap-img.com/abap/download-in-background-in-excel-format.htm

  • ABAP program to run in Background job

    Hi,
    We have a custumized program (SO Creation) calling some functions (like: WS_QUERY, WS_UPLOAD, WS_DOWNLOAD, CREATE_TEXT and CALL TRANSACTION VA01) and can only run thru dialog process (foreground).  Is it possible to convert it to something that can run thru background job?
    Please help.
    Thanks.

    Hi Deo ,
    Unfortunately cl_gui_frontend_services will not work in background.
    Please have a look at following information about cl_gui_frontend_services :
    The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
    File functions
    Directory functions
    Registry
    Environment
    Write to / read from clipboard
    Upload / download files
    Execute programs / open documents
    Query functions, such as Windows directory, Windows version, and so on
    Standard dialogs (open, save, directory selection)
    To Use this, you should be bit familier with OO ABAP Concepts. So I will suggest you to go through with OO concepts of ABAP. It will be of great help to you.
    Regards,
    Nikhil

  • How to reopen window in a program which runs in background

    Hello,
    I created a program, which runs in the background(when you start it, doesn't open a window). It has a notify icon and by double click opens a window. I open the window with ShowDialog() method. After I close it, I cannot reopen it. It says: "Cannot
    set Visibility or call Show or ShowDialog after window has closed". What should I do?
    Thanks!

    When you say you can't re-open it.
    Exactly what are you doing to show and hide it?
    And what do you do to show it again?
    Actually, I can probably guess roughly what you're doing.
    Are you trying to show a window you closed without instantiating it again?
    Are you effectively doing something like:
    Window win = new MainWindow();
    win.Show(); ....
    win.Close();
    win.Show();
    Because you should do
    Window win = new MainWindow();
    win.Show();...
    win.Hide();
    win.Show();
    Once you close it, that's it you're done with that window. It's on the garbage heap waiting for the garbage collector to come along and recycle it.
    It is no more.
    Either hide() rather than close() or instantiate a new object each time.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Difference in runtime of a program when run in background vs foreground

    Hi,
    Is running the program in background would result to better performance in terms of speed compared to foreground? If yes, what's the reason behind.
    Thanks!

    Hi Advait,
    >
    Advait Gode wrote:
    > Yes, program does run faster in background process than running in foreground.
    sorry... an ABAP program will NOT run faster in background.
    As could be seen from your link:
    - a program in background does not have a timout limit
    - a program in background can use a different memory allocation sequence (depends on configuration)
      and may be able to allocate more memory than a foreground program (depends on configuration as well)
    but it will not run faster... .
    Kind regards,
    Hermann

  • How to see if invisible program is running in background?

    Hello,
    I'm trying to help my friend who has an iMac running Snow Leopard (10.6.8). Her email and Facebook keep getting "hacked", and even though she changes the passwords to long and complex things that nobody could ever guess, someone is still able to figure out her passwords. The only way we think this could be happening is if someone broke into her home and put some type of "keystroke capture" program so that they could look at it while she's at work and get her passwords that way. We simply can not come up with any other way that her passwors are being discovered, and unfortunately we think it's a jealous ex-wife that is doing this.
    I seem to recall in Snow Leopard that there is a way to see what is running in order to see how much memory is being taken by each task or program on the computer, but I don't recall where to go on the computer to monitor that information. Can someone please point me to where that information is, and if you have any other advice on how to check to see if a program is running without her knowledge, I would sure appreciate any input.
    Thank you very much!

    Great---thank you very much. I actually do recognize everything there, so we are baffled as to what's going on.
    Thanks again!

  • ALV List export to Excel when program is run in background

    Hello,
    I am running into an issue with a custom ALV report which contains an export to Excel option on the input screen. However, when I attempt to run the report in background due to high volume of records/expected performance constraints, the job fails to produce a spool when the "export to Excel" option is selected. When I deselect that option, the background job successfully generates a spool, which I can then export to Excel (albeit the formatting will not look the same).
    Is the above an accurate statement or does anyone know of a way where either;
    1) The background job can create and store the Excel output into a cached directory?
    2) The spool generated, when exported to Excel, can match the format of the foreground Excel output?
    Thanks in advancce.

    Check out the sample program of the provided link ..
    http://www.sap-img.com/abap/download-in-background-in-excel-format.htm

  • Wrapper program when run in background not generating SPOOL

    I have created Program A which calls internally Program B or C based on the condition. When I run the program B or C independently in Background it generates the spool on completion. But When I run the program A in Background, Spool is not getting generated.
    My requirement is that Spool should be generated when Program A is executed in Background.
    Below is the code of program A:
    PROGRAM A.
        IF p_cons = 'X'.
    *-->Detailed Details of Interim or Final Settlement
          SUBMIT B               WITH  p_vtnr   EQ p_vtnr
                                 WITH  p_setqty EQ p_setqty
                                 WITH  p_test   EQ p_test
                                 WITH  s_abrdat IN s_abrdat
                                 WITH  r2       EQ r2
                                 WITH  r1       EQ r1
                                 AND RETURN.
        ELSE.
    *-->Summary Details of Interim or Final Settlement
          SUBMIT C                   WITH  p_vtnr   EQ p_vtnr
                                     WITH  p_setqty EQ p_setqty
                                     WITH  p_test   EQ p_test
                                     WITH  s_abrdat IN s_abrdat
                                     WITH  r2       EQ r2
                                     WITH  r1       EQ r1
                                     AND RETURN.
        ENDIF.
    Please guide me on this.
    Regards,
    Naveen

    Hi Naveen,
    Check this
    Submit report to job
    submit ztest via job l_jobname
                                   number l_jobcount
                                  to sap-spool without spool dynpro
                                 spool parameters ls_params
                              and return.

  • How to Identify program is running in background or Foreground mode?

    Hello Experts,
    I have developed on Z report and from this report BDC for Transaction CO11 is runnning using CALL TRANSACTION statement.
    On Selection screen there is a option for selecting the BDC mode either in  Background or Forground or Error mode.
    My question is:- how do I recognize this selected BDC mode in the function exit ZXMBCU02.
    This exit triggers when transaction CO11 runs.
    Because based on the selected BDC mode i have to apply some logic in this exit.
    Please suggest.
    Regards,
    Jagesh

    Hi Jagesh...
    You can do the following..
    1. Export the Batch Input Mode in to ABAP memory using the EXPORT statement.
    2. Import that value in the user exit.
    3. To execute your code only if its batch input mode, use the field SY-BINPT.
    You can also check if this structure "BDCRUN" is used in that program, b'cas this is contained in the VA01 an VA02 transacation, this would contain all the data.
      CALL FUNCTION 'BDC_RUNNING'
           IMPORTING
                bi_info = bi_info
           EXCEPTIONS
                OTHERS  = 1.
      bi_info will contain all the data.
      GET PARAMETER ID 'SD_BACKGROUND_DEBUG' FIELD background_debug.
    Best Regards,
    Pradeep.

  • How to find whether a program is running in background

    Hi,
    I have a requirement to find out whether a program is being executed in background. If the same program is executed manually then it should not execute, the time when the same program is being executed in background.
    Please suggest.
    Thanks.
    Marked as a question
    Message was edited by: Rich Heilman

    You can put a lock on the program inside the program, so that when it is run it puts a lock entry in SM12, then anyone trying to run it will get a message saying that the program is locked.  USe the TRDIR lock object.
    report zrich_0001 .
    data: repid type sy-repid.
    repid = sy-repid
    call function 'ENQUEUE_E_TRDIR'
      EXPORTING
    *    MODE_TRDIR           = 'X'
        NAME                 = repid
    *   X_NAME               = ' '
    *   _SCOPE               = '2'
    *   _WAIT                = ' '
    *   _COLLECT             = ' '
    EXCEPTIONS
       FOREIGN_LOCK         = 1
       SYSTEM_FAILURE       = 2
       OTHERS               = 3
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Welcome to SDN
    Regards,
    Rich Heilman

  • How to check in the program that whether it is running in background?

    Hi,
    Can i check in the program itself that whether it is executing in the foreground mode or background mode?

    Check the value of system variable sy-batch. if value of it is 'X' that means program is running in background and if value is ' '(blank) that means prog. is executing in foreground mode.
    Regards,
    Joy.

  • How to debug a program running in background ?

    How do we debug a prorgram running in the background ?
    Is BREAK-POINT statement is used for this or ne other method exists
    I have gone thr the standard documentation help for BREAK-POINT Statement, but not getting it.
    Regards,
    Nitin

    Hi Nitin, try to do this:
    1. use the following code instead of break-point:
       data a type c.
       do.
         if a = 'X'.
           exit.
         endif.
       enddo.
    2. while the program is running in background, launch transaction SM50.
    3. select the program in the list and choose Program/Mode -> Program -> Debugging
    4. at this point the program should stop in the infinite loop. to exit from the loop, set the variable a to 'X'
    Best regards, Manuel

Maybe you are looking for

  • Need to remove hard coding of instance name in XML Bursting control file

    Hi, We are hardcoding the instance name in the control file as <xapi:template type="rtf" location="/app/ebs/atgsidev02/gsidev02comn/java/oracle/apps/xxod/XXARPRST.rtf"> But gsidev02 is coming from the element 'INSTANCE'. So we need to place element '

  • Generate Report without Installation

    Hi, Can I have a way to generate crystal report without having to install any files on user computer? Like running directly from CD-Rom or DVD. It's just going to be a very simple report and just need the basic components. I tried copying dlls from C

  • Diminsion Formula for cash flow report

    I currently have a Balance Sheet database and have been asked to Cash Flow. I am going to do it in the same database and use the change in the balance sheet positions to calculate the change in cash flow. I have a diminsion called Trans Action Type t

  • No accpetance SES is appearing PO history

    Hi friends, No accpetance SES is appearing in the PO and also invoice has also been done for the same. What are the reasons for this issue? Tks sujith

  • Generic classes with parameterized super class and interface

    Hello. I'm trying to write a generic class that looks like the following pseudo-code. public interface Interface {     public Interface getSibling(...); public class Klass {...} public class MyKlass<T extends Klass, T2 extends Interface>         exte