如何从扩展语法检查中获取结果
Posted
技术标签:
【中文标题】如何从扩展语法检查中获取结果【英文标题】:How to get the Results from the Extended Syntax Check 【发布时间】:2013-06-20 22:16:52 【问题描述】:我想从 SAP 中的扩展检查器中获取结果。我想我找到了存储结果的表(我认为它是 slin_cache_res)。但是该值以原始字符串格式存储。如何以可读格式获得最后一次扩展检查的结果?我需要它们来完成进一步的处理任务。
【问题讨论】:
是否可以选择使用仅包含扩展检查的变体运行代码检查器,然后提取代码检查器结果? 非常感谢。这是一个好主意。现在我在代码检查器上运行扩展检查器后从 SCIREST_PS 表中获取结果。 【参考方案1】:如果可能,我会尝试为此使用代码检查器,因为它更灵活,提供更多检查,并且有类似 API 的东西可用于运行检查并获得结果:
DATA: lr_inspection TYPE REF TO cl_ci_inspection,
lr_object_set TYPE REF TO cl_ci_objectset,
lr_check_variant TYPE REF TO cl_ci_checkvariant,
lt_result TYPE scit_alvlist.
FIELD-SYMBOLS: <ls_result> TYPE scir_alvlist.
* create an inspection
CALL METHOD cl_ci_inspection=>create
EXPORTING
p_user = ''
p_name = 'MY_INSPECTION_NAME'
RECEIVING
p_ref = lr_inspection
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
* ... error handling ...
ELSE.
* load object set
CALL METHOD cl_ci_objectset=>get_ref
EXPORTING
p_objsnam = 'MY_OBJECT_SET_NAME'
RECEIVING
p_ref = lr_object_set
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
* ... error handling ...
ELSE.
* load check variant
CALL METHOD cl_ci_checkvariant=>get_ref
EXPORTING
p_user = ''
p_name = 'MY_VARIANT_NAME'
RECEIVING
p_ref = lr_check_variant
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
* ... error handling ...
ELSE.
* assemble inspection
CALL METHOD lr_inspection->set
EXPORTING
p_chkv = lr_check_variant
p_objs = lr_object_set.
CALL METHOD lr_inspection->save.
* run inspection
CALL METHOD lr_inspection->run
EXPORTING
p_howtorun = 'D' " cl_ci_inspection=>c_run_direct
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
* ... error handling ...
ELSE.
* get the result list
CALL METHOD lr_inspection->plain_list
IMPORTING
p_list = lt_result.
* ... do something with the results ...
ENDIF. " sy-subrc after lr_inspection->run
ENDIF. " sy-subrc after cl_ci_checkvariant=>get_ref
ENDIF. " sy-subrc after cl_ci_objectset=>get_ref
ENDIF. " sy-subrc after cl_ci_inspection=>create
【讨论】:
以上是关于如何从扩展语法检查中获取结果的主要内容,如果未能解决你的问题,请参考以下文章
使用 MVC Razor 语法检查视图模型属性在 Javascript 中是不是具有值