Determine if SAP program is running foreground

Hello all,
Is there a way to determine that a program is running in foreground, without adding code to the program to lock the program?
If the program in question was a custom program, I would add FM ENQUEUE_ESINDX and check the return code.  I need to check whether a standard SAP program, RFFOUS_C, is running in foreground.
Thanks
Bruce

CALL FUNCTION 'BP_JOB_SELECT_SM37B'
    EXPORTING
      JOBSELECT_DIALOG          =
*     JOBSEL_PARAM_IN           = ' '
*     ENDDATE                   = '        '
*     ENDTIME                   = '      '
*   IMPORTING
*     JOBSEL_PARAM_OUT          =
    TABLES
*     JOBSELECT_JOBLIST         =
      JOBSELECT_JOBLIST_B       =
*   EXCEPTIONS
*     INVALID_DIALOG_TYPE       = 1
*     JOBNAME_MISSING           = 2
*     NO_JOBS_FOUND             = 3
*     SELECTION_CANCELED        = 4
*     USERNAME_MISSING          = 5
*     OTHERS                    = 6
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
Use the above function module. In function group BTCH or any other similar one in BTCH.Give no to dialog mode.
In  JOBSEL_PARAM_IN           supply the jobname which the report will use if run in back ground and .
In ABAPNAME give the report name. Date give a the presnt dates and times.
Check the active flag.
Then run the module.Check the JOBSELECT_JOBLIST table
If it reurns your report as active it means running in background else
You report may run in fialog or may not even be running.
These FMs have a doccumentation 'BP_JOB_SELECT_SM37B' and 'BP_JOB_SELECT_SM37C' in fg BTCH go through them.
Edited by: Vighneswaran CE on Dec 1, 2010 2:02 AM

