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

Similar Messages

  • 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

  • Problem with RFC function module from R/3 to CRM

    Hi, i have a RFC function module created in R/3, this is the code:
    function Z_CRM_PRODUCTO_INTERLOCUTOR.
    ""Interfase local
    *"  IMPORTING
    *"     VALUE(GV_VKORG) TYPE  VKORG
    *"     VALUE(GV_VTWEG) TYPE  VTWEG
    *"     VALUE(GV_MATNR) TYPE  MATNR
    *"     VALUE(GV_KUNNR) TYPE  KUNNR_V
    *"  EXPORTING
    *"     VALUE(GV_KDMAT) TYPE  MATNR_KU
    *"     VALUE(GV_POSTX) TYPE  KDPTX
    *"  EXCEPTIONS
    *"      NOT_FOUND
      UNPACK GV_MATNR TO GV_MATNR.
      UNPACK GV_KUNNR TO GV_KUNNR.
      select single  KDMAT POSTX
              into (GV_KDMAT, GV_POSTX) from KNMT
              where   VKORG = GV_VKORG
                      and  VTWEG = GV_VTWEG
                      and  KUNNR = GV_KUNNR
                      and  MATNR = GV_MATNR.
      IF sy-subrc <> 0.
        RAISE NOT_FOUND.
      ENDIF.
    endfunction.
    When i call this function from CRM, i do it like this:
    CALL FUNCTION 'Z_CRM_PRODUCTO_INTERLOCUTOR'
      DESTINATION LV_RFCDEST
      EXPORTING
        GV_VKORG  = lv_vkorg
        GV_VTWEG  = ORGMAN_H-DIS_CHANNEL
        GV_MATNR  = ORDERADM_I_WRK-ORDERED_PROD
        GV_KUNNR  = WA_DATOS_PER-N_PAGADOR
      IMPORTING
        GV_POSTX  = IT_POS_LINE-DESCRIPCION
        GV_KDMAT  = IT_POS_LINE-material
      EXCEPTIONS
        not_found = 1.
    where:
    it_pos_line-descripcion type string
    it_pos_line-material type string.
    Well, my problem is that when debugging, in R/3 the 2 return values have the correct value, but when they are passed to CRM they have only one position.
    As i've been told, it was working ok, but it's being wrong since we made a ¿conversion to unicode?. Maybe I should change the type of return ???
    Thanks in advance !!!

    Hello Maria,
    Make sure you define your parameters in CRM exactly the same way as in R3, do not use type string here.
    So:
    it_pos_line-descripcion type C char 40,
    it_pos_line-material type C length 35.
    Kind regards,
    John.

  • Calling RFC Function module from JAVA

    Hi All,
       We have created a RFC Function Module for Billing Plan tab in Sales order (BDC). The function Module contains BDC. When we are running the same function module in SAP it is working fine. But when the FM is called in Java , it is allowing only maximum of 5 entries , when we trying to insert at 6th position in billing plan tab, we are getting an error.
    Can any one help on this.
    Points will be rewarded for helpful answers.
    Thanks & Regards,
    Kiran I

    I think the problem is because of the number of lines displayed on the screen in the BDC session in the Billing Plan.
    You might have to add the page down logic to your BDC program.

  • 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

  • Standard Component in CRM that will call RFC Function Module

    HI all,
    Is there any Standard Component in CRM that will call RFC Function Module from ECC and that called RFC FM should Fetch the data from ECC.

    You can call RFC from different places, like programs, function modules, web dynpros, classes...
    So you just have to have appropriate RFC on ERP side and call it from CRM side. To call it you use the following statement...
          CALL FUNCTION 'YOUR RFC FUNCTION'
            DESTINATION i_dest "name of server
            EXPORTING
              your export parameters
            IMPORTING
              your import parameters
    Regards.

  • How to debug a RFC function module remotely from another R/3 system?

    Hi experts,
       I have RFC function module in one R/3 system. I am calling this from another R/3 system that is cross apps (Xapps).
       This function module is Synchronous.
      Is it possible to debug this function module from cross apps?
      Can somebody give me the steps?
    Thanks & Regards
    Gopal

    Hi Shree,
       Can you explain it bit more?
       Do I have to call the function  module with "IN BACKGROUND TASK"?
       Or is it that I have to just put external breakpoint in the function module?
       Please help
    Thanks
    Gopa

  • How to debug Function Modules from ISA!!!

    Hi Gurus,
                     How to debug the function modules from ISA.
    For Ex:If i am in shopping cart or product catalog,e.t.c..i need to know which FM is calling from backend, how to debug the FMs/Bapis related to that from ISA side.
    direct me to all the possible ways.
    Regards,
    Anil.

    Hello Anil,
    There are a few things you need to look at when trying to debug .
    1. The function module needed ( you can do a trace to see which one is called.)
    2. The user that is been user With statefull and stateless connection the FM can be called by either the JCO user or the internet user. This will need to be considered when setting your external break point.
    3. The server been used, You will need to check the XCM to see which server is been used ie are you using a group connect of a specific server , You need to make sure that you are setting the breakpoint on the server that is specified in the XCM.
    Have a look at note [871907|https://service.sap.com/sap/support/notes/871907]   the attachment to the note may help you a lot. .
    Hope this helps.
    Regards
    Mark
    Edited by: Mark Foley  on Feb 11, 2009 11:10 AM

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Using RFC Function Module to send data to NON SAP Application

    Hi friends,
    Please guide me how can I send data from SAP -> Dotnet Applcation using Dotnet Connector through RFC function module from SAP side. In my scenerio, I Run Z transaction  to executte RFC function module which create some data to pass to dotnet connector.
    Regards,
    Rajesh Kumar

    Hi,
    You can make use of Dotnet connector to read the content of SAP RFC .. (eaiest of all)
    The RFC can be executed using connector , and can read the data simultaneously.. u need to code in dotnet for this..
    else create a webservice and read it from dot net ..
    Regards
    Renu Gusain
    Edited by: Renu Gusain on Jan 25, 2010 12:55 PM

  • RFC function module with call transaction  and Import memory ID

    Hi,
    I am calling RFC function module from R/3 which exists in BW.
    In BW stand alone function module works fine.
    When I am Calling from R/3 it is not working,
    Can you tell me is it because of the below code, And suggest if any corrections required.
    I am calling the call transaction and using EXPORT memory iD inside the program
    and IMPORT in after that.
    And populating RFC table's table  " p_i_tcode_user" finally.
    set parameter id 'TCD' field p_tcode.
    call transaction 'Z_BW_RSUSR002' AND SKIP FIRST SCREEN.
      ENDIF.
    get the final user data from submitted program
    import gt_users_complete from memory id tcode_userid.
    LOOP AT gt_users_complete.
          lwa_tcode_user-tcode =  p_tcode.
          lwa_tcode_user-uname = gt_users_complete-Bname.
          APPEND lwa_tcode_user TO p_i_tcode_user.
    ENDLOOP.
    Thanks,
    Veerendra.

    HI,
       Can you just exaplin it clearly plz..
    Thanks
    Mahesh

  • Unable to find the RFC function module in the impoting list in IR

    HI
    I am trying to import a RFC function module from the R/3 system.
    I am not able to find the RFC in the list that comes for the RFC  function modules that can be imported.
    The RFC is present in the destination system and is actiated too
    If anyone has and idea why is such a thing happning
    Regards
    Nikhil

    Hi Nikhil,
    The Checklist,
    1. Check the connection parameter at XI
    2. Make sure ur function module is remote enabled
    3. Make sure ur RFC exists for the same user, client credentials
    Regards,
    Prateek

  • Remote Function Module call from ECC to CRM (how to pass parameters?)

    Hi there,
    I have a remote FM that I would like to call from ECC to CRM. The FM is remote-enabled, so I assume that I can call this from CRM. However, in CRM some of the table structures that is required are not available. Hence, my export/import parameters won't be match, unless I create those types in CRM, but this is going to major work!! 
    How do we pass/import the parameters since the data type in ECC is vastly different/not available in CRM?
    Cheers

    The structure will need to be defined in CRM.

  • Debugging an RFC function module

    Hi,
    I am making an RFC call from Server(RDH) to server(RDI).The problem i am facing is that i am not being able to return debug the function module nor is this returning any values. The function module has been transported to the RDH and Rdi servers.
    One reason could be that the destination returned by teh function module us wrong but the people concerned insist that it is correct. I am at a loggerheads.
    Thanks
    CALL FUNCTION '/GLB/RGT_RFC_DESTINATION'
        EXPORTING
          destsysttype                 = l_c_o "commercial box
        IMPORTING
          rfcdest                      = v_comdest
        EXCEPTIONS
          no_destination_found         = 1
          own_logical_system_not_found = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
        MESSAGE i004."Destination not maintained
        LEAVE LIST-PROCESSING.
      ENDIF.
      CALL FUNCTION '/AOA/FAO_RFC_BILL_INFO'
        DESTINATION v_comdest
        EXPORTING
          im_i_bsid10           = i_bsid10
        IMPORTING
          ex_i_billing          = i_billing
          ex_i_vbfa             = i_vbfa
          ex_i_vbpa             = i_vbpa
        EXCEPTIONS
          communication_failure = 1
          system_failure        = 2
          OTHERS                = 3.

    Did you check in SM59 whether the said RFC destination is maintained and if it is able to connect to the destination.

  • Debugging of ABAP Function Module through ISA Application CRM B2C 4.0

    Hi Experts
    There is way to Debug ABAP FM through ISA CRM b2c Application by Modifying some XML Files as per Extn Guide.
    I tried modifying the <APPLICATION_HOME>\WEB-INF\xcm\customer\modification\modification-config.xml After that I restarted the Application .
    But it is not Breaking for Both Statefull & Stateless FM after running my Application.
    With Some Help i found that if we try it on Remote System ( Means SAP GUI has to in Same System where CRM is Installed ???????????). but that is not Advisable Right !!!.
    So if i am able to Debug ABAP Function Module through ISA Application from any Other remote System.
    I think it will be very Useful.
    Thanks & Regards
    Ravi Sah

    Ravi
    It is other way around !!!
    You should have SAP GUI installed on the machine in which you start(access) your B2C Application. This enables for ABAP Debugging.
    We have tried this and works fine for us !!!
    Thanks
    Jack
    <b>Allot points if my post helps !!!</b>

Maybe you are looking for