How to DEBUG a function module running in background mode? Please help!

Hi Experts,
   I am calling a function module in my ABAP code in background module using the following syntax:
  CALL FUNCTION 'YBBC2_CREATE_SNAPSHOT' IN BACKGROUND TASK
          TABLES
            itab_std_format_inv = itab_std_format_inv
            itab_snapshot_inv = itab_snapshot_inv.
        COMMIT WORK.
If I put the breakpoint in the CALL FUNCTION line and execute the program, the debugger does not take me to the valled function module. This may be because I am running the function module as background task.
I cannot comment this  "IN BACKGROUND TASK" statement as well since i am debugging in Quality system where I don't have change access.
So how to DEBUG a function module running in background mode? Please help!
Thanks
Gopal

Hi,
You could try to use the following trick:
(1) Put an endless loop into the coding of your function module where you want to start debugging, e.g.
  DATA:
    lx_exit_loop(1)     TYPE c.
  lx_exit_loop = ' '.
  DO.
    IF ( lx_exit_loop = 'X' ).
      EXIT.
    ENDIF.
  ENDDO.
(2) Call your function module in background task
(3) Call transaction SM50 and search for the background process.
(3) Choose from menu Program/Mode -> Program -> Debugging
Now you the debugger should bring you right to your endless loop. Set lx_loop_exit = 'X' in the debugger and continue (F5 or F6).
<b>Reward points</b>
Regards