Similar Messages

  • 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

  • Getting run time errors while executing the copied SAP programs

    Hi folks,
    i want to copy an sap program.after coping i need to change some coding there.then i have to create a new transaction for that.
    i am just copying the sap program RQEEAL10(transaction-QA32) to Z_RQEEAL10. it has 4 include  programs.i am copying them to z programs like
    RQ00MF10 copied to z_RQ00MF10
    RQALVF14 copied to z_RQALVF14
    RQALVF16 copied to z_RQALVF16
    RQALVTOP copied to z_RQALVTOP.
    now i am executing that program Z_RQEEAL10.but i am getting run time errors as given below.
    <b>runtime error---</b>
    The termination occurred in the ABAP program "Z_RQEEAL10" in           
    "SELECT_FIELDS_MANIP2_F16".                                           
    The main program was "Z_RQEEAL10 ".                                                                               
    The termination occurred in line 257 of the source code of the (Include)
    program "RQALVF16"                                                    
    of the source code of program "RQALVF16" (when calling the editor 2570).
    --Error in ABAP statement when processing an internal table.  
    --When changing or deleting one or more lines of the internal table         
    "\PROGRAM=Z_RQEEAL10\DATA=SELECT_FIELDS" or when inserting in the table   
    "\PROGRAM=Z_RQEEAL10\DATA=SELECT_FIELDS", 0 was used as                  
    the line index. An index less than or equal to zero is not                
    allowed.                                                                               
    The error can occur when using the following options:                     
    1. "INDEX idx" for specifying the line number in the table                
    "\PROGRAM=Z_RQEEAL10\DATA=SELECT_FIELDS"                                 
       where you want to change, insert or delete.                            
    2. "FROM idx" for specifying the start index when deleting a line         
       area from or inserting a line area into the table                      
    "\PROGRAM=Z_RQEEAL10\DATA=SELECT_FIELDS".                                
    3. "TO idx" for specifying the end index when deleting a line             
       area from or inserting a line area into the table                      
    "\PROGRAM=Z_RQEEAL10\DATA=SELECT_FIELDS".                                                                               
    When the program terminated, the table had 2 lines.                       
    these r the runtime errors what i am getting.where is the problem?i have activated all interface & includes.plz advice.
    Thanks & regards

    Hi Madhu,
    I will give you one more check point where you have to give your concentration while copying the standard programs....
    Call Customer-Function (Function Exists) if any in the Program when copied will not get executed. Instead you need to call the FM Directly.
    one more is also here
    You are likely to have some problems with the text-elements and translation that may have been maintained for the original report.
    ~~Guduri

  • Is it possible to determine if a program is installed on the PC running the flash?

    Hi,
    I use Flash to develop a movie that runs when a user installs a new version of my companies software, and allows the user to access the user documentation and software installations at the click of a button.  I use ActionScript to control the flow of the movie based on radio buttons that the user selects so that they are only provided with information relevant to them.
    I have been asked if Flash can determine whether a program is installed on the user's computer which can then be used to determine the flow of the movie.
    Can anybody help me please? Ideally I would like to know if it is possible along with information on how to do this.
    Thanks in advance, Carol

    with adobe air you have access to some operating system files.  otherwise, you have none.

  • 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 create a variant to a report from another program at run time

    Hi experts,
                   when i am using FM  :  /OSP/REPORT_CREATE_VARIANT to create a report variant from a program then i am getting  an error 'For object /OSP/ERPNR , number range interval 01 does not exist ', how should i avoid it or can any one help me out to create a report variant from another program at run time with the results of the program.so that i can execute the report from here with this variant

    If i understand you,
    - You can use a FM like [RS_CREATE_VARIANT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=rs_create_variant+&adv=false&sortby=cm_rnd_rankvalue] to create a variant and then use it in the [SUBMIT|http://help.sap.com/erp2005_ehp_03/helpdata/EN/fa/096d67543b11d1898e0000e8322d00/frameset.htm] statement USING SELECTION-SET.
    - But you may also use SUBMIT with WITH parameters which doesnt require variant creation and with much less programming efforts.
    - You can mix the two solutions also.
    So what is you actual requirement, also look at some documentation like [ Scheduling a Job: Full-Control Method|http://help.sap.com/erp2005_ehp_03/helpdata/EN/fa/096ce5543b11d1898e0000e8322d00/frameset.htm]
    Regards

  • How to find out whether a program is running in Hyper-V virtual machine or not?

    If I want to make a program which only running in Hyper-V virtual machine, how can I find out whether
    the program is running in Hyper-V  virtual machine or not?

    https://gallery.technet.microsoft.com/scriptcenter/Determine-if-a-computer-is-cdd20473
    http://social.technet.microsoft.com/wiki/contents/articles/942.hyper-v-how-to-detect-if-a-computer-is-a-vm-using-script.aspx
    http://www.grouppolicy.biz/2014/01/how-to-target-group-policy-to-virtual-computers/
    Mike Crowley | MVP
    My Blog --
    Baseline Technologies

  • When I open my macbook, why is a different program in the foreground than when I closed it?

    Hi all. I was curious as to why whenever I open my macbook pro, a different program is running in the foreground than whatever was there when I closed it. Not a major issue, just really confusing. It's always a progam I had open, but always a different one each time. For instance, I will close the computer with Safari in the foreground and when I open it Mail will be in the foreground.

    Hello,
    Test this in another user account and see if the issue still occurs.

  • How to use a function key on keyboard for executing a non SAP program

    Hello Gurus.
    My client want to run a non SAP program selecting the specific function key on keyboard during the entering data on SAP.
    i knew that it is possible to execute a non sap program after adding special program each by SAP program.  but, it is huge jobs.
    client wants to run a non sap program wherever he is on SAP program.  Is it possible ?

    Hi,
    1. Create a ".exe" file for the .NET application.
    2. Create a PF-STATUS and assign the Function Code for the desired Function Key in the SAP program.
    3. In the USER COMMAND code inside program, when the respective function code is triggered, write the below code with the path to the .NET exe file.
    CALL METHOD cl_gui_frontend_services=>execute
      EXPORTING
        document = '.NET exe file path'
      EXCEPTIONS
        OTHERS   = 1.

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

  • Passing value to a field of SAP Program which do not have "Parameter ID"

    Dear Experts,
    My requirement is that i need to pass a value from my dialog program to a field of SAP Program which do not have "Parameter ID" attached to it.
    For example: If you run SAP Transaction CS14, it has two sections viz., Primary BOM and Secondary BOM. I need to copy and create own screen using Dialog program. The screen appears in custom screen would be similar to that of the SAP Transaction CS14. If you check the fields, all the fields have "Parameter ID" attached to it, except for the following fields which do not have Parameter IDs are "Alternative", "Valid From" and "Required Qty".
    Hence how do i pass value to those fields? Kindly help me
    To those fields where "Parameter IDs" are attached, i can use below two statements:
    Set parameter id <par> field <field>.
    call transaction 'CS14' and skip first screen.
    Regards,
    Ramesh Manoharan

    Hi Harald Boeing,
    Thanks you very much. My problem is solved.
    Rewarded Points.
    Regards,
    Ramesh Manoharan

  • How to set a  Executable ABAP  Program to run as a Background Batch Job

    Hi
    Currently  I had a Executable ABAP  Program which when executed prompts for user to enter selection once entered and executed it will delete user entered selections from a Table.
    Now my requirment is to enhance that program to run it as a BACKGROUND BATCH JOB so that there will be an entry in SM37 when the program is executed
    How can i achieve this

    Hi,
    Please refer this link .
    It has the steps.
    http://sapient.wordpress.com/2007/06/19/how-do-you-set-up-background-jobs-in-sap/
    Regards,
    SuryaD.

  • Customisation of SAP Program

    I am trying to customise standard SAP program SAPM07DR.
    While I can copy it to a Z* Program,  I am unable to create a Transaction code because the screens do not exist in the copied program.
    How can I create the Transction code OR how can I copy the screens so that I am able to run the new Z* Program.

    Well, I copied everything for the SAP program (SAPM07DR). If you do an SE80, for the program you dont find any screens. As such the program that I copied also does not have the screens on the listing.
    But if you run the SAP program thorugh Tcode MB03, you will find that the first screen is 460.

  • How to check if ABAP program is running in another instance?

    Hey Guys,
    I need to ensure that a given ABAP program is only running in one instance.
    Here is what I tried so far:
    1) FM TH_WPINFO
    The problem with this is that the Z (custom) program calls lot of SAP function modules and when inside those, the WP_REPORT field of WPLIST table has something else and not the Z program name.
    2) FM ENQUEUE_ESINDX
    When I used the code below the following happened:
    -The First instance runs fine
    -The Second instance fails in the locking and exits the way it is supposed to but then
    -If I run the program the Third time, it runs with a succesful lock - probably because the after second instance the lock was cleared???
    CALL FUNCTION 'ENQUEUE_ESINDX'
        EXPORTING
         MODE_INDX            = 'E'
         MANDT                = SY-MANDT
         RELID                = 'ZZ'
         SRTFD                = PROGRAM
    *     SRTF2                =
    *     X_RELID              = ' '
    *     X_SRTFD              = ' '
    *     X_SRTF2              = ' '
    *     _SCOPE               = '2'
    *     _WAIT                = ' '
    *     _COLLECT             = ' '
        EXCEPTIONS
          FOREIGN_LOCK         = 1
          SYSTEM_FAILURE       = 2
          OTHERS               = 3.
    Any other idea, how I could accomplish this?
    Thanks a lot,
    Viktor

    -----> Include this perform in Initalization or in Start-of-Selection screen event.
    *&      Form  LOCK_CURRENT_INSTANCE
    * Perform to lock the current instance of the
    * program, so that only one
    * instance can be runned at a given time.
    FORM lock_current_instance .
    *---FM to lock the current instance of the program
        CALL FUNCTION 'ENQUEUE_E_TRDIR'
          EXPORTING
            mode_trdir     = abap_true
            name           = sy-repid
          EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.
        IF sy-subrc <> 0.
          IF sy-batch = abap_true.
            MESSAGE e016 WITH 'Already one Instance of the Program is Running'.
          ELSE.
            MESSAGE s016 WITH 'Already one Instance of the Program is Running' DISPLAY LIKE 'E' .
            LEAVE LIST-PROCESSING.
          ENDIF.
        ENDIF.
    ENDFORM.                    " LOCK_CURRENT_INSTANCE
    ---->and include this perform as a last perform in End-of-Selection screen event.
    *&      Form  UNLOCK_CURRENT_INSTANCE
    * This perform is used to unlock the instance of the
    * running program
    FORM unlock_current_instance .
    *---FM to release the lock on the running program
      CALL FUNCTION 'DEQUEUE_E_TRDIR'
        EXPORTING
          mode_trdir = abap_true
          name       = sy-repid.
    ENDFORM.                    " UNLOCK_CURRENT_INSTANCE

  • Extract Process Chain ID/Name that an embedded ABAP program is run from?

    Hi all,
    I have created some Process Chains in SAP BW where I have incorporated some ABAP program Process Types that uses the same ABAP program.
    In these embedded ABAP program Process Types I need to extract the name of the Process Chain it runs from (ID, Technical Name, Descirption).
    Is there any way this is possible to do?
    One solutions that is not possible to implement (due to parallell runs of process chains that uses the same ABAP program) is the following:
    search in table RSPCVARIANT for your program as follows
    - field TYPE = "ABAP"
    - field FNAM = "PROGRAM"
    - field LOW = <program name>
    take the value of field VARIANTE and use this in table RSPCPROCESSLOG (enter a date selection for BATCHDATE as well)
    take the most recent entry (should be the one you're actually running at that moment)
    via field LOG_ID, retrieve CHAIN_ID (technical name of your process chain) in table RSPCLOGCHAIN
    So my question here is:
    -Is there any way to extract the Process Chain ID/Name that an embedded ABAP program Process Type is run from?
    Thanks beforhand for your feedback!
    regards
    Oddmar

    Hi Erik,
    I am stuck up with a similar requirement, wherein I have an ABAP program in my process chain and I need the technical name of the process chain in the ABAP program at run-time.
    Did you get a solution or work-around for this scenario?
    Thanks in advance.
    Regards,
    Chetana.

Maybe you are looking for

  • Trying to develop a blocking method

    This seems like it should be simple, but I've been trying to figure it out all morning. Basically, I want to develop a way to lock object across all instances to make it writeable. Creating a static boolean class variable will get me most of the way

  • ACH method Payment advice -- Urgent

    HI all We have set configuration settings for ACH method for bank payments to our US client.  Client wants to send Payment advice to his vendors for payment made. I would like to know where I need to assign form and variant for payments advice so tha

  • Rule creation with Function module to be executed.

    Hi there, I have been trying to create a function module and then use it in a rule... I have declared ACTOR_TAB, AC_CONTAINER, but still I get an error with the below statement. swc_get_element ac_container 'PERNR' pernr. The error I get is as below:

  • Trying to account for dozens of unidentified TB on SSD

    I am working  with a late 2009 27" 2.66Ghz iMac running OS X 10.9.3 It is fitted with 16GB RAM. the Operating system and applications are on a 240Gb OWC 3G SSD. Issue: When I go to SSD > users > user name and use the 'get info" tool it tells me that

  • My external speakers won't work

    my external audio speakers won't work for any apps or videos on my iPad 4th gen (wifi, OS 6.01)  It does work for music howevever.  I have tried the reset with holding down the home button and power  button simultaneously and that worked once.  It wo