如何调整ABAP程序的性能.docx_第1页
如何调整ABAP程序的性能.docx_第2页
如何调整ABAP程序的性能.docx_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

如何调整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 bufferingUse 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_flighFor 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 indexTo 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 aairln alnnam bfligh bcntry into table int_airdetFrom zairln as a inner join zflight as b on aairln = bairln.In order to restrict the data as per the s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论