Additional Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member218277
Active Participant
10,234

很多ABAP的初学者在debug程序的时候经常会遇到一个问题,那就是RFC的function module的debug问题,例如,A系统的程序中通过RFC调用了B系统中的一个function module, 在B系统中设置断点后,如何才能让程序执行到该断点是停下来呢?下面我将通过一个例子来说明. 

准备工作:

1. 准备两个系统:
Y58, 主程序会在该系统运行; Y57, 被调用系统, 主程序中会调用本系统的FM

2. 在系统Y58中创建一个RFC destination 'testrfc', 将connection type 设置为'3', 并指定登录语言, 客户端, 用户名(本例中的用户名是'TESTRFC'),登录密码等信息. 此处需要特别注意的是, 此处指定的用户'TESTRFC'必须在系统Y57中存在,并且必须是具有debug权限的dialog用户. 参照下图:


 
3. 在系统Y57中创建一个FM,将'processing type' 选为'Remote-Enabled Module'

4. 在系统Y58创建主程序'ZTEST_RFC_DEBUG_MAIN', 在该程序中调用系统Y57中的FM 'ZRFC_DEBUG_1 '并指定destination为 Y58中创建的'testrfc ', 如下图:


至此,准备工作完毕.

下面我们来看如何debug.

1. 登录系统Y57(此处需要注意,整个测试过程中要保持Y57的登录状态), 并设置被调用系统Y57的debug用户(即Y58中创建destination时指定的user ID). 设置路径:T-CD:SE38->Utilities->settings, 如下图:


2. 在将要测试的FM中设置外部断点,

3. 系统Y58中运行主程序,


结果: 程序停在所设断点处

关键点总结:

1. RFC destination中指定的User ID必须是具有debug权限的dialog帐号

2. 被调用系统中必须设定debug user ID 为RFC destination中指定的user ID, 且该User ID必须是具有debug权限的dialog用户

3. 断点类型必须为外部断点

35 Comments
cy_guo1
Associate
Associate
0 Kudos

不错!很好! 解了我多年的困惑啊...

Former Member
0 Kudos

多谢分享

Former Member
0 Kudos

great help! up!!

0 Kudos

很实用,步骤详细到让小伙伴们都惊呆了

Former Member
0 Kudos

不错, 很实用。。

tony_fan2
Discoverer
0 Kudos

很好,很实用。

Former Member
0 Kudos

很好很详细,收藏了!!!

Former Member
0 Kudos

好用、收了

Former Member
0 Kudos

good

0 Kudos

Thanks!

Former Member
0 Kudos

不错,才貌双全。

0 Kudos

good, 收藏了

jimguo
Product and Topic Expert
Product and Topic Expert
0 Kudos

很好很强大 :smile:

Former Member
0 Kudos

学习了

Former Member
0 Kudos

多谢分享。

yang_aiolos
Active Participant
0 Kudos

写得不错,简单易懂

Former Member
0 Kudos

hao

Former Member
0 Kudos

5星级的

jie
Product and Topic Expert
Product and Topic Expert
0 Kudos

非常详细,谢谢分享!

bonnie_mu
Product and Topic Expert
Product and Topic Expert
0 Kudos

多谢分享,简单易懂.

0 Kudos

非常详细啊,真是学习了!感谢!

0 Kudos

写的很详细,按照这个来绝对能解决问题了

0 Kudos

赞!

0 Kudos

赞!

0 Kudos

赞!

Former Member
0 Kudos

我项目上正在纠结怎么搞,真是雪中送炭啊!!!

Former Member
0 Kudos

很不错

Former Member
0 Kudos

very detail explanation, very useful

0 Kudos

一直没发现可以设置debug 用户,nice!

Former Member
0 Kudos

不错!很好! 解了我多年的困惑啊...

EasonLing
Product and Topic Expert
Product and Topic Expert
0 Kudos

赞!

Former Member
0 Kudos

good

Andy1
Product and Topic Expert
Product and Topic Expert
0 Kudos

很好。

Former Member
0 Kudos

不错

Former Member
0 Kudos

很有用,多谢