当前位置:主页 > 物联网IoT > 正文

大带宽_网站建设销售怎么样_速度快

时间:2021-05-04 13:23 来源:埃里克云 编辑:埃里克云

核心提示

When using the ABAP Test Cockpit (ATC) for statically and dynamically checking the quality of your ABAP code and related repository objects, some of the warnings and errors identified by the ATC aren’t relevant in your specific scenario...

大带宽_网站建设销售怎么样_速度快

When using the ABAP Test Cockpit (ATC) for statically and dynamically checking the quality of your ABAP code and related repository objects, some of the warnings and errors identified by the ATC aren’t relevant in your specific scenario. Leaving errors and warnings unaddressed might cause confusion at some future point-in-time when you or another developer needs to change the code. In order to reduce the confusion, ABAP pragmas and pseudo comments can be used to blend out irrelevant warnings and errors. Let us take a detailed look at what pseudo comments and pragmas are and how to use them.

Pseudo Comments

Even though mostly obsolete, the pseudo comments are still relevant for some scenarios in the code inspector.

A pseudo comment looks like this:

The pseudo comment "#EC CI_SUBRC is used to hide a message telling us that sy-subrc should be checked after a SELECT statement. In the example above the desired behavior is that an empty table should be returned if the SELECT statement is not successful, so there is no need to check the value of sy-subrc.

Sometimes a line of code generates several warnings or errors which you may want to hide. Using pseudo comments, it is only possible to specify one pseudo comment for each program line. When multiple pseudo comments are required, the statement must be divided up to span multiple lines.

Note that the pseudo comment is placed after the ending dot of a statement.

Pragmas

Pragmas can be used to hide warnings from the ABAP compiler syntax check as well as from the extended program check.

The use of a pragma looks like this:

The pragma ##NEEDED tells the check tools that even though the variable lv_message isn’t used for further processing, the variable is still needed. In this specific scenario, it is needed since we want to be able to perform a where-used search for the message AD 001 from transaction SE91.

Not that a pragma is placed before the dot or comma ending the statement to which the pragma is applied. If multiple pragmas are needed for the same statement, they can be placed one after the other separated by space. It is also possible to place pragmas in front of a colon (:) of a chained statement. This applies the pragma to the whole chained statement:

Personally I think that this is hard to read, and I’d much rather use the following format:

Some pragmas can be used with parameters. The example mentioned in the ABAP Keyword Documentation is ##SHADOW, which can be used with an optional parameter. It looks like this: ##SHADOW[LOG]

I’ve never come across this in practice, so I don’t have much experience to share. Feel free to give some input on this by writing a comment on the blog post.

The mapping between obsolete pseudo comments and pragmas

As already mentioned, most pseudo comments are obsolete and have been replaced by pragmas. SAP provides a program which can be run to find the mapping between obsolete pseudo comments and pragmas. The name of the program is ABAP_SLIN_PRAGMAS. The main table used by the program is SLIN_DESC, if you prefer looking up the pseudo comments and programs directly in a table viewer like SE16.

As an example, the pseudo comment "#EC AUTFLD_MIS has been superseded by the pragma ##AUTH_FLD_MISSING.

The tables TRPRAGMA and TRPRAGMAT contain all pragmas.

I hope that this brief overview of pragmas and pseudo comments was useful. Please leave a comment if you think that I missed mentioning something crucial. Happy coding!

This blog post first appeared on the Developer Voyage blog at https://www.developervoyage.com/2019/09/03/what-are-pragmas-and-pseudo-comments-in-abap.html

  • 企业网站_新白娘子传奇百度云_折扣 企业网站_新白娘子传奇百度云_折扣

    你好,社区, BSI TaxFactory和TaxFactory SaaS发布版本11.0可用。 在我们的合作伙伴BSI将其产品/产品BSI TaxFactory 10.0的维护延长至2021年4月30日之后。SAP还决定在2021年4月30日之前为BSI TaxFactor...

  • 消息队列_华云服务器_限量秒杀 消息队列_华云服务器_限量秒杀

    啊。我已经很久没在这里写博客了-对不起? 但这是一个很好的机会让我重新上马,这是我与SAP TechEd Barcelona的SAP社区负责人Craig Cmehil的"无采访视图"(无采访视图就像一次真正的采访...

  • <strong>域名备案_查看数据库密码_怎么样</strong> 域名备案_查看数据库密码_怎么样

    在本文中,我们将看到如何在sapcloudfoundry环境中为Spring启动应用程序配置OAuth2授权。但是在这样做之前,让我们先熟悉一下这个实现中涉及的几个重要概念。 简介 OAuth2–是一个授权框...

  • <strong>MySQL数据库_网站cdn_多少钱</strong> MySQL数据库_网站cdn_多少钱

    您已经听说了SAP Graph在SAP TechEd Las Vegas 2019发布的消息。微软Graph也非常棒,非常相似(哲学上+技术上),它不仅非常有用,而且我会给你一个微软Graph的工作示例/教程,让你了解它,...

  • 京东云_网站建设中页面_学生机 京东云_网站建设中页面_学生机

    在可预见的未来,向S/4HANA过渡的公司特定规划已将每个SAP客户列入其议程。S/4HANA实施项目越来越近了,因此也有一个问题:在技术和开发层面必须做哪些准备?正是这个主题是"S/4H...

  • <strong>天翼云_网站服务器失去响应怎么回事_代</strong> 天翼云_网站服务器失去响应怎么回事_代

    大家好, 欢迎来到一个关于用户浏览器没有启用JavaScript的用户体验主题的简短博客。 考虑到1%的设计理念,如果我们考虑那些禁用或不可用JavaScript的浏览器的用户(出于"天知道为什...

  • <strong>对象存储_网站建设外贸_速度快</strong> 对象存储_网站建设外贸_速度快

    在本文中,我将展示如何通过负载平衡器为我们的生产数据库构建一个具有高可用性的HANA驾驶舱。我建议您开始阅读SAP指南HowTo:High Availability for SAP HANA cockpit using SAP HANA system replicat...

  • <strong>中间件_重庆网站建设策划_促销</strong> 中间件_重庆网站建设策划_促销

    SAP Customer Data Cloud在9月份推出了许多功能。如果你错过了这些,下面是我们9月份发布的几个亮点。 与苹果公司登录:苹果公司已经发布了使用苹果ID登录应用程序的选项。他们甚至规...

  • 消息队列_马云御任阿里巴巴_年度促销 消息队列_马云御任阿里巴巴_年度促销

    本周在拉斯维加斯TechEd看到的创新给我留下了非常深刻的印象。今年似乎出现了比过去更多的业务倾斜。主要的宣布是我们可以通过业务技术平台扩展SAP应用程序 HANA云服务(HCS)是业...