SAP S4后的一些注意点(一)(更新中)

本文介绍了如何在SAP开发中使用ABAPCleaner插件确保代码云就绪,包括自动、交互式和只读预览模式。同时提倡使用CDS视图替代底层透明表,以及新关键字WITHPRIVILEGEDACCESS的应用。
摘要由CSDN通过智能技术生成
  1. SAP
    此外,我们必须确保 P10 中所有新的 Unicore 代码都是云就绪的。因此,在 ATC 中增加了一项新的检查(自定义),以证明代码的云就绪性。此外,我们还在 ADT 中安装了一个名为 ABAP Cleaner 的新插件,它也可以帮助您转换和检查代码的云就绪性(但仅限于语法检查)。可以在ECLIPSE下载这样的工具。
    地址:
    直接在eclipse输入“ https://sap.github.io/abap-cleaner/updatesite”安装新的ABAP cleaner软件.

怎么使用ABAP cleaner插件?

Select any amount of ABAP code in the current code editor in ADT - or alternatively, do NOT select any code to apply cleanup to the current method or declaration section.

(1)Automatic:Press Ctrl + 4 or select menu ‘Source Code / Clean Up With Automated ABAP Cleaner’. The cleanup will be done automatically, using the profile and cleanup range that was last selected when you used the interactive ABAP cleaner UI (see below).

(2)Inactive:Press Ctrl + Shift + 4 or select menu ‘Source Code / Clean Up With Interactive ABAP Cleaner…’. This will open the ABAP cleaner UI to compare the original and the cleaned code.

在这里插入图片描述

(Un)check the ‘Highlight …’ options to focus on certain types of changes. If you come across a changed statement which you prefer to keep in its original state, simply deactivate the applied rule(s) in the ‘Rules Used in Current Selection’ list for this statement. You may also configure or select a different profile for the cleanup.

Press Ctrl + Enter or click ‘Apply and Close’ to apply the result and return to the ADT editor; to discard the changes, press Esc or click ‘Cancel’.

(3)Read-only:
Press Ctrl + Shift + 5 or select menu ‘Source Code / Show Read-Only Preview With ABAP Cleaner…’:

This opens the interactive ABAP cleaner UI as described above, but the code will not be locked or changed. Nevertheless, changes to ABAP cleaner settings (selected profile, activated rules and options etc.) will be kept.

The read-only preview also allows you to paste other ABAP code (e.g. from SAP GUI) into the ABAP cleaner UI by pressing Ctrl + V or selecting menu ‘Code / From Clipboard’, or to read code from a file with ‘Code / From File…’.

2.尽量不直接从底层透明表拉数据

.尽量不直接从底层透明表拉数据 ,尽量用CDS视图代替底层数据表,根据业务需求选择适合的CDS view。
还有要注意的是,新的关键字WITH PRIVILEGED ACCESS可以关闭CDS的访问控制。
eg:

SELECT SalesOrganization AS ckorg,
           CompanyCode AS bukrs
         FROM i_salesorganization WITH PRIVILEGED ACCESS
         WHERE SalesOrganization IN @mt_r_vkorg
         INTO TABLE  @mt_vkorg.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值