问题描述
我需要追踪在大量自定义 sapscripts 和 smartforms 中使用特定标准文本 (SO10) 的位置.
I need to track down where within a large number of custom sapscripts and smartforms a specific standard text (SO10) is being used.
除了相当于检查每个打印脚本的代码"之外,我还没有在网上找到可行的解决方案.有什么建议吗?
Apart from the equivalent of "check the code for each print script", I've not found a workable solution online. Any suggestions?
推荐答案
发帖后,我找到了部分解决方案.下面的代码将在 sapscripts 中搜索标准文本,但不会在 smartforms 中搜索.
After posting, I found a partial solution. The code below will search for a standard text within sapscripts, but not smartforms.
PARAMETERS: p_sttxt LIKE stxh-tdname.
DATA: BEGIN OF t_stxh OCCURS 0,
tdname LIKE stxh-tdname,
tdspras LIKE stxh-tdspras,
END OF t_stxh.
DATA t_lines LIKE tline OCCURS 0 WITH HEADER LINE.
SELECT tdname tdspras FROM stxh INTO TABLE t_stxh
WHERE tdobject = 'FORM'
AND tdid = 'TXT'
AND tdspras = 'E'.
LOOP AT t_stxh.
REFRESH t_lines.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = 'TXT'
language = t_stxh-tdspras
name = t_stxh-tdname
object = 'FORM'
TABLES
lines = t_lines
EXCEPTIONS
id = 0
language = 0
name = 0
not_found = 0
object = 0
reference_check = 0
wrong_access_to_archive = 0
OTHERS = 0 .
SEARCH t_lines FOR p_sttxt.
IF sy-subrc EQ 0.
WRITE:/ t_stxh-tdname, t_stxh-tdspras.
ENDIF.
ENDLOOP.
这是在此处找到的代码的(固定)版本:http://scn.sap.com/thread/179142
This is a (fixed) version of the code found here: http://scn.sap.com/thread/179142
这篇关于如何在 SapScript 或 SmartForm 中查找标准文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!