tags:

views:

2061

answers:

3

Hello!

I'm a ASP.NET and ABAP developer. For years, I used RFC's to communicate with ASP.NET using SAP .NET Connector.

During the integrated tests, sometimes we need to debug a RFC that has been called from ASP.ENT, just because the bug we are facing does not happens at SE37.

So, everytime I needed to debug the RFC, I just inserted:

IF <<CONDITION>>. WHILE 1 EQ 1. BREAK-POINT. ENDWHILE. ENDIF.

By doing so, the program gets stuck. Then I go to SM50 and debug it.

I was wondering if there is any other way of doing this, because I don't like the idea of changing code in order to debug, or implementing some debug control functionality.

So, what do you do when you need to debug RFC's?

Thanks in advance!

A: 

Tricky .. can you elaborate what you mean by "the bug does not happen at se37"?

Does that mean that you cannot reproduce the data that leads to your problem or that the problem is specific to the fact that the function module is called via RFC?

Usually, you should be able to use se37 to start the function module, and there are some ways to record different data constellations to the function module. The behavior of the function module should be the same, regardles of being called from se37 or via RFC ...

IronGoofy
Example:We have this BDC for CA02. It worked very well at SE37 tests, but when we call the RFC from ASP.NET, it just didn't work. And if we generated SM35, and executed manually, it just works fine!So the problem was that, this particular funcionality does not support RFC and BDC execution.
Bruno Lucattelli
Using BDC through RFC may lead to "interesting" errors. To me, this sounds like the data transfer in the call is not working correctly. Try to write a wrapper around the BDC calls and inspect the data with the method you described.
IronGoofy
+3  A: 

Hi,

I assume you are using a fairly recent version of sap ( 4.7+ ) Do the following :

  • Get the username that makes the RFC call into SAP in ASP
  • Fire up SE37, go to the code section of your RFC
  • Look at the menu on top, click on 'Utilities'
  • Click on Settings
  • Go for the Debugging tab
  • Fill in the username that will make the call from ASP
  • Click IP Matching ( otherwise a debug session appears for every time any user makes the call )
  • Session breakpoint active immediately is nice to click as well
  • Put your external breakpoint where you need it ( click the icon with the stop sign and the little man )
  • Test your ASP connector
  • The breakpoint should come into effect , a debug window will pop up
  • You might not have the authorization to do this, if it doesnt work, use SU53 to find out what you're missing.

This should work,

T.

tomdemuyt
Will the debug window be in SAPGUI or in the ASP "app"?
IronGoofy
This will be in the SAPGUI, you will have to be logged in to the right system and client of course with debug authorizations etc.
tomdemuyt
Thanks Tom! It just works very very well!!Thanks!
Bruno Lucattelli
A: 

When you call a RFM via SE37 you unknowingly use SAP selection screen. In case you have a table with header-line when invoked from RFC it might have header line "filled up"

In case you call same FM from RFC the header line in initial.

LOOP AT PT_JNC. EXIT. ENDLOOP. or READ TABLE PT_JNC INDEX 1.
will help populate header line

This is a subtle difference. Other simple differences are SAP uses YYYYMMDD date format and HH24MISS time

Regards jnc at Kolkata

jnc at Kolkata