Debugging the Functional Module in Background.

I am calling a Custom Functional module in Background mode using the syntax CALL FUNCTION ZFM in background task.
Can anyone tell how to debug the code using this..
Thanks ,
Yatish

Hello Yatish
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 <b>SM50</b> and search for the background process.
(3) Choose from menu <i>Program/Mode -> Program -> Debugging</i>
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).
Regards
  Uwe

Similar Messages

  • Error in debugging tRFC Function module (in background task) in SM58

    Hi,
    I am trying to debug this statement:
    CALL FUNCTION 'CRM_UPLOAD_TRIGGER'                 
      IN BACKGROUND TASK                               
      DESTINATION gv_smof_erpsh-rfcdest AS SEPARATE UNIT
    I have followed these steps:
    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.
    but still i cant find any entry in SM58.
    Can anybody help me out in this?
    Thanks a lot.
    Best Regards,
    Shweta

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • 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

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

  • Debugging outbound function module

    Hi,
        I am trying to create or save sales order(va01). I am using ZWIP as the output type and transmitting the details to 3rd party system using idoc. Now Once I save, I could see the out bound idoc being generated. But when I put the break-point in the underlying function module, the process is not stopping there. I want to debug that function module. But all the time the idoc has been generated without stopping at the break-point.
    How do I debug the function module for the outbound idoc?
    Any ideas would be appreciated.
    Thanks
    Sachin

    HI,
    Before saving, put '\h' incommand line and press enter, it will go into debugging then goto settings then update debugging. Then you can press F8 to go the break-point you have create before FM.
    Reg,
    Sachin

  • 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

  • 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

  • What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?

    Hi experts,
    I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
    1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
    2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
    3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
    Finally, thanks for reading and help.

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • Jobs to run the function modules to extract the generic extarctors

    Gurus,
    I have a Datasource 'ZCMS_PP_TRAN' with extract structure 'ZBW_ST_CMSD_PP'. The extract structure is populated using the function module Z_BW_GET_CMSD_PP.
    But how do I schedule this FM or in general, are they run using std programs?
    Thanks,
    Simmi

    Hi Simmi,
       what ever it may be the DS(i mean Business Content DS, Generic DS).... these will extract the Data using Dynamic Function Calls(not always). Comming to Generic DS using FM, this will be called using Dynamic Function Module.
    In RSA3 or while extracting data from BW, you will pass request number, Update Mode, debugging option, selection fields, BW source System ID, DS Name.
    Based on these details system will extract the underlying extract structure and function module(or table/view/infoset).
    No job(Job created from BW while extracting data in the source system BI_requestid) created for Generic DS while extracting data in SAP.
    For Queue Delta, Background job will be created, it will move the data to Delta Queue.
    i will update the thread with related function modules. Try to debugg in RSA3, you could find all the information.
    all the best.
    Nagesh.

  • Function module in background task

    Hi,
    I have a user-exit, that must modify a value. But this value  have a lock entry (it's my own transaction that set this lock-entry). So I would like to call a function in background task to modify the value when the lock entry disapear.
    But ...
    I don't see anything append in the SM50.
    If I call the function not in background, I could debug the function.
    When I set background debugging nothing append.
    I have set the RFC option in the function module.
    CALL FUNCTION 'ZCALL_MB26_CONFIRMATION_OT'
      IN BACKGROUND TASK AS SEPARATE UNIT DESTINATION 'NONE'
    Rgd
    Frédéric

    Hello Fred,
    This is a sample code to wait for unlock (but if a user is in modification it can be endless).
      data : w_garg like  seqg3-garg.
      data : t_enq like seqg3 occurs 0.
      concatenate sy-mandt tplnr into w_garg.
      do.
        refresh t_enq.
        call function 'ENQUEUE_READ'
         exporting
           gclient                     = sy-mandt
           gname                       = 'IFLOT'
           garg                        = w_garg
      GUNAME                      = SY-UNAME
      LOCAL                       = ' '
    IMPORTING
      NUMBER                      =
      SUBRC                       =
          tables
            enq                         = t_enq
    EXCEPTIONS
      COMMUNICATION_FAILURE       = 1
      SYSTEM_FAILURE              = 2
      OTHERS                      = 3
        if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        if t_enq[] is initial.
          exit.
        endif.
      enddo.
    David

  • Trace or debug the IP module

    Hi,
    I develop a ethernet device driver with streams and dlpi. I don't know when I send a message upstream which module will receive this message.
    Is there any possibility to trace or debug a streams connection between a ethernet device-module an the IP module over it?
    Thank you greatly in advance.
    Claus

    Hi,
    From the Debugger, you can set the debugging mode and the system behavior in the event of a kernel warning by choosing Settings.
    <b>System Debugging</b>
    If you set this option, the Debugger is also activated for system programs (programs with status S in their program attributes). When you save breakpoints, the System Debugging setting is also saved.
    <b>Update Debugging</b>
    Update function modules do not run in the same user session as the program that is currently running in the ABAP Debugger. These function modules are therefore not included in debugging. Only if you select the Update Debugging option can you display and debug them after the COMMIT WORK.
    <b>In Background Task: Do not Process</b>
    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.
    Regards
    Sudheer

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

  • Debugging RFC function module from ECC to CRM

    Hi All,
    My requirement is to debug an RFC function module present in CRM(7.0) system from ECC(6.0) system. A report program in ECC will call CRM custom FM. I found many posts in SDN with the same issue and tried to implement suggestions provided there. But I couldn't succeed. The approach I followed is:
    I logged in to ECC report program and kept an external breakpoint just before the function module call.
    I logged in to CRM system, opened the function module and kept an external breakpoint there.
    In both the systems I provided the dialogue userid( id through which I log in to SAPGUI) in the system->settings->debugging option.
    In CRM I activated the external break point in  transaction SRDEBUG.
    Now when I execute the report program in ECC, control stops at the breakpoint. If I press F5 at the function call, control is not going to the external break point set in the CRM FM. I am getting output of FM directly.
    I tried with different settings like turning on the check box for IP matching and session breakpoint active immediate, switching to classic debugger etc. I also tried to provide the RFC user id instead of dialogue user but system throws exception saying only dialogue userids are allowed. I found that by inserting an infinite loop statement, control goes inside the RFC CRM FM but I prefer not to change the code.
    Please let me know if I missed anything.
    Thanks and Regards,
    Naren

    Hi,
    Debug RFC calls
    When an RFC function module is called it is usually not possible to debug the call, using the below techniques we can achieve the same. For this example we are calling an RFC enabled FM in ECC system from CRM system.
    Scenario 1: Calling a custom RFC FM
    STEP 1: Add an infinite loop in the remote custom Function Module (adding a u201CDO. ENDDO.u201D statement at the start of the FM would be enough).
    STEP 2: Execute your program in the CRM system. The execution stops at the RFC call, because of the infinite loop.
    STEP 3: Now login to the ECC system and go to transaction SM51 select the process which is executing the RFC and navigate to the menu: u201CProgram/Session->Program->Debuggingu201D this triggers the debugger session in a separate window.
    Scenario 2: Calling a Standard RFC FM
    When we are debugging a standard program we cannot add the infinite loop, hence we cannot go to SM51 and debug the work process. The RFC destination for the ECC system has a User specified, the RFC function module gets executed using this users credentials. Usually the basis team set up the RFC user as non Dialog user, this does not allow debugging. Contact your Basis team and get this changed to a dialog user enabling you to debug RFC function calls via the normal debugger.
    Note: User name configured in the RFC destination (transaction SM59) 
    Note: User type for the RFC User (transaction SU01D)
    Hope this will be helpful..

  • Jco Call a Function Module in BackGround

    Hello All.
    Some one can send me a simple exemplo how to call a ABAP Function Module in BackGround.
    Can i set this in Java side?
    ..or only set the BackGround Work Process in SAP side?
    In my java application call the Abap Function Module like this:
    client.execute(function);
    How to set parameters to execute the function in BackGround.
    My rpoblem is when the return the data to java side ...occurs the error TIME_OUT in Dialog WorkProcess.
    I need to call in background to better performance and to prevent the TIME_OUT.
    Best regards.
    Taylor.

    Hi.
    I don’t know how to do, but, you can do a previous RFC, this new RFC execute the original function in background mode. I did something like that:
    - JAVA: client.execute("RFC_FUNCTION", input, output);
    - SAP: RFC_FUNCTION:
    CALL FUNCTION func IN BACKGROUND TASK
                         [DESTINATION dest]
                         parameter_list
                         [AS SEPARATE UNIT].
    or
    CALL FUNCTION update_function IN UPDATE TASK
                                 [EXPORTING p1 = a1 p2 = a2 ...]
                                 [TABLES t1 = itab1 t2 = itab2 ...].
    I hope that help you

  • 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

Maybe you are looking for

  • Line item missing from FBL3N report

    Line item is missing from FBL3N report. I am selecting correct parameters for FBL3N report. The correct balance is shown in the FS10N report. I have checked the document, it is not reversed. Can anyone please tell me the reason for the same?

  • ITuns keeps opening itself

    Hi guys! my problem is just as the subject says! Itunes keeps opening itself I tried everything but can't get around this. NOTE: didn't have ituneshelpper to open at login in the first place. First i tried deleting itunes preference files - didn't wo

  • Lumia 1320 overheating

    My lumia 1320 keeps overheating. After using an app that requires either gps and data usage or just some Game my phone shuts Down after 5-10minutes and is really hot. What is the problem?

  • Hashing

    I am creating a hashing program and the way I am going about it is to have an array of 20 elements and have a vector associated for each element. The first time the an element is hashed to the array it is put directly into the array element. the next

  • I cant download new app because it keep asking  for my billing info an when i put it in again it continue to ask for it again

    i cant not get into my app store because it keep asking for my billing info an when i put it in again it pops back up asking for my billing info again