Similar Messages

  • How to debug a function module

    hi,
    Please Tell me how to debug an Function module
    Thanks in advance
    ajay

    Hi,
    In SE37 while executing the FM there is an option to execute the same in Debugging mode. If you want to debug the FM as a stand alone code you can make use of this functionality. Provide the necessary input values and run the FM in debugging mode.
    If you intend to debug the FM from another program wherein it is called you can always set a breakpoint inside the FM and execute the code in the calling program. The control will stop for you at the point where you have set the break point inside the FM automatically.
    Hope you have a clear picture now.
    Reward if helpful.

  • How to debug a function module using in the generic datasource?

    Hi all,
    We have created a generic data source using function modulle and have been extracting the data for a single customer it contains single records but it has pulled out more than 10,000 records. how to debug the function module used in the data source.
    since we schedule for extraction in bi and back ground job gets triggered in ecc for extraction,
    i know in se37 we can select the function module name and then debug but still need to check while the bacground job is trigered through bi.
    Thanks

    Yes you can debug the Function Module.
    Open the function module in SE37 and put a break point in the code where you want to check from, then come to RSA3 and give the datasource name and check the Debug check box on this screen, once you click on the start button it will take you the place where you have placed the break point in the FM, by pressing F5 you can see the flow of the FM.
    Let me know whether this solves your issue.

  • How to debug a function module in a user exit

    Hello out there,
    I am calling a function module in the updates rules of an InfoCube.
    The function module "hangs" while running the InfoPackage - the Monitor
    shows up with "Missung Message . Update rules finished for InfoCube ...".
    How can I debug an InfoPackage or this function module run
    by the InfoPackage ?
    Thank You !
    Martin Sautter

    Hi Martin,
    well, the weblog is quite good, but for your purpose, just follow the beginning until processing stops in the code. Then, in the top menu choose Breakpoint->Breakpoint at->Function module. In the following popup enter the name of the fm close the popup and press F8. Processing will stop in the fm.
    regards
    Siggi

  • How to debug a function module that is written to extend a datasource

    Hi all -
    this is BW related question.
    I have a datasource that I extended but instead of writing the code in the user exit, I created a function group and a function module to populate the custom fields. My problem is  - I want to debug the function module and when I do that, I have to give datasource, infosource and update mode as input parameters.  There is no data in the internal table C_T_DATA, how can I debug to get data into this table. 
    please let me know.
    thanks,
    Sabrina.

    Keep the Break point Before Updating.
    just click on the table c_t_data .or choose the internal table and say CTRL+F4, you can internal table content
    you can find change, append ,delete options.
    just select the row and click append they one blank row will appear. just add entries to that , and enter
    the record will be appended, do in the same way if you need more records to add...
    regards
    vijay

  • How to debug mapping function module during delta extraction?

    Hi experts,
    Somehow our delta is not working properly, and i would like to debug our mapping function module. How can i debug it during a delta extraction?
    Some info:
    Our source system is CRM and our extractor is extracting one order document (contracts in this case). I know that when we modify a contract, a bdoc is generated and then passed throught the mapping function then the extracted data to the delta queue. I just need to debug when the bdoc is being mapped to see what's wrong with the extracted data.
    Thanks in advance,
    Van

    Hi,
    Since you are using a Function Module for the Extraction. Edit the Function Module and give "BREAK-POINT" before the loop command. Check and activate the Function Module.
    Now Extract the datasource using RSA3. Now you can debug it. After checking remove the "BREAK-POINT" from the function module. Also Check and activate the same.
    Regards
    Jayaram M

  • How to debug LAE function modules in ECC

    Hi,
    I've been trying to debug sequence of FMs called by LAE during asset creation in ECC. The asset is created for every service contract created in SAP CRM and then replicated to ECC system. While debugging the flow from CRM, I could debug upto ECC and then put external breakpoing in LAE FMs mentioned above but those FMs were not hit. 
    LAFA_ASSETS_CREATE_ON_LEASE
    LAFA_ASSETS_CREATE
    LAFA_ASSET_CREATE
    LAFA_ASSETS_RETIRED_GET
    Could anybody help me debugging these FMs?
    Regards,
    Ravi

    Hi Ravi,
    this process works asynchonous. This means from CRM some entries are stored in LAE_CRM* tables with function module FILA_BUS_TRANSACTION_RECEVIE. A triggered function picks up the entreis and process them. This function runs through your mentioned function modules.
    In a test system, you can call transaction FILATEST and copy the contract sent from CRM and using the simulation or execution function. This will bring you to these function modules.
    Kind regards,
    Steve
    Edited by: Steve Trester on Mar 1, 2011 8:13 AM

  • How to debug LAE function modules

    Hi FI Expert,
    I've been trying to debug sequence of FMs called by LAE during asset creation.
    LAFA_ASSETS_CREATE_ON_LEASE
    LAFA_ASSETS_CREATE
    LAFA_ASSET_CREATE
    LAFA_ASSETS_RETIRED_GET
    The asset is created for every service contract created in SAP CRM and then replicated to ECC system . While debugging the flow, I could debug upto ECC and then put external breakpoing in LAE FMs mentioned above but those FMs were not hit.
    Could anybody help me debugging these FMs?
    Regards,
    Ravi

    Hi Ravi,
    this process works asynchonous. This means from CRM some entries are stored in LAE_CRM* tables with function module FILA_BUS_TRANSACTION_RECEVIE. A triggered function picks up the entreis and process them. This function runs through your mentioned function modules.
    In a test system, you can call transaction FILATEST and copy the contract sent from CRM and using the simulation or execution function. This will bring you to these function modules.
    Kind regards,
    Steve

  • 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

  • Send mail using CL_BCS through function module, run in background task.

    Hi,
    I am running a function module in Background task. in this function module I am sending mail using CL_BCS class.
    but mail is not generated. if I run the same function Module in foreground mail generated successfully....
    can anyone please tell me the reason behind this.

    Hi i realise that The LIST_TO_ASCII thing is not working correctly in background because the the list-processing in beckground is working not the same as in dialog i think.
    I can only get the last page of the list out when running in background. Any solution to this?
    my code:
        CALL FUNCTION 'LIST_TO_ASCI'
             EXPORTING
                  list_index         = sy-lsind
             TABLES
                 list_dyn_ascii = downtab
             EXCEPTIONS
                  empty_list         = 1
                  list_index_invalid = 2
                  OTHERS             = 3.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
    Thanks ,
    LH

  • Debug a functional module

    Hi,
    Could you please tell me how to debug the function module.
    Thanks,
    Subha.

    In SE37 while executing the FM there is an option to execute the same in Debugging mode. If you want to debug the FM as a stand alone code you can make use of this functionality. Provide the necessary input values and run the FM in debugging mode.
    If you intend to debug the FM from another program wherein it is called you can always set a breakpoint inside the FM and execute the code in the calling program. The control will stop for you at the point where you have set the break point inside the FM automatically.
    check this link also
    http://help.sap.com/saphelp_nw04s/helpdata/en/d1/801f36454211d189710000e8322d00/content.htm

  • How to invoke RFC function module from XI interface

    Hi all,
    I am having one question, How to invoke RFC function module from XI interface.
    Please reply me as soon as possible.
    Thanks in advance,
    Radhika

    Hi,
    To call the RFC in mapping u need to create the RFC lookups...check these links.
    How we have to create the lookups?
    Check this weblogs with some screenshots on how to achieve this:
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
    /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    lookups in xi
    XI Design Guidelines
    Re: RFC Lookup API
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Regards,
    Phani

  • How to save a function module on to your harddrive

    Dear all,
    I need to backup a set of function module on  to my harddrive. please help me.
    VJ

    Check my weblog...It might help you -;)
    <a href="/people/alvaro.tejadagalindo/blog/2006/03/18/taking-good-care-of-z-function-modules good care of Z Function Modules</a>
    Greetings,
    Blag.

  • How can I debug a Function Module used by smartforms

    Hello everyone,
    i have a problem with the function module /1BCDWB/SF00000040.
    It's a module executed from a smartforms form. I need to debug this
    function module while printing an invoice. While printing it should jump
    to the place of the function module.
    Would be grateful if someone could help me.
    Best regards
    F. Hoppe

    This is exactly what i have done last time.
    The problem is that the breakpoint does not stay at the same place
    when i activate it in the module itself.
    Isn't there a transaction you can put breakpoints specific to a FM?

  • How to use these function modules

    Hi all,
    can anyone help that how to use these Function modules to update the status of a task, what are all the inputs i required to proceed
    1. FC_USER_AUTHORITY_CHECK
    <b>2. FC_USER_STATUS_CHECK
    3. FC_USER_STATUS_UPDATE</b>
    4. FC_USER_GET_CACTI
    5. FC_USER_CHECK_FOR_OUTPUT
    Thanks in Advance
    Ganesh

    Hi Rob,
    thanks for ur reply,
    but they are not clear what they are meant to be, I understood there are some flags needed to run the Function Modules 2 & 3 which are in bold...
    but how do i populate them.. i am not getting that..
    thanks
    ganesh

