1、使用where语句 不推荐 Select * from zflight. Check : zflight-airln = ‘LF’ and zflight-fligh = ‘BW222’. Endselect. 推荐 Select * from zflight where airln = ‘LF’ and fligh = ‘222’. Endselect.
2、使用聚合函数 不推荐 Maxnu = 0. Select * from zflight where airln = ‘LF’ and cntry = ‘IN’. Check zflight-fligh > maxnu. Maxnu = zflight-fligh. Endselect. 推荐 Select max( fligh ) from zflight into maxnu where airln = ‘LF’ and cntry = ‘IN’.
3、使用视图代替基本表查询 不推荐 Select * from zcntry where cntry like ‘IN%’. Select single * from zflight where cntry = zcntry-cntry and airln = ‘LF’. Endselect. 推荐 Select * from zcnfl where cntry like ‘IN%’ and airln = ‘LF’. Endselect.
4、使用INTO table 代替select endselect 不推荐 Refresh: int_fligh. Select * from zflight into int_fligh. Append int_fligh. Clear int_fligh. Endselect. 推荐 Refresh: int_fligh. Select * from zflight into table int_fligh.
5、使用批量修改内表代替逐行修改 不推荐 Loop at int_fligh. If int_fligh-flag is initial. Int_fligh-flag = ‘X’. Endif. Modify int_fligh. Endloop. 推荐 Int_fligh-flag = ‘X’. Modify int_fligh transporting flag where flag is initial.
6、使用二分法查询,提高查询内表数据速度 不推荐 Read table int_fligh with key airln = ‘LF’. 推荐 Read table int_fligh with key airln = ‘LF’ binary search.
7、两个内表添加使用批量增加代替逐行 不推荐 Loop at int_fligh1. Append int_fligh1 to int_fligh2. Endloop. 推荐 Append lines of int_fligh1 to int_fligh2.
8、使用table buffering Use of buffered tables is recommended to improve the performance considerably. The buffer is bypassed while using the following statementsSelect distinct Select … for update Order by, group by, having clause Joins Use the Bypass buffer addition to the select clause in order to explicitly bypass the buffer while selecting the data.
9、 使用FOR ALL Entries 不推荐 Loop at int_cntry. Select single * from zfligh into int_fligh where cntry = int_cntry-cntry. Append int_fligh. Endloop. 推荐 Select * from zfligh appending table int_fligh For all entries in int_cntry Where cntry = int_cntry-cntry.
10、正确地使用where语句,使查询能使用索引When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields. One more tip is that if a table begins with MANDT, while an index does not, there is a high possibility that the optimizer might not use that index.
11、正确地使用MOVE语句 Instead of using the move-corresponding clause it is advisable to use the move statement instead. Attempt should be made to move entire internal table headers in a single shot, rather than moving the fields one by one.
12、正确地使用inner joinLet us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates. Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join. Select a~airln a~lnnam b~fligh b~cntry into table int_airdet From zairln as a inner join zflight as b on a~airln = b~airln. In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.
13、使用sort by 代替order by
14、避免使用SELECT DISTINCT语句 使用的 ABAP SORT + DELETE ADJACENT DUPLICATES 代替.
|
相关推荐
SAP ABAP程序性能调优介绍.pptx
一个功能可以有多种写法,但是最优的只有一个。包括运行时间,资源负载。
ABAP程序下载工具 1.4.4 PROGRAM zdtp_massdownload.
SAP ABAP程序性能调优介绍.pdf
ABAP代码性能指导 ABAP代码性能指导 ABAP代码性能指导
批量下载abap程序-改造版
ABAP程序 通过程序中的关键字查找程序名和首次出现的行数,双击程序名进入程序
下载ABAP程序源代码的程序.pdf
我们在用事务码 SE38 创建新程序时,总是被要求指定一个程序类型,这些程序类型分别完成不同的功能,如果选择错误,程序就可能无法运行。下面一一介绍这些程序类型:
这个程序的原名是Mass download version 1.5.0. 但是如果直接运行的话可能中文乱码。所以我做了一些调整,加了一个字符编码选项。如果是中文,就采用编码4310就行了。当然中文其实也有很多编码的,如gbk等。所以在跑...
从零开始,教授如何配置 Eclipse 开发 SAP ABAP 程序环境。2020 年最新版本操作笔记。对于初学者十分友好。 ABAP Development Tool的Java端实现就是Eclipse的一个扩展,使用JCO(Java Connector)连接ABAP后台的adt...
深入ABAP程序设计,语法,结构,性能优化,案例。
ABAP程序介绍
ABAP 学习资料 ABAP性能提高解决办法 ABAP性能提高解决办法
区别CALL SCREEN/SET SCREEN/LEAVE TO SCREEN ABAP-SAP的几种(代)出口类型 Web_dynpro-关于WEB...开发注意小技巧 UP TO X ROWS 用法 ABAP的基本的知识 如何使用SMOD和CMOD进行SD的用户增强 ABAP面试题及其解答
生成XML文件ABAP程序 REPORT zams_xml_dom_create . TYPE-POOLS: ixml. CLASS cl_ixml DEFINITION LOAD. TYPES: BEGIN OF xml_line, data(256) TYPE x, END OF xml_line. DATA: l_ixml TYPE REF TO if_ixml, ...
ABAP程序相互调用例子及说明!如带select-options程序的Submit的用法和带parameters程序的Submit的用法等!
abap 练习程序abap 练习程序 abap 练习程序abap 练习程序abap 练习程序abap 练习程序
ABAP 4程序开发ABAP 4程序开ABAP 4程序开发发
ABAP 子程序定义 参数传递 调用