2024年6月11日发(作者:)

18 Techniques for

Locating the Underlying

Data of a Screen Field

18种根据屏幕字段

查找潜在数据的技巧

(rev 1.1)

Dennis Barrett / 翻译:强晟

qiangsheng@

Dennis Barrett is an applications consultant with SAP America who

focuses on Service Management/ Customer Service and the Service

Provider solution.

想象一下这样的情景。一

He has been consulting in computers for over 15 years, always

位业务经理希望得到一个

blending applications and programming. He is a certified ABAP

关于她的服务订单的专用

programmer, and is also the author of “SAP R/3 ABAP/4 Command

报表,她给了你一个报表

Reference.”

的草图(包括列、行、标

题、分组、小计、合计等

丹尼斯·巴雷特是SAP美国的应用顾问,致力于服务管理/客户服务和服

务提供解决方案。

等),而“服务管理”事

他已经在计算机行业从事顾问工作15年,是认证ABAP程序员,也是《SAP

务屏幕中的字段就包含了

R/3 APAP/4 命令参考》一书的作者。

她希望你在报表中显示的

数据。

(complete bio appears on page 18)

(关于他的完整简历请见

27

页)

Picture this. An Operations

Manager wants a special

report of her service orders.

She gives you a sketch of

what she wants it to look

like (columns, rows,

headings, grouping,

subtotals, totals, and the

like), and points to fields

on the Service

Management transaction

screens that have the data

she wants you to show in

the report.

第 1 页 共 27 页

What do you do? Most likely, you would check to find any existing reports delivered with the system (or

already written for this client) that provide the information the Operations Manager wants, or that can be

copied and revised to fit her needs. If you don’t find any, you might then look into the appropriate

reporting system — in this case, the Plant Maintenance Information System (PMIS) — to see if you can

adapt it. In this case, however, you can’t find the report, and you can’t cobble one together from existing

ones. You must write a report or an ABAP Query to fulfill the requirements.

你该怎么做?通常的,你会检查系统中运行的,能够提供这个业务经理所需信息的现存报表(或者

是已经为这个client写过的),或者可以在复制和修改后能符合需要的报表。如果没有找到,你也许

会在适当的报表系统——例如,工厂维护信息系统(PMIS)——中看看是否能找到合适的。即使

这样,你仍然无法找到报表,或者无法从现存报表中找到可修改的,那只能写一个报表或者一个

ABAP查询来实现这个需求。

Now, suppose the Operations Manager asks if you can somehow add just one more little function to her

Create Measurement Documents transaction: paste the associated sales order number into the MDoc text

field. This scenario requires you to create an enhancement. In both the first and second scenario, you’ll

need access to specific data from the database tables. How do you find that data with just the screen fields

as your guide? We all know the information associated with a transaction is stored in several (sometimes

many) related tables. So, when you need several fields from a transaction for a report or an enhancement,

you may need to find many of the transaction’s tables and establish the links among them. Those links are

often not obvious.

现在,设想一下业务经理问你是否以某种方式在《创建计量单位文档事务》中增加一个小小的功能:

向MDoc文本字段中粘贴相关销售订单号。这个要求需要你创建一个增强功能。在前面两个情形中,

你都需要访问数据库表中的特定数据。你怎么以屏幕字段做指导来找到这些数据?我们都知道与一

个事务关联的信息都存储在几个(偶尔还会是很多个)相关的表里。这样,当你需要在报表或增强

功能中使用一个事务中的几个字段时,你需要找出许多事务的表并在它们之间建立关联。这些关联

通常都不会很明显。

I’ve come across these very situations on numerous occasions while working for several clients with the

SD, MM, IM, WM, and Service Management (now called Customer Service) modules. Over time I have

gathered suggestions from colleagues and developed some techniques myself to find the data I needed. I

will share these techniques — 18 of them in all — with you now.

我曾经在众多场合遇到这些情况,有时需要同时在SD、MM、IM、WM和服务管理(现在叫客户服

务)等模块对多个client进行工作。随着时间推移,我收集了同事和自己在开发中寻找需要数据的建

议。我现在来跟你分享这些技巧——共18种。

(再注:在 rev1.1 里,加入了我自己收集到的另一种方法,第19种。相信做为读者的你,在以后

的工作中也会不断发现更多更好的方法,不妨也发表出来,让更多的人学习。)

第 2 页 共 27 页