Maybe you are looking for

  • SQL Server 2008 64-bit - Master Data Services troubleshoot database create Error

    I am getting the following error when trying to create a new database in SQL server using MDS         Microsoft.MasterDataServices.Configuration.ConfigurationException: Data is Null. This method or property cannot be called on Null values. ---> Syste

  • Has anyone been able to email a video?

    I have been able to upload to youtube (though one uploaded sideways) but every time I try to email a video-I get compressing", then "sending 1 of 1" , and then "cannot send mail-and error occurred while delivering this message.

  • MSG_ID without @ sign

    Hi When we send a message from our internal application to B2B with a MSG_ID without a '@', B2B will not use the MSG_ID as the protocolmessageid but generates a new one. The protocolmessageid is included in the ebMS message which is sent to the tradi

  • Controlling level of JPEG compression when exporting from iPhoto 6?

    Hi all, I'm wondering whether one can adjust the level of JPEG compression when exporting images? I'm still on iPhoto 4 that unfortunately doesn't offer this option and by default produces fairly large images that aren't well suited for web presentat

  • Remove plug-ins

    How can I remove plug-ins? I've done trials with a couple of different HDR plug-ins and would like to remove the ones I didn't choose.  Even after deleting the HDR trial program from the list of apps the plug-in remains. Checked all the usual places