You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何查看ABAP类自定义方法的全部调用方?

获取ABAP类方法完整调用列表的最佳实践

Got it, let's tackle this problem—when the standard "Where Used" tool misses unexpected or hidden calls to your ABAP class method, here are the most reliable ways to get the full picture:

1. 用好增强版的Where Used工具(SE24/SE80)

Don't stop at the basic right-click "Where Used"! When the dialog pops up, click the "More options" button (the little gear icon) and make sure you enable these critical settings:

  • Include indirect calls: Catches calls that go through parent classes, interfaces, or other intermediate methods
  • Include dynamic calls: Picks up calls made via CALL METHOD (<variable>) or other dynamic invocation patterns
  • Include customer objects: If you're working in a system with custom developments, this ensures you don't miss Z/Y objects
  • Include inactive objects: Useful if there's unactivated code that references your method

This expands the search far beyond the default static direct calls, which is why you were seeing unexpected calls before—they were likely indirect or dynamic.

2. 用SAT(System Trace)捕捉运行时调用

If you need to see exactly where the method is called during actual execution, the System Trace is your go-to:

  1. Start transaction SAT
  2. Enter the user ID that will trigger the process, and set the trace mode to "Performance Trace" (or "Single Transaction Trace" for focused scenarios)
  3. Click "Start Trace", then perform the business action that should trigger the method call
  4. Stop the trace, then in the results, use the "Filter" function to search for your class/method name

SAT will capture every single invocation, including dynamic calls, calls from background jobs, and even calls from SAP standard code that the static Where Used might miss.

3. 用Code Inspector/SCI做批量代码扫描

For a system-wide or package-wide scan, use the Code Inspector (transaction SCI) or ABAP Test Cockpit (ATC):

  1. Create a new inspection variant, and add the check "Usage of Object Types" (under "Object Checks")
  2. Configure the check to target your specific class and method
  3. Run the inspection against your target package(s) or the entire system

This tool not only finds static calls but can also flag potential dynamic calls by scanning for patterns like CALL METHOD with references to your class. It's great for auditing all references across your codebase.

4. 直接数据库查询(进阶用法)

If you need to dig deeper (and you're comfortable with ABAP database tables), you can query the repository tables directly:

  • Use PROGDIR to search for programs containing your method's signature (e.g., CALL METHOD ZCL_MY_CLASS=>MY_METHOD)
  • For dynamic calls, search for patterns like CALL METHOD (<lv_method>) where the variable might reference your method (note: this can have false positives, so validate results)
  • Join with TADIR to filter by object type (e.g., PROG for programs, CLAS for classes)

This is a last-resort option, but useful when other tools miss edge cases.

为什么默认Where Used会漏调用?

The standard tool defaults to only searching for static, direct, activated SAP objects. It won't pick up dynamic calls, indirect calls through inheritance/interfaces, unactivated code, or custom customer objects unless you explicitly enable those options.

内容的提问来源于stack exchange,提问作者Adam Harkus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 06:42:28