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

How to debug a remote function module in calling system? Help!

Former Member
0 Likes
7,782

Hi Experts,

I have a ABAP report (in System A) from where I am calling a remote function module which exists in a different system B.

ABAP Program(System A)<----calls--


RFC(System B)

Can I debug the RFC funnction module in system A using ABAP debugger? In other words if i put a breakpoint on the "call function" statement then in debug mode I want to see that the control is going to system B and I should be able to process the FM code line by line. Is this possible?

Is there any special transaction or settings?

Is there any alternative?

Please help

Thanks

Gopal

14 REPLIES 14
Read only

Former Member
0 Likes
3,489

As per my knowledge. I dont think that is possible.

Read only

Former Member
0 Likes
3,489

Approach 1. Just before the RFC call keep a break point. Once you reach the statement CALL FUNCTION you will be logged on the target system.

Approach 2. Log on to both the systems subcutaneously. Keep External breakpoint on the target system and see if call stops there. In principle it should stop there.

To set external breakpoints. go to ABAP code->Utilities->Debugging->Check the Flag External Debugging to Active and put your user ID there.

Amandeep

Read only

0 Likes
3,489

HI Amandeep,

I tried your approach but it did not work.

I kept an external breakpoint on the CALL FUNCTION statement. Then in debug mode, I don't get remote system login. The control stops at the breakpoint and on pressing F5 it goes to the next statement where I am checking the sy-subrc which is '0'.

Is there any other settings required?

Please help me!

Thanks

Gopal

Read only

0 Likes
3,489

Hi Gopal ,

u need to try Approach 1 of Amandeep, in this case , what user id u are using for RFC calls ? , take that user id , log on to SAP with that ID , and put a external Break point, then it will tigger.

regards

Prabhu

Read only

0 Likes
3,489

Hi Prabhu/Amandeep,

I have tried option 1 also.

"Approach 1. Just before the RFC call keep a break point. Once you reach the statement CALL FUNCTION you will be logged on the target system"

But in debug mode the control goes to next step after CALL FUNCTION. In other words I am not getting any login prompt to login to target system.

CALL FUNCTION 'XYZ' DESTINATION RRR.

-


if sy-subrc = 0.

do something.

endif.

In debug mode first the program execution stops at CALL FUNCTION statement. Then on pressing F5 the control goes to "if sy-subrc = 0" line.

What i want is, the program control should go to the given function module.

Please help me!

Thanks

Gopal

Read only

0 Likes
3,489

Hi Gopal ,

In other words I am not getting any login prompt to login to target system.--->No man , u dont get any option to Log on , while definiing RFC u will give lon on details .

are u sure ur program is executing that FM ? , i dont see any issue expect Authorizations or u are not doing in the right way.

try /nSU53 to find out ur authorizations.

regards

Prabhu

Read only

0 Likes
3,489

Hi Gopal

If the function module is not executed properly then the control will come to IF statement ( returning sy-subrc >< 0).

So check whether that function module is executed correctly , ie sy-subrc = 0.

Regards

Prabumanoharan

Read only

0 Likes
3,489

Hi Prabhu,

Yes, my program is excuting the FM. I can see tha the sy-subrc is 0 after CALL FUNCTION statement.

But still I want to debug the remote FM from calling program

Is this possible?

Thanks

Gopal

Read only

0 Likes
3,489

Hi Gopal,

I am suggesting you by assuming that in the SystemA you have an option to debug.

Check what are the parameters had been passed to the RFC and come to R/3 system and pass the same parameters and debug the RFC.

Regards,

Balaji.

Read only

0 Likes
3,489

Check if you have debugging authorizations in the target system.

Check if RFC destination is pointing to the right system.

Approach 1 should definitely work.

Amandeep

Read only

Former Member
0 Likes
3,489

hello,

Try this method.

first check whether RFC connection is working b/w 2 systems.

if connection is working, then do like this.

In System B , put endless loop in FM before some main select statement.

like

DATA : v_a TYPE c VALUE space

DO .

IF v_a = 'X'.

EXIT.

ENDIF.

ENDDO.

the above code will be endleep loop.

In system A, when cursor goes to CALL FUNCTION DESTINATION 'XXXXX'.

u shud be logged in system B. the moment control comes to system B.goto tcode SM50 . check ur username . choose that particular checkbox then in menu bar --> program/session --> Program --> Debugging.

i hope it will help u.

try & let us know.

Thanks,

Manjunath MS

Read only

Former Member
0 Likes
3,489

Hi,

at the point where the RFC is called put ann External Breakpoint and then Execute.I'm not very sure but i think it shud work,plz let me know if it works.

Thanks.

Read only

Former Member
0 Likes
3,489

If you use the search, then I am sure you will find something about "remote debugging" and "single step" ... F5 ...

Cheers,

Julius

Read only

Former Member
0 Likes
3,489

If you establish trusted RFC connections between the two systems then it will automatically take you to the target system after the call function step in debugging mode.

Thanks,

Krishna