`
Jack Wu
  • 浏览: 866487 次
  • 来自: ...
社区版块
存档分类
最新评论

如何调整ABAP程序的性能

阅读更多

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 statements
Select 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 join
 
Let 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

    SAP ABAP程序性能调优介绍.pptx

    ABAP程序性能优化

    一个功能可以有多种写法,但是最优的只有一个。包括运行时间,资源负载。

    SAP ABAP程序性能调优介绍.pdf

    SAP ABAP程序性能调优介绍.pdf

    深入ABAP程序设计

    深入ABAP程序设计,语法,结构,性能优化,案例。

    详解使用SAT对ABAP程序进行性能分析视频教程

    详解使用SAT对ABAP程序进行性能分析视频教程

    提高ABAP 性能注意事项

    ABAP 程序开发中提高程序性能需要注意的几个问题

    ABAP程序运行效率改进建议26条

    性能是一把双刃剑, 获得时间效率的同时, 牺牲的是空间的开销. 这里提供一些建议以提高你的程序运行速度和减低系统荷载。 1, 减少数据库DB的读写操作, 当使用VIEW视图的时候... 2, 避免使用SELECT *, 尽量使用...

    ABAP/4开发宝典中文版

    ABAP/4开发宝典中文版是关于ABAP/4编程语言的手册。其目的在于: ...· 关于如何提高ABAP/4任务性能的技巧,请从“ABAP/4开发工作台”上选择事务SE30或“测试->运行时间分析”,然后单击“提示和技巧”。

    ABAP∕4 用户中文指南

    ABAP/4用户指南是关于ABAP/4编程语言的手册。其目的在于: ...· 关于如何提高ABAP/4任务性能的技巧,请从“ABAP/4开发工作台”上选择事务SE30或“测试->运行时间分析”,然后单击“提示和技巧”。

    ABAP用户指南

    SAP ABAP用户指南。 ABAP/4 用户指南是 关于 ABAP/4 编程语言的 ... 关于如何 提高 ABAP/4 任务性能的 技巧,请从 “ABAP/4 开发工作台 ”上选择事 务 SE30 或“测试 -> 运行时间分 析”,然后 单击“提示 和技巧”。

    abap4开发宝典中文版

    ABAP/4开发宝典中文版是关于ABAP/4编程语言的手册。其目的在于: ...· 关于如何提高ABAP/4任务性能的技巧,请从“ABAP/4开发工作台”上选择事务SE30或“测试->运行时间分析”,然后单击“提示和技巧”。

    ABAP∕4 开发宝典中文版

    ABAP/4开发宝典中文版是关于ABAP/4编程语言的手册。其目的在于: ...· 关于如何提高ABAP/4任务性能的技巧,请从“ABAP/4开发工作台”上选择事务SE30或“测试->运行时间分析”,然后单击“提示和技巧”。

    abap SQL优化

    abap SQL优化 abap编程的SQL的性能优化,在编程时注意的地方,可以是程序性能更好!

    BC ABAP/4 用户指南

    关于如何 提高 ABAP/4 任务性能的 技巧,请从 “ABAP/4 开发工作台 ”上选择事 务 SE30 或“测试 -> 运行时间分 析”,然后 单击“提示 和技巧”。 <br>Neither this documentation nor any part of it may be ...

    ABAP中文帮助 用户指南 PDF

    ABAP/4用户指南是关于ABAP/4编程语言的手册。其目的在于: 向新的ABAP/4程序员... 关于如何提高ABAP/4任务性能的技巧,请从“ABAP/4开发工作台”上选择事务SE30或“测试->运行时间分析”,然后 单击“提示和技巧”。

    基于Web Dynpro for Abap 的自助系统设计与实现.pdf

    Abap 技术开发,程序界面的易操作性接近Windows 程序,交互性能在Web 程序中具有绝对的优势。 此外,系统在确保安全可靠、权限控制到位的前提下,实现了不具备ERP 账号的员工对自己在ERP 系 ...

    SAP BC490 课程中文自学笔记

    BC490: ABAP Performance Tuning ABAP 程序的性能调整, 从 ABAP 程序的角度介绍如何提高应用程序的执行效率。

    基于Web Dynpro for Abap的自助系统设计与实现 (2015年)

    所设计的员工自助服务系统基于B/S运行模式,采用Web Dynpro for Abap技术开发,程序界面的易操作性接近Windows程序,交互性能在Web程序中具有绝对的优势。此外,系统在确保安全可靠、权限控制到位的前提

    SAP-PP模块CO02生产订单修改日志增强开发明细(包含操作步骤和ABAP代码)

    为了提高性能,SAP默认不开启修改日志功能,但是在日常操作中,经常会发现有人修改了生产订单的信息又不好查找当事人。 为了追溯工单的修改历史,找到责任人,那么就需要在工单修改后记录日志,便于查找。 SAP标准...

    Web_Dynpro_For_Abap之_入门篇

    Web Dynpro 采用了一种高级的 MVC / Data Binding ...使用 Web Dynpro 可以非常迅速的开发出企业级的应用程序,开发者只需要关注其业务流程,关于版本管理、质量控制、发布、性能等内容仍然由 NetWeaver 平台帮助完成。

Global site tag (gtag.js) - Google Analytics