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.

Similar Messages

  • 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 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

  • 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 to turn off apps running in background on ipad

    how to turn off apps running in background on iPad with ios7

    Close inactive apps
    1. Double tap the home button to bring up the multi-tasking view
    2. Swipe the app's windows upwards to close
    3. The app will fly off the screen

  • How do I uninstall anything running in background that I don't need?

    I am having problems (iMac OSX 10.6.8) with my searches being intercepted.
    Could this be caused by applications running in the background?
    If so, how do I uninstall anything running in background that I don't need?

    But whatever I search on Google, within moments my email box is crammed with spam on a related topic.
    If that's true, then it would seem you have put your email addrress out on the Internet somewhere.
    At the same time, it's possible that you have inadvertently got some malware on your system and that it is what is intercepting your web searching and then sending you email on that or related topics. I'm not suggestng this is likely, only that it's a possibility, however small.
    Who is your Internet provider? Some of them actively intercept searches and foist ads on you, especially when you try to go to a web site that doesn't exist or one that isn't cached in their DNS servers.

  • How do I close apps running in background, in iOS 7?

    How do I close apps running in background, in iOS 7?

    my mistake I was being stupid was trying to flick the icon and not the app card...got it now working fine
    thanks for the help

  • In which way i can know that a job is running In background or foreground?

    Hi,
       In which way i can know that a job is running In background or foreground? please tell me...
    or a report is in background or foreground..
    Thanks ,
    Arya

    check tranx sm37 to know all background job details
    refer link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a8009505211d189550000e829fbbd/frameset.htm

  • 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

  • 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!

  • How long a program can run in Foreground/background?

    Hi ,
    Can anyone know what is the maximum time a program can run without time out ,in foreground/background?
    Let me know,its an urgent requirement....
    Thanks in advance!!!

    Hi Hemant,
    Updation of the timeout limit is task of BASIS.
    In Tcode : RZ10, you can maintain systme parameters.
    The parameter name is rdisp/max_wprun_time. If it not maintained in the profile it will be default 10 mins(600 seconds) as SAP has recommended.
    Also check this links for more info.
    http://sap.ittoolbox.com/groups/technical-functional/SAP-R3-DEV/timeout-in-abap-debugger-560635
    http://sap.ittoolbox.com/groups/technical-functional/SAP-R3-DEV/timeout-in-abap-debugger-560756
    Regards,
    Ferry Lianto

  • 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

  • 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.

Maybe you are looking for

  • At Line Selection on ALV Grid

    Hi guys: I need to double click on a field in the ALV report that should bring up another structure (which I have created) called s_det s_det has only document number & company code. Please provide the code for doing this in ALV. I know I cant use At

  • Error Message: The iTunes Library file cannot be saved. Unknown Error 13001

    My error message says: The iTunes Library file cannot be saved. An Unknown error occurred (13001). Ever since I loaded the new 3.0 touch upgrade I have been bombarded by error after error. I have turned off genius which seemed to fix the problem at f

  • Group by based on time interval

    Hi, I have grouped the log count for every one hour for the past one month. No I wanted to find the minimum (Hour with minimum logs) for each day. Could you please help me out? The below query doesn't work: select to_char(HOURLY, 'MM/DD/YYYY HH24:MI:

  • Defining a veriable within if statements

    hi everyone, I have a question: if (true)    int a = 0; else if (true)    String a = "hi"; else     char a = 'u'; System.out.print(a);How come this doesn't work? It gives me 'undefined variable a' error. Is there another way to do what I am trying to

  • Adobe reader XI freezes upon start up and wont work

    Hi I am running Windows 7 home premium with 64bit system and Kaperskys antivirus.  Everytime I open adobe XI it freezes up and displays the thinking icon both on the mouse hover and right screen of the adobe reader.  I tried installing the older adob