Call function in debug mode

Hi,
when I´m on the test function screen of se37, I can run the function in debugging mode and it´s starting with the debugger on the first code line.
Is it also call a function from a report in this debugging mode?
thank you!
reward points guaranteed

Thank you for your answers...
Let me explain a little bit more in detail, what I want to do.
I have an XML interface function which is going to be called by an
external application about RFC, reading binary data,
interpreting that as XML and doing something in the SAP system afterwards.
As the system is a 4.6C I can´t debug externally, I want to provide
a debugging function in a monitoring application for that.
As people are using the monitoring, which are not familiar with all
the code behind that, I want to start the debugging mode by myself,
without setting a breakpoint.
Let me describe it like this:
When you type in /H in the transaction field in the SAP menu bar, the
debugging mode is going to be started for further actions.
All I want to do is starting that /h debug mode without typing anything
in the transaction field, just inside of the report.
How can I do that?
Michael

Similar Messages

  • Calling function in mxml mod

    I have my main mxml file and then I have a module that I have developed... I want to be able to call a function in that module from my main application... This is what I have done, and it keeps giving an error saying this:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Here is my code in a nutshell:
    Main.mxml
    <mx:WindowedApplication xmlns:mods="mods.*">
         <mx:Script src="general.as" />
         <mods:MyObject id="MyObj" />
         <mx:Button click="LoadObjData();" />
    </mx:WindowedApplication>
    general.as
    import mods.*;
    private function LoadObjData():void {
         MyObj.CustomFunction("Test Data");
    mods/MyObject.mxml
    <mx:Script>
            <![CDATA[
                public function CustomFunction(CustData:String):void {
                    MyLabel.text = CustData;
            ]]>
    </mx:Script>
    <mx:Label id="MyLabel" />
    //// Can anyone explain to me what I am doing wrong?

    Is Module the root tag of MyObject.mxml? if so, you are not using it as a module instead you are trying to use it as a custom component.
    For more info on modules, take a look at http://blogs.adobe.com/aharui/2007/03/modules.html
    if it is actually a custom component, post the full code for MyObject.mxml - so we can look.
    Thanks,
    Gaurav Jain
    Flex SDK Team

  • Execute an ABAP ".txt" file with a call function

    Hello,
    I'd like to know if it exist a "call function" or another way to execute an Abap program which is written within a ".txt" file.
    1. I'd like to write an Abap program into a ".txt" file
    2. Create an Abap program which will read the ".txt" file (& upload it into an internal table for example) & execute this Abap code.
    Is it possible?
    Thanks in advance for your answer.
    Samuel

    Something like this -:)
    REPORT z_test_query.
    * TYPES                                                           *
    TYPES: BEGIN OF ty_lines,
           line TYPE string,
           END OF ty_lines.
    * TABLAS INTERNAS                                                 *
    DATA: t_lines TYPE STANDARD TABLE OF ty_lines,
          t_program TYPE STANDARD TABLE OF progtab WITH HEADER LINE,
          t_writes TYPE STANDARD TABLE OF listzeile.
    * VARIABLES                                                       *
    DATA: w_file_name TYPE string.
    * FIELD-SYMBOLS                                                   *
    FIELD-SYMBOLS: <fs_lines> LIKE LINE OF t_lines,
                   <fs_write> LIKE LINE OF t_writes.
    * SELECTION-SCREEN                                                *
    SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME.
    PARAMETERS:
                p_file TYPE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK file.
    * AT SELECTION-SCREEN ON VALUE-REQUEST                            *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_filename CHANGING p_file.
    *&      Form  GET_FILENAME                                        *
    FORM get_filename CHANGING po_p_file.
      DATA: ls_field_name TYPE dynpread-fieldname.
      ls_field_name = 'P_FILE'.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = syst-cprog
                dynpro_number = syst-dynnr
                field_name    = ls_field_name
           IMPORTING
                file_name     = po_p_file.
      w_file_name = po_p_file.
    ENDFORM.                    " GET_FILENAME
    *   START-OF-SELECTION                                            *
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename = w_file_name
           TABLES
                data_tab = t_lines.
      IF sy-subrc EQ 0.
        LOOP AT t_lines ASSIGNING <fs_lines>.
          MOVE <fs_lines>-line TO t_program-line.
          APPEND t_program.
        ENDLOOP.
      ENDIF.
      CALL FUNCTION 'RFC_ABAP_INSTALL_AND_RUN'
           EXPORTING
                mode        = 'F'
                programname = 'ZDUMMY_TEST'
           TABLES
                program     = t_program
                writes      = t_writes.
      IF sy-subrc EQ 0.
        LOOP AT t_writes ASSIGNING <fs_write>.
          WRITE:/ <fs_write>-zeile.
        ENDLOOP.
      ENDIF.
    Greetings,
    Blag.

  • Debug-mode and function calls

    Hi there,
    I'm coding a program in SE38 in a BW environment and there is a function call made (RSDRI_INFOPROV_READ). It seems that the table returned by this function won't accept double entries (which should be the case for standard tables), however, when I execute my program in debug mode, it does everything like it should. Anyone knows why it doesn't work when i choose execute as background job? It's hard to find what's wrong since in debug all goes well...
    thank you,
    Tom

    Why not debug the program in background running?You can add a endless loop before the code you are interested in, and then enter debug mode to jump to the focus code at background job console.

  • Function Module working only in debug mode

    Hi all,
    The following Function Module works only in debug mode. The purpose of this FM is to create a notification and to put it in progress status. If I put a breakpoint before "CALL FUNCTION 'BAPI_ALM_NOTIF_PUTINPROGRESS'" it works. If I execute this FM without putting a breakpoint at that place it creates the notification but doesnt put it in progress status.
    In other words, the last BAPI call doesnot work if I dont put a breakpoint before.
    Can somebody help me to find out where is the problem?
    Thanks,
    Younes
    FUNCTION ZFM_CREATE_NOTIF_IN_PROCESS.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(NOTIFTYP) TYPE  CHAR2
    *"     VALUE(NOTIFHEADER) TYPE  BAPI2080_NOTHDRI
    *"  EXPORTING
    *"     VALUE(NOTIFNUMBER) TYPE  CHAR12
    *"     VALUE(NOTIFCURSTATUS) TYPE  CHAR40
    DATA: gs_bapi2080_nothdre TYPE bapi2080_nothdre,
          gt_return TYPE TABLE OF bapiret2.
    The notification is created with a temporary number
    CALL FUNCTION 'BAPI_ALM_NOTIF_CREATE'
      EXPORTING
        notif_type         = NOTIFTYP
        notifheader        = NOTIFHEADER
      IMPORTING
        notifheader_export = gs_bapi2080_nothdre
      TABLES
        return             = gt_return.
    READ TABLE gt_return TRANSPORTING NO FIELDS WITH KEY type = 'E'.
    CHECK sy-subrc IS NOT INITIAL.
    *The notication will be saved with a number which isnt temporary
    CALL FUNCTION 'BAPI_ALM_NOTIF_SAVE'
      EXPORTING
        number      = gs_bapi2080_nothdre-notif_no
      IMPORTING
        notifheader = gs_bapi2080_nothdre
      TABLES
        return      = gt_return.
    READ TABLE gt_return TRANSPORTING NO FIELDS WITH KEY type = 'E'.
    CHECK sy-subrc IS NOT INITIAL.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    The Notif is already created, it will be put in progress status
    NOTIFNUMBER = gs_bapi2080_nothdre-notif_no.
       CALL FUNCTION 'BAPI_ALM_NOTIF_PUTINPROGRESS'
            EXPORTING
              NUMBER             = NOTIFNUMBER
              LANGU              = SY-LANGU
           IMPORTING
             SYSTEMSTATUS       = NOTIFCURSTATUS
           TABLES
             RETURN             = gt_return.

    Hi Emmanuel,
    Now I get your problem: you want to wait to have the commit finished! The call to BAPI_TRANSACTION_COMMIT has an optional parameter 'WAIT' which is space by default which causes only a commit. When you set this parameter to 'X' it will do a commit work and wait.
    This should solve your problem!
    Regards,
    John.

  • Remote Enabled function module of SAP working - debug mode but not run mode

    Hi,
    When a remote function module is called from Java a message should get thrown from the function module which the FM is throwing but Java is not able to fetch the error. This problem is coming in execution mode but if we are in debugging mode and go to the function module  remotely the error is getting triggered.
    Please suggest the solution to the problem.
    Thanks,
    Abhishek

    Hello
    try something like this
    try {
       JCO.Client.execute(myFunction)
    } catch (JCO.AbapException ex) {
       System.out.println ("ABAP Exception: " + ex.getKey() + " " + ex.getMessage());
    the problem is, that JCo ABAP Exceptions are subclasses of java.lang.RuntimeException so the Java Compiler doesn't force you to catch them
    regards franz
    reward points if useful

  • Hey my iphone 4 has a problem regarding carrier. Its always showing searching mode and wifi-address N/A and Bluetooth address 00:00:00:00:00 and call function is disable

    hey my iphone 4 has a problem regarding carrier. Its always showing searching mode and wifi-address N/A and Bluetooth address 00:00:00:00:00 and call function is disable. Please help me. I have tried every thing ..like restore from DFU mode with out sucess.

    Refer to  Note 98458 - SAPMSSY1, CALL_FUNCTION_NOT_FOUND

  • JNI calls using dll build in DEBUG mode

    I have deployed a filter which loads a dll in the init method. The dll is build in DEBUG mode. The doFilter() method is never called. But If I build the same dll with out DEBUG parameter the doFilter() method is called. what is the issue? I need to debug the dll by attaching it to Visual Studio.
    --JArchie

    > i had a requirement to invoke a RFC Async and recieve
    > the results in my program ...
    That is not possible. When you call an RFC async, you cannot receive the result of the RFC. If you want the results, you have to call the RFC syncronously.
    When you debug, the debugger calls the RFC synchronously, to enable you the debugging of the RFC.
    Regards
    Stefan

  • Devloper system configuration (weblogic in debug mode on Eclipse/windows)

    Hi,
    I work on a project, which we may consider as big. Couple of thousads of java files, muilti-tired. We use, weblogic in eclipse on widows for development. Curreltly we have 1G ram on each of developer mechines. But most of us are complaining that, system is running slow in debug mode. Sometimes, we can't even work.
    I greatly appreciate if somebody can point me to the URL or suggestion for good system configuration, so that we can work comfortably.
    Just asking to increase the RAM may not help me in convencing the business/management. If there any specific recommandations by either by BEA or IBM (eclipse), that helps me a lot in raising the same to our buisness.
    Greatly appricate your suggestions
    Reg,
    Mahi

    Hi Bigmachini,
    According to my solution, what about your issue now?
    If you have been solved the issue, would you mind sharing us the solution here? So it would be helpful for other members who get the same issue.
    If not, please let us know the latest information about it.
    @Malik, could you please tell me if you try to check your issue by the above suggestion as I said?
    If no, please try the above suggestions to check this issue and then tell me the latest message about this issue.
    >>The error mostly occurs when debugging ADO.NET or database function calls. If code is run without debugging then there is no issue at all.
    You could also try to copy your project and then debug your project in debug mode on a another machine you install same Windows 10 OS check this issue again.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Possible CVI13 Debug Mode Bug

    I have found a possible bug in Debug mode in CVI13.  The issue is a bit complicated.  It has to do with returning a struct from a function, then referencing a char pointer in that struct in a call to sprintf.  The basic code is:
    struct TEST_STRUCT
    char *StructString;
    } TestStruct =
    "Struct String"
    struct TEST_STRUCT TestFunction(void)
    return TestStruct;
    // somewhere in the code...
    sprintf(Buff, "%s", TestFunction().StructString);
    When executed in Debug mode, the sprintf line generates the runtime warning, "Attempt to read beyond end of string".  If you select Continue the string in Buff is incorrect.  If you run the same program in Release mode it works as expected.  I found this when trying to debug a project previously built in CVI 12.  CVI 12 does not generate this warning.  I also tried refercing the string directly in CVI 13:
    sprintf(Buff, "%s", TestStruct.StructString);
     This works correctly.  I also tried using an array in the struct instead of a pointer:
    struct TEST_STRUCT
    char StructString[50];
    } TestStruct =
    "Struct String"
    This also works correctly.  I also tried using strcpy instead of sprintf:
    strcpy(Buff, TestFunction().StructString);
    This also works correctly.  The issue appears to be specific to returning a struct and then referecing a char pointer in that struct as a parameter to sprintf.
    A sample project is attached.
    Tony G
    Attachments:
    Debug String Problem.zip ‏52 KB

    Thanks for pointing this out, I'll go ahead and file a Corrective Action Request on this.
    Rob S
    Applications Engineer
    National Instruments

  • FM not working in debug mode.

    Function module : "LAGF_PROFIT_CENTER_GET" is basically meant to calculate the profit centre in ERP side.
    On booking an order in CRM side this function module is called at ERP side to calculate Profit centre.
    Problem is , normally this FM is working fine , but when i am in debug mode this FM is generating an error saying : Controlling object not found.
    Can anyone please analyse this FM and let me know the reason.
    Thanks,
    Abhi.

    Hi
    I think the onus is on you to debugg the code and deduce why it is displaying that error.
    regards
    Isaac Prince

  • Finding Events in debug mode?

    Dear All,
    I found a list of events which will be used for the transaction EA10 by the method mentioned in the video.
    http://www.sap-isu.net/video/fica-events.
    Out of the many events which are triggerred one of them is R431.
    Right now the function module in this has no code . Accept the function start and end syntax.
    When I try to put the breakpoint in this and run the transaction in the debugging mode , the flow of the program doesnt stop at the debug point.
    Why such analomy?
    Edited by: Rahul_paldiwal on Jan 6, 2010 11:30 AM

    Hi,
      If you go to the code of program LE21AF08. You will see that program will not go to the code if the function module is 'ISU_SAMPLE_R431'.
    FORM event_r431  TABLES   p_contrcl STRUCTURE t_contrcl
                     CHANGING p_iiu   TYPE isu21_invoice_unit
                              p_param TYPE isu21_invoice_param.
      PERFORM get_user_exit_function USING 'R431'.
      REFRESH: t_vkk_doc_id.
      LOOP AT t_fbstab WHERE funcc NE 'ISU_SAMPLE_R431'.
        t_vkk_doc_id  = p_iiu-t_vkk_doc_id.
        wa_t_bill_doc = p_iiu-t_bill_doc.
        CALL FUNCTION t_fbstab-funcc
          EXPORTING
            x_printdoc    = p_iiu-print_doc
            x_bldat       = p_param-bldat
            x_budat       = p_param-budat
            x_bupa        = p_iiu-bupa
            x_fkkvkp      = p_iiu-acc-fkkvkp
          TABLES
            t_contrcl     = p_contrcl
            t_bill_doc    = wa_t_bill_doc
            t_vkk_doc_id  = t_vkk_doc_id
          EXCEPTIONS
            error_message = 1.
        IF sy-subrc <> 0.
          mac_msg_putx co_msg_error sy-msgno sy-msgid
          sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 iu_error.
        ENDIF.
        FREE: wa_t_bill_doc.
      ENDLOOP.
    * for cross reference purpose only
      SET EXTENDED CHECK OFF.
      IF 1 = 2. CALL FUNCTION 'ISU_SAMPLE_R431'. ENDIF.
      SET EXTENDED CHECK ON.
    ENDFORM.                                                    "EVENT_R431
      most of time if I know the event, I just where use list the function module and go into the code and set the break-point a little bit earlier.
    Cheers,
    Chaiphon

  • CRM_ORDER_SAVE works properly only in debug mode

    I have a scenario where I'm creating two order documents (using CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE), then linking them with function module CRM_CREATE_BREL_TO_CONTRACT.  After calling CRM_ORDER_SAVE and before CRM_CREATE_BREL_TO_CONTRACT, I "commit work and wait" and call CRM_ORDER_INITIALIZE.  When I set a breakpoint immediately before CRM_CREATE_BREL_TO_CONTRACT (and thus have to pass through debug mode), CRM_CREATE_BREL_TO_CONTRACT works with no problem.  If I don't pass through debug mode, it fails and returns the flag EV_LOCKING_PROBLEM = true.
    I have added "wait X seconds" and have even added a while loop that calls CRM_ORDER_CHECK_CHANGE_ALLOWED.  But when I don't enter debug mode, this while loop runs forever.
    Does anybody know what's happening here?  I suspect there is some kind of problem with document distribution, but I'm not sure.
    Many thanks,
    Tom Peng

    Hello Tom,
    As you may already known, the lock is added in FM CRM_CREATE_BREL_TO_CONTRACT with the following coding:
          IF ls_active_switch-lock_contract <> gc_act_switch-inactive.
    *       Lock contract
            CALL FUNCTION 'CRM_ORDER_ENQUEUE'
              EXPORTING
                iv_guid           = iv_contract_header
              IMPORTING
                ev_already_locked = lv_already_locked
              EXCEPTIONS
                foreign_lock      = 1
                system_failure    = 2
                distributed_lock  = 3
                no_change_allowed = 4
                transferring      = 5
                OTHERS            = 6.
            IF sy-subrc <> 0.
    Here system checks whether activ_switch is active. If yes, the error issued.
    Thus you need to pass the parameter t_active_switch with value false when call FM crm_order_save.
    Hope this information could be helpful.

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

Maybe you are looking for