‎2006 Jan 06 2:44 PM
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
‎2006 Jan 06 2:55 PM
Hi,
Goto transatcion SM59...click on R/3 connections...a list will be displayed...click on ur created RFC destination and click testconnection
Sreedhar...
‎2006 Jan 06 2:46 PM
‎2006 Jan 06 2:47 PM
Hi Rich.
I dont have access to our CRM system.
Is there any possibility from R/3?
Abdul
‎2006 Jan 06 2:57 PM
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
‎2006 Jan 06 3:14 PM
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
‎2006 Jan 06 3:16 PM
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
‎2006 Jan 06 3:25 PM
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
‎2006 Jan 06 3:26 PM
‎2006 Jan 06 3:41 PM
‎2006 Jan 06 3:50 PM
‎2006 Jan 06 3:56 PM
Hi Rich.
I am not seeing any code while i am keep pressing f5..
Abdul
‎2006 Jan 06 4:00 PM
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
‎2006 Jan 06 4:03 PM
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
‎2006 Jan 06 4:07 PM
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
‎2006 Jan 06 4:17 PM
‎2006 Jan 06 4:25 PM
‎2006 Jan 06 2:47 PM
Hi,
U can only test the RFC destinations...but cant the FM of the remote system...
Sreedhar...
‎2006 Jan 06 2:52 PM
‎2006 Jan 06 2:54 PM
you can do that by going to transaction SM59. select your rfc destination name and press test button on application tool bar.
‎2006 Jan 06 2:50 PM
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.
‎2006 Jan 06 2:54 PM
‎2006 Jan 06 2:55 PM
Hi,
Goto transatcion SM59...click on R/3 connections...a list will be displayed...click on ur created RFC destination and click testconnection
Sreedhar...
‎2006 Jan 06 3:31 PM
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