Detect DEBUG mode in ABAP code

Hi all,
Is there a way to detect that we are in DEBUGGING mode in ABAP code.
I need to determine this, because we have function modules that will be runned in a separate process in the background. If i could detect DEBUG mode, i could choose not to run these modules in the background, making debugging them possible.
Regards,
Rob.

When you debug a program that calls function modules using the IN BACKGROUND TASK addition, they are processed in a background work process (additional internal session). If you set the In background task: Do not process option, the system collects the function calls, but does not start the background work process. The Debugger assigns a transaction ID, which identifies the background work process uniquely. You can now start the Debugger for the background work process using transaction SM58. You can select the function module concerned here, and then execute it via the Edit menu.
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617d0ce68c11d2b2ab080009b43351/frameset.htm
There is a system variable SY-DEBUG, not sure if it works, though.
Regards,
Subramanian V.

Similar Messages

  • Detect debug mode in runtime?

    During runtime, it is possible from the program itself to detect if it is being run in the java debug mode? Well the idea is that if it is running in the debug mode or release mode I can dynamically load the corresponding debug or release JNI classes.

    Or just change the LD_LIBRARY_PATH (or PATH under Windows) that the debugger passes to java when it is started so that it finds the desired JNI shared library.

  • How to on Debugging Mode for T-Code F110 from Script in Sub routine Pool Pr

    Hi Every one....
    I have done SAP-Script for Payment Vocher for T-code F110 ..I have a Sub Routine Program where I have few Form statements which is called by SAP - Script using Perform Statements, But my problem is when I set a break point in Sub Routine pool program, the out put is issuing with out Debugger ...
    Could any one plz suggest me wht to do???
    Help ful answers will be rewarded....
    Regards,
    sg

    Hi,
    First see if the 'Perform' statement is getting triggered in Script. To put a breakpoint in any script ( even if you do not know the form name, that is the best part ) is se38---->RSTXDBUG --->F8 & execute your pgm/Transaction. The control will wait in the form-debugger.
    I hope this helps,
    Regards
    Raju Chitale

  • IDOC: How to create child segment with abap code.

    Hi,
    I'am trying to write an abap code to create segments for an Idoc which structure is the following:
    ZLE_00060_DLVY
    >  E1EDL20
    > Z1DEL_CONS
    >Z1DEL_MAT_HEADER
    > Z1DEL_MAT
    > E1EDL20RET2
    > E1EDL22
    > E1EDL21
    > E1EDL23
    > E1EDL51
    I receive a sintax error: Error in IDoc with status 26 .
    Checking the result I note all segment at the same level and an error about the segment E1EDL22
    EDI: Syntax error in IDoc (segment cannot be identified)
         Message no. E0078
    Diagnosis
         The segment E1EDL22 does not occur at the current level of the basic
         type DELVRY05 (extension ZLE_00060_DLVY).
         This error can have several reasons:
         o   The segment E1EDL22 is assigned to a group whose header segment does
             not occur.
         o   The segment E1EDL22 does not exist in the syntax description of the
             basic type DELVRY05 (extension ZLE_00060_DLVY).
         o   The sequence of segments in the group in which the segment appears
             is incorrect.
         Previous errors ('mandatory' segment or group missing) may be due to
         this error.
    Procedure
         Please check the IDoc or the syntax description of the basic type
         DELVRY05 (extension ZLE_00060_DLVY).
    After the error I have:
    data records
    E1EDL20
    Z1DEL_CONS
    Z1DEL_MAT_HEADER
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    E1EDL20RET2
    E1EDL22
    E1EDL21
    Abap code:
            idoc_data-segnam = 'Z1DEL_CONS'.
            idoc_data-sdata = s_z1del_cons.
            append idoc_data.
              idoc_data-segnam = 'Z1DEL_MAT_HEADER'.
              s_z1del_mat_header-tsegment = 'MATERIAL'.
              idoc_data-sdata = s_z1del_mat_header.
              append idoc_data.
            clear idoc_data-sdata.                            <<<<<<<<<<< how to indent the structure because this is a child.
             idoc_data-sdata = s_Z1DEL_MAT.
             idoc_data-segnam = 'Z1DEL_MAT'.
             append idoc_data.
             idoc_data-segnam = 'E1EDL20RET2'.
             idoc_data-sdata = s_E1EDL20RET2.
             append idoc_data.
             clear idoc_data.
             idoc_data-segnam = 'E1EDL22'.
             idoc_data-sdata = s_e1edl22.
             append idoc_data.
             clear idoc_data.
             idoc_data-segnam = 'E1EDL21'.
             idoc_data-sdata = s_e1edl21.
             append idoc_data.
    Any help will be well appreciated.
    Thanks in advance.
    Regards,
        Giovanni

    Hi,
    following in debugging mode the abap code of the INCLUDE ZXTRKU02 where is defined the TABLES IDOC_DATA STRUCTURE  EDIDD, I find that all field of the table IDOC_DATA are not set. More exactly my expectation is to find values for SEGNUM, HLEVEL, PSGNUM.
    In a few words I need to execute an enhancement, via abap code, of the struscure of the idoc before sending it out since I have a requirement to test this enhancement in my XI environment, receiving as input this ideoc modified.
    Then, I need to add a new segment and one child.
    Any suggestion will be well appreciated.
    Thanks in advance.
    Regards,
        Giovanni

  • Detect debug or release build from AS3?

    Hi, is it possible to detect the build type (debug or
    release) of an ActionScript Project using AS3 code?
    I use a FPS counter, but it would be nice if it would only
    show up in the debug build.
    Thanks a lot in advance!

    var isDebug:Booleab = (new Error().getStackTrace().search(/:[0-9]+]$/m) > -1);
    Here are the sources that I found this answer...
    http://www.tekool.net/blog/2009/06/27/identifying-a-debug-or-release-swf-file-at-runtime/
    http://michaelvandaniker.com/blog/2008/11/25/how-to-check-debug-swf/
    Here's yet another take on solving this issue by using the compiler argument: "-define=CONFIG::debug,true"
    Personally I prefer the above solution.
    http://edsyrett.wordpress.com/2008/09/22/using-conditional-compilation-to-detect-debug-mod e/

  • CRM_ORDER_MAINTAIN works only in debug mode

    Hi Experts,
    I am currently facing a strange issue. I am trying to add a line item to a service ticket, but the code works only in debug mode. Sample code is given below:
    lv_product_i-ref_handle = '0000000001'.
    lv_product_i-ref_guid = lv_header_guid.
    INSERT lv_product_i INTO TABLE lt_product_i.
    ls_orderadm_i-header = lv_header_guid.
    ls_orderadm_i-itm_type = 'ZSG5'.
    ls_orderadm_i-number_int = '0000000010'.
    ls_orderadm_i-ordered_prod = 'SERVICEITEM_SG5'.
    ls_orderadm_i-handle = '0000000001'.
    ls_orderadm_i-mode = 'A'.
    ls_orderadm_i-itm_proc_ident = 'SRVC'.
    INSERT ls_orderadm_i INTO TABLE lt_orderadm_i.
    ls_input_fields-ref_handle = '0000000001'.
    ls_input_fields-objectname = 'ORDERADM_I'.
    CLEAR ls_field_names.
    ls_field_names-fieldname = 'HANDLE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'HEADER'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_PROC_IDENT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_TYPE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'MODE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'NUMBER_INT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ORDERED_PROD'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    it_product_i = lt_product_i
    CHANGING
    ct_orderadm_i = lt_orderadm_i
    ct_input_fields = lt_input_fields
    EXCEPTIONS
    error_occurred = 1
    document_locked = 2
    no_change_allowed = 3
    no_authority = 4
    OTHERS = 5.
    LOOP AT lt_orderadm_i INTO lv_tempvar.
    lv_item_guid = lv_tempvar-guid.
    ENDLOOP.
    The item guid is coming as initial and no item is being added.But if i put a breakpoint in CRM_ORDER_MAINTIAN, then the guid is being generated properly. Any pointers why the code is behaving like this or someone has faced a similar issue before?
    Thanks and Regards,
    Rohit

    Hi Rohit,
    The above said is also correct + U have to write
      CALL FUNCTION 'CRM_ORDER_SAVE'
        EXPORTING
          IT_OBJECTS_TO_SAVE = GT_OBJ_GUIDS
        IMPORTING
          ET_SAVED_OBJECTS   = GT_SAVED_OBJECTS
        EXCEPTIONS
          OTHERS             = 2.
      COMMIT WORK.

  • CRM_ORDER_MAINTIAN works only in debug mode!

    Hi Experts,
    I am currently facing a strange issue. I am trying to add a line item to a service ticket, but the code works only in debug mode. Sample code is given below:
    lv_product_i-ref_handle = '0000000001'.
    lv_product_i-ref_guid = lv_header_guid.
    INSERT lv_product_i INTO TABLE lt_product_i.
    ls_orderadm_i-header = lv_header_guid.
    ls_orderadm_i-itm_type = 'ZSG5'.
    ls_orderadm_i-number_int = '0000000010'.
    ls_orderadm_i-ordered_prod = 'SERVICEITEM_SG5'.
    ls_orderadm_i-handle = '0000000001'.
    ls_orderadm_i-mode = 'A'.
    ls_orderadm_i-itm_proc_ident = 'SRVC'.
    INSERT ls_orderadm_i INTO TABLE lt_orderadm_i.
    ls_input_fields-ref_handle = '0000000001'.
    ls_input_fields-objectname = 'ORDERADM_I'.
    CLEAR ls_field_names.
    ls_field_names-fieldname = 'HANDLE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'HEADER'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_PROC_IDENT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ITM_TYPE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'MODE'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'NUMBER_INT'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    ls_field_names-fieldname = 'ORDERED_PROD'.
    APPEND ls_field_names TO ls_input_fields-field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    it_product_i = lt_product_i
    CHANGING
    ct_orderadm_i = lt_orderadm_i
    ct_input_fields = lt_input_fields
    EXCEPTIONS
    error_occurred = 1
    document_locked = 2
    no_change_allowed = 3
    no_authority = 4
    OTHERS = 5.
    LOOP AT lt_orderadm_i INTO lv_tempvar.
    lv_item_guid = lv_tempvar-guid.
    ENDLOOP.
    The item guid is coming as initial and no item is being added.But if i put a breakpoint in CRM_ORDER_MAINTIAN, then the guid is being generated properly. Any pointers why the code is behaving like this or someone has faced a similar issue before?
    Thanks and Regards,
    Rohit

    Well, during debugging an implicit COMMIT WORK is executed on a regular basis. This might cause the ITEM GUID to be created during debugging.
    However, normally, after CRM_ORDER_MAINTAIN, you should use the CRM_ORDER_SAVE as well. This will return a list of SAVED_OBJECTS. If all objects were saved correctly, do an explicit COMMIT WORK.
    Works fine for us.....

  • To set up a local account in debug mode

    Hello,
    I am a beginner. I want to setup my local account in debug mode. My code is on the remote server. After setting up my local account in debug mode i want to use that code from a remote server . How should i do that? I am using eclipse. Running on Apache tomcat.Please advise.
    Thank you in advance.

    Huh!? "Local account in debug mode?" What does that mean? And "my code is on a remote server". What do you mean by that? Its in a Subversion repository or something?

  • How to Debug a ABAP code running the background in Portal

    How can I debug a ABAP code running in the background while executing a transaction code through portal.
    e.g Presently I have to incorporate some checks in the portal. For that I know the function module where i need to put though checks. Now I want to know, how does the code during runtime. What values do we get in the function module. For this I need to get into the debugging mode while executing the portal.
    So how can we do that???

    Namit,
    it doesnot matter whether it is a standard funtion module or a custom one .check whether you are debugging for proper user(portal user and backend user are same) and check debugging is activated

  • Debug ABAP code in InfoPackage

    Hi friends,
    How i can debug a ABAP code from a variable selection in Infopackage?
    Thanks,
    EA

    I guess you would have figured it out - but for the use of people who might chance upon this post while searching ...
    to debug the ABAP code in an Infopackage - you need to run it in dialog mode ( Start Data Load Immediately ) and not in background. This is because background processes cannot be debugged.

  • ABAP Runtime error in debug mode

    Hi all,
    I am facing foll. run time error in debug mode
    Runtime Error          DBIF_RSQL_INVALID_CURSOR
    Except.                CX_SY_OPEN_SQL_DB
    Possible causes in the application program:                       
    Within a loop (SELECT/LOOP/EXEC SQL), one of the following        
    statements is used:                                               
    - MESSAGE (apart from MESSAGE S...)                               
    - COMMIT WORK                                                     
    - ROLLBACK WORK                                                   
    - CALL SCREEN                                                     
    - CALL DIALOG                                                     
    - CALL TRANSACTION                                                
    - SUBMIT                                                          
    - BREAK-POINT                                                     
    - WAIT                                                            
    In debugging mode, a program sometimes triggers                   
    a "COMMIT WORK" during the database selection. As a result        
    this termination may also occur in debugging mode with a correct  
    program.                                                          
    A "COMMIT WORK" during debugging may be due to the following reason
    1. A program or screen was regenerated                            
       and updated in the database.                                   
    2. Each user needs a private process in debugging mode, but       
       the number of available processes is restricted. If this       
       limit is exceeded, each debugging step then requires a         
       "COMMIT WORK".       
    its urgent.
    if i run the prg directly to tcode der is not ne error.
    but i want to execute the prg. in the debug mode.
    its a ZPRG.
    with regards,
    Purva.

    hi,
    You need to change your logic.
    Then , i hope your problem wil be solved.
    Because of nested select statements, you are getting that error.
    Declare seperate Internal tables for VBRK,VBRP, KNA!,j_1iexchdr, j_1imtchid.
    Declare Itab_final with all required fields from all tables.
    Dont use select-endselect anywhere.
    I am giving Pseudo code here.
    Try to use this logic.
    I used question mark in code : there you need to use ur required field names.
    Hope it wil help you.
    select vbeln kunrg zterm bukrs knumv netwr kunrg from vbrk into corresponding fields of table itab1
    where vbeln = docno.
    select matnr posnr arktx fkimg meins netwr werks aubel from vbrp into corresponding fields of table itab2 for all entries in itab1
    where vbeln = itab-vbeln.
    select name1 stras pstlz ort01 land1 from kna1 into corresponding fields of table itab3 for all entries in itab1
    where kunnr = itab1-kunrg.
    select preprn exdat docno from j_1iexchdr into corresponding fields of  table itab4  for all entries in itab1
    where rdoc = itab1-vbeln.
    select j_1ichid from j_1imtchid into corresponding fields of table itab5 for all entries in itab2
    where matnr = itab2-matnr.
    Loop at itab1 into wa_itab1.
    read table itab2 into wa_itab2 index sy-tabix.
    read table itab3 into wa_itab2 index sy-tabix.
    read table itab4 into wa_itab2 index sy-tabix.
    read table itab5 into wa_itab2 index sy-tabix.
    itab_final = itab1-?
    itab_final = itab1-?
    itab_final = itab2-?
    itab_final = itab3-?
    itab_final = itab4-?
    itab_final = itab5-?
    append itab.
    endloop.
    select eikto from knb1 into table wa_knb1
    where kunnr = itab_fianl-kunrg
    and bukrs = itab-bukrs.
    select kawrt kbetr kwert kschl kposn knumv from konv into corresponding fields of wa_konv
    where knumv = itab_fianl-knumv
    and kposn = itab_final-posnr.
    append wa_konv.
    endselect.
    Regards
    Sandeep Reddy

  • Edit code while in debug mode in CC

    Hi,
    I have just upgraded to Flash CC, and can no longer edit code while in debug mode. It appears the code window becomes read only while debugging. This is problematic because I often find it very useful to copy in variable names from data visible in the variables display portion of the call stack. This is very helpful if I have made a typo in my variable names, or if I am reading out data from a network request and I don't know the variable names ahead of time. Is there a way to unlock the code window so it does not become read only during debugging?
    -David

    Hi Amy,
    I appreciate that you are trying to help, and from a purely coding standpoint see the advantages to Flash Builder IDE over the Flash Professional IDE. Although personally I am a Visual Studio kinda guy... However I am working with a fairly large code base, (we are a small game studio that has been working with flash cs4, 5, and 5.5 for the past 5 years) and while nobody that works for me is crazy enough to put code on the timeline, we do have a significant amount of UI elements, dialogs, and layouts that are designed in the Flash editor with logic in classes that extend those elements. Now correct me if I am wrong, but it is my understanding that you cannot build FLA files from flash builder let alone have them link with the classes that are set to extend them in Flash Professional. The move to CC actually gives us access to Flash Builder - something that previously was an additional $500 a seat. While it may make sense for us to use in the future, for now I am faced with the issue of the new Flash CC has removed the ability to edit the code while debugging. I was hoping there was a setting or a hidden option to turn this very unnecessary change off, I wasn't really asking for a critique of my IDE choice.
    -David

  • Garble code in debug mode

    hi,
    i downloaded a txt file from 3rd party software and upload to sap. all country are ok except 1 country.
    in 1 of the line, there is a character at the begining of the line :
    &#38168;?20:070511
    it should actually be :20:070511.
    this character only can be seen in debug mode. i tried to delete the line and type in manually in the txt file and reupload to sap but the character still there.
    what could be the cause and how to do away with it?
    thanks

    Hi,
    If possible, please use GUI_UPLOAD, if its available on your system.
    CODE PAGE helps identify SAP, which Texts/characters its dealing with.
    Each country has different code page.
    Chinense say 1100
    Best regards,
    Prashant

  • How to skip a selection screen mandatory field in debugging mode with out changing the code?

    Hi Team,
    In my report there is two fields on selection screen, one is obligatory field , but i just want to execute the report(for testing per pus) with out entering  the data for the mandatory field with out changing the code. could u let me know which event and how to debug the report. or else  in debugging mode how can i change that field as non mandatory field.
    Regards,
    Venkat.

    If the value is not of importance how come it became obligatory in your program?
    Any how you can do one thing...Put some value in your obligatory field, put a debugger point where you are interested in  and use the pencil tool to change the value of the field while debugging. 
    Regards,
    Philip.

  • Code runs fine in debug mode but hangs when compiled in release mode

    I am struggling with the following problem. I have code which runs fine when it is executed in debug mode. However, when I compile it in release mode and run the executable, the code freezes and does not work. The code acquires images from a Hamamatsu camera. In the debug mode I am able to continuously acquire images. However, in the release version, the code hangs after acquiring the first image.
    I am using LabWindows/CVI version 7.
    I would greatly appreciate if I can get any help/suggestions in resolving this problem?
    Thanks!
    Regards,
    Sripad
    Solved!
    Go to Solution.

    Sripad:
    If you search this forum for "debug release crash" or "release version crash" or similar phrases, you'll find that this is a pretty common question.  Look through the other posts you find here to see if anything is applicable to you.
    The debug version does some things like padding variables so you can sometimes overrun your declared variable space without overwriting the next variable.  In the release, the variables are packed, so if you overrun one, you are overwriting another.  Just one possible difference.
    You can do some things in your release code to see where things get lost, like (temporarily using printf statements after multiple statements at the start and end of your loop to try to identify that failing line of code.
    Look through other threads to find other ideas.

Maybe you are looking for

  • How to check the row level security in TOAD for oracle

    Hi , for ex, i have 2 types of users normal user and super user super user can see the group set (some column name) created by normal user but normal user can not see the set created by super user this set crestion aslso has 3 types "U','P',S' P & S

  • Event to be written in submit button in MAU Enhancement

    Hi All, I am doing enhancements in MAU application. I want to pass parameters from my jsp to the controller on a button submit. Do I need to write an event for this in the view and the controller file ? Can any one please help regarding this. Thanks

  • Client Deletion Status | CANCELLED

    hi all maybe someone has experienced this problem, a little assistance please TIA Client to be Deleted 600 Copy Type Delete Complete Client Status Cancelled User SAP* Start on 06.11.2009 / 13:48:31 Last Entry on 06.11.2009 / 13:57:39 Last Action: Cop

  • GRN Line Item

    Dear Gurus,                              I have made 3 line items in PO.I release it and while GRN it is showing only one line item.the second line item is not showing.if we do GRN second time , the second line item alone is showing.                 

  • Turkish locale+Search error

    hi everyone, i'm using OH4j in our onlinehelp. But i am requested to implement help application in Turkish. Problem occurs at this time. When i want to Search in helpset,Oracle gives an exception after search, Exception = StringIndexOutofBoundsExcept