Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Debugging RFC function module from ECC to CRM

Former Member
0 Likes
3,013

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,116

Check your connection (transaction code SM59) that is used to call the RFC. Edit that connection to allow you to enter user-id and password through dialog.

Or try setting a debug point for the user id that is used in RFC connection

9 REPLIES 9
Read only

Former Member
0 Likes
2,119

Check your connection (transaction code SM59) that is used to call the RFC. Edit that connection to allow you to enter user-id and password through dialog.

Or try setting a debug point for the user id that is used in RFC connection

Read only

0 Likes
2,116

You could also try to enter in system debugging mode before pressing F5.

Read only

Former Member
0 Likes
2,116

Have a look at this [Link|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0e8b21b-e1b4-2c10-49b5-fd6a95162976?quicklink=index&overridelayout=true]

Hope it helps!!!

Read only

Former Member
0 Likes
2,116

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

Read only

Former Member
0 Likes
2,116

Hi,

As per my knowledge, you need authorization for RFC. check the role with BASIS team and ask them to assign proper role to debug in remote systems.

Regards,

Chandu V

Read only

0 Likes
2,116

Hi Naren ,

Check this link below with screenshots .

<SAPTechnical link removed>

This will help you .

regards

Deepak

Edited by: Suhas Saha on Sep 5, 2011 12:34 PM

Read only

Former Member
0 Likes
2,116

Hi Naren,

First things first, are you calling this RFC synchronously or Asynchronously. If asynchronous, you will not be able to debug the RFC through. If synchronous you should be fine with what you have done already, make sure you have added the system failure and communication failure exceptions.

Post the code where in you are calling this RFC.

Regards,

Chen

Read only

Former Member
0 Likes
2,116

Hi All,

Thanks a lot for sharing your views. The issue is resolved finally after providing debugging authorizations for the RFC user.

Regards,

Narendra

Read only

0 Likes
2,116

Hi Narendra ,

                    Could you please elaborate on the authorization part as i have got the same error saying that you are not authorized to use this function module for client xxx and transaction xxx .

Regards

Kishore Vishwakarma