Application Development 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: 

RFC?

abdul_hakim
Active Contributor
0 Kudos

Hi Friends,

I am calling a function module in my program which is available in CRM through RFC from R/3.

Is it possible to debugg that function module from my program.

But it is not going inside that function module when i debug in my program.

How can i debug this FM from my program..

Kindly clarify..

Thanks,

Abdul

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Goto transatcion SM59...click on R/3 connections...a list will be displayed...click on ur created RFC destination and click testconnection

Sreedhar...

22 REPLIES 22

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I don't think that you can do that across systems, can you try to "Test" the function module in the remote system using some supplied values?

Regards,

Rich Heilman

0 Kudos

Hi Rich.

I dont have access to our CRM system.

Is there any possibility from R/3?

Abdul

0 Kudos

I take that back, you can do it. Here is the procedure. Take the sample program here.



report zrich_0001 .

data: ytdio type s611-znetsales.

* PUT A BREAK POINT HERE
check sy-subrc  = 0.

call function 'Z_EP_GET_INCOMING_ORDERS'
  destination 'PRD'
* EXPORTING
*   DATE          = SY-DATUM
 importing
   ytdio         = ytdio
*   CPDIO         =
*   CWKIO         =
*   CDTIO         =
*   CDTIOB        =
          .

check sy-subrc  = 0.


Put a break point at the first check statement before calling the RFC. Once in debugger, click Settings, System Debugging. Now you need to step thru the programs with F5. Keep hitting F5, you will see it pass thru SAPLSUNI. If you want you can set a break point at the end of this function module(once inside it) and hit F8 to skip to the end of it. Next program will be SAPLSUSF. Do the same thing here, break point at ENDFUNCTION and hit F8, now it F5.

Next you will see the RFC function module in debug mode.

If the debugging is stopping at SAPMSYST, just keep hitting F5 untill it comes out of it.

Regards,

Rich Heilman

0 Kudos

Hi Rich.

Thanks for your wonderful program.

My program is already in production system,there is not any problem in developement and quality system.The problem is in production only.So i am unable to insert check sy-subrc in production system.

Below is my source code excerpt..

FORM f2000_main.

write:/ 'Extract Date:'(002), p_date.

  • get the order comments held against activities

CALL FUNCTION 'ZVOSC_READ_COMMENTS'

DESTINATION destin

EXPORTING

extract_date = p_date

TABLES

s_order = s_order

s_proc = s_proc

s_cat = s_cat

zvosc_comments = i_zvosc_comments.

  • delete the texts for guid we have retrieved from crm

SORT i_zvosc_comments BY guid.

LOOP AT i_zvosc_comments.

AT NEW guid.

DELETE FROM zvosc_comments

WHERE guid = i_zvosc_comments-guid.

ENDAT.

IF i_zvosc_comments-extern_act_id IS INITIAL.

DELETE i_zvosc_comments.

ENDIF.

ENDLOOP.

  • now insert the new texts from crm

SORT i_zvosc_comments.

INSERT zvosc_comments

FROM TABLE i_zvosc_comments.

  • update the last run date

zm027-zmrundt = sy-datum.

zm027-zmruntm = sy-uzeit.

MODIFY zm027.

. MESSAGE i109(zs). " program completed.

ENDFORM. " f2000_main

Any other idea..

I have set a break point at the first write statement but it is not working...

Abdul

0 Kudos

This is just for example, what I meant is that you need to put a break point in the calling program just before calling the RFC function module. That way, when you run your program, it stops before calling the RFC, this will give you the change to switch on the System Debugging, then you can step into the RFC call. Make sense?

In your case, you will want to put a break point on this WRITE statement. Or you can set it where this FORM is called, it just has to be before the RFC call.



*** PUT A BREAK POINT ON THIS WRITE STATEMENT

write:/ 'Extract Date:'(002), p_date.
* get the order comments held against activities
CALL FUNCTION 'ZVOSC_READ_COMMENTS'
DESTINATION destin
EXPORTING
extract_date = p_date
TABLES
s_order = s_order
s_proc = s_proc
s_cat = s_cat
zvosc_comments = i_zvosc_comments.

Regards,

Rich Heilman

0 Kudos

Hi Rich.

I have set the break point at the WRITE statement.

In the debugging mode i have swithed over to system debugging.I was keep hitting F5 for over 70 times.But it has not done any thing.

Kindly advice...

Abdul

0 Kudos

What does you debugger screen look like, what program is it in?

Regards,

RIch Heilman

0 Kudos

Hi Rich,

We are using 4.6C..Program is SAPMSSY3

Abdul

0 Kudos

I am using 46c as well. This is working really good for me. Sometimes it goes into SAPMSYST and I can't see the code, but if I hit F5 a couple times, it comes out of it. Can you see any code?

Regards,

Rich Heilman

0 Kudos

Hi Rich.

I am not seeing any code while i am keep pressing f5..

Abdul

0 Kudos

When pressing F5, does the source code line number change at all? This is the field next to the "Source Code of...." field on the debugger screen. If it is changing keep hitting F5. Or start all over again, and see what happens. Its been working for me, but sometimes it falls into the SAPMSYST program and sometimes it doesn't. Its not consistant everytime I do it.

Regards,

Rich Heilman

0 Kudos

Lets do this a little different. Keep your break point in the calling program, turn on system debugging before calling the RFC, step into the call of the RFC function module, now.......

Click Breakpoint->Break point at->Function Module.

A dialog will appear, enter the name of the RFC function module. Click green check and hit F8. This should take you directly to the first line of the RFC function module. I think this will work for you.

Regards,

Rich Heilman

0 Kudos

A slightly different approach:

This assumes you can get access to the CRM system.

As before, put a breakpoint prior to the RFC. When it hits the RFC, change the value of the variable 'destin' to another destination that logs on to the CRM system using a userid and password (You may have to create one before trying this).

Press F5. At the logon screen to the CRM system enter the userid and password and press enter. You should be in debug mode in a FM in the CRM system. Page to the end of the FM and put in another breakpoint. Press F8 to get to the end of the FM and press F5. You should be in debug mode in the RFC.

Rob

0 Kudos

Hi Rich.

I am getting a message FM unknown!!

Abdul

0 Kudos

Then I would say, you are either spelling it wrong, or the function module does not exists in the remote system. Check both.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

U can only test the RFC destinations...but cant the FM of the remote system...

Sreedhar...

0 Kudos

Hi Sreedhar.

How can i test my RFC Destination?

Abdul

0 Kudos

you can do that by going to transaction SM59. select your rfc destination name and press test button on application tool bar.

Former Member
0 Kudos

You can debug the RFC in the CRM system, to do this you need to put a time consuming select statement or statements which suspends the activity in the RFC program. Now call the RFC from your system and goto SM51 and debug the process which is against your user ID.

Hope this helps.

Former Member
0 Kudos

Hi ,

Please look into below link

http://www.easymarketplace.de/startrfc.php?Area=4soi&;

Regards

Amole

Former Member
0 Kudos

Hi,

Goto transatcion SM59...click on R/3 connections...a list will be displayed...click on ur created RFC destination and click testconnection

Sreedhar...

Former Member
0 Kudos

Hi Abdul,

There is no need to hard code the break-point in the code.

->Put an HTTP BREAKPOINT in the code of the RFC.

->Open an R/3 session with the same login id which you use while connecting (to SAP R/3) through CRM.

->Ensure no one else is connected to R/3 with the same ID.

It will work.

Lokesh

Pls. reward appropriate points

Message was edited by: Lokesh Aggarwal