18 Techniques for Locating the Underlying Data of a Screen Field 18种根据屏幕字段
查潜在数据的技巧 Dennis Barrett / 翻译:强晟 qiangsheng@gmail
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
abap开发顾问是程序员吗the report.
想象一下这样的情景。一
个业务经理希望得到一个
关于她的服务订单的专用
报表,她给了你一个报表
的草图(包括列、行、标
题、分组、小计、合计等
等),而“服务管理”事
务屏幕中的字段就包含了
她希望你在报表中显示的
数据。
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)
(关于他的完整简历请见25页)
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 transacti
on 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种。
The Starting Gate and Finish Line
起跑线和终点线
I will be presenting a wide variety of techniques for reaching the “finish line” of this exercise — namely, locating the table and field that stores the underlying data of a screen field. You’re unlikely to need all of them; you’ll probably be successful within the first four techniques. I include the remaining techniques because some fields can be very hard to chase down, and any one of these other tools just might do the trick.
我将会介绍达成本练习“终点线”的各种各样的技巧——也就是说,定位那些在屏幕字段中存储潜在数据的表和字段。你未必需要所有这些方法,一般来说,前四种技巧已经足够了。我之所以写其他的技巧是因为有些字段非常难以追踪,而这些工具或许可以解决问题。
The Starting Point
起点
The starting point for this set of techniques is always the Technical Information screen, because it is here that you learn the screen field’s name, and can discern whether or not the underlying data objec
t is a structure, view, or table.
这套技巧的起点通常是技术信息屏幕,因为你可以从这里知道屏幕字段的名字,并且辨别出这个潜在数据对象是不是一个结构、视图或者表。
If the underlying data object is a table, your search is over. The field name shown on the Technical Information screen, plus this table name, arms you with the details you need. If the data object is a view, just one more click and you’ve got that table name. If the data object is a structure, you still have to unearth the name of the table.
如果潜在数据对象是一个表,你的查就结束了。字段名称显示在技术信息屏幕中,还包括了表名称,都是你需要的细节。如果数据对象是一个视图,只需要再点击一下就能得到表名称。如果数据对象是个结构,你还不得不需要继续发掘表的名称。
Technique #1: Check the Technical Information Screen
技巧一:检查技术信息屏幕
I always start my search for the underlying data object by getting the names of the field and Data Dictionary object from the transaction screen. Call up the Technical Information screen by positioning
your cursor in the target screen field and then pressing F1 or clicking on the ? button. This will bring up the initial Help screen. From within the Help screen, press F9 or click on the Technical info button.
我通常从事务屏幕中开始搜寻潜在数据对象——如字段和数据字典对象的名字。如果想调出技术信
息屏幕,首先将光标定位在目标屏幕字段上,然后按F1或者点击按钮图标,这将打开初始帮助屏幕,在这个帮助屏幕中,按F9或者点击技术信息按钮。
Figure 1 The Release 4.0B Technical Information Screen for the “Sold-to party” Field
图1 在发行版4.0B中关于“售达方”字段的技术信息屏幕
Take a look now at Figure 1. It shows the Technical Information screen for the Sold-to party field in the Create Standard (Sales) Order screen for Release 4.0B. You see in the “Field data” block that the Table name is KUAGV and the Field name is KUNNR1. In Releases 4.0B and below, this screen calls the associated object a “table”, whether it’s a table, view, or structure. Notice in Figure 2 that the 4.5B release (and above) informs you that KUAGV is actually a structure.
现在看一下图一,它显示了在发行版4.0B中,创建标准(销售)订单屏幕的售达方字段的技术信息
屏幕。你可以看到,在“字段数据”块中,表名称是KUAGV、字段名称是KUNNR注1。在发行版4.0B 和以前的版本中,这个屏幕把相关对象都称为“表”,而不管它是个表、视图还是结构。注意图二中,在4.5B(及以后版本)中,提示你KUAGV实际上是个结构(译注:在我们用的ECC5版中没有区分,SAP又退化了,直到双击查看对象时才显示出来它是表、结构还是视图)。
Figure 2 The Release 4.5B Technical Information Screen for the “Sold-to party” Field
图二在发行版4.5B中关于“售达方”字段的技术信息屏幕
1 The examples herein mention names of tables, structures, and fields that I found in my searches. You may find a different name in the same search — particularly a different structure’s name. For example, the Sold-to party field in the Sales Order initial screen may be KUAGV-KUNNR or RV45S-KUNNR (or maybe something else). I’ll show one name in this article; don’t worry if you find another. It’s a reflection of the continual enhancement of R/3, not (I hope) an error in the article.
注1 这里的例子提及了在我的研究中到的表、结构和字段的名字。你可能在相同的研究中发现一个不同的名字——尤其是不同的结构名称。例如,在销售订单初始屏幕中售达方字段可能是KUAGV-KUNNR或者RV45S-KUNNR(还可能是其他名字)。我在文章中只写其中一个,但是如果你发现了另外的名字也不必担心。它是R/3系统持续改进的一个反映,并不是(至少我希望不是)文档中的错误。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论