ABAP 性能优化001
红方框里那一步之行很慢,lt_iflos这个内表才200多条数据
1.关键是你from那个表有多少数据....
注意点:
1.不要用 CORRESPONDING FIELDS OF
2.LT_IFLOS针对TPLNR做个排序
3.WHERE条件中的 TPLNR 是不是表IFLOT的KEY字段。
4.出了这个条件关联外,2张表中是否还能增加其他字段的关联。
解决方案:
IFLOT
功能位置(表)---找上级KKS用
into corresponding fields of table lt_iflos
from IFLOS
for all entries in lt_hier
where strno = lt_hier-strno.
if lt_iflos[] is not initial.
*&->add by cx.
*& 取数条件为TPLNR,所以需要先sort x, delete x;
sort lt_iflos by TPLNR.
*&->add by cx.
*& 取数条件为TPLNR,所以需要先sort x, delete x;
sort lt_iflos by TPLNR.
delete adjaplcate from LT_IFLOS comparing TPLNR.
*&->end add.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_kks FROM iflot
FOR ALL ENTRIES IN LT_IFLOS
WHERE TPLNE = LT_IFLOG-TPLNR.
LOOP AT LT_KKS IN TO LS_KKS.
*&->end add.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_kks FROM iflot
FOR ALL ENTRIES IN LT_IFLOS
WHERE TPLNE = LT_IFLOG-TPLNR.
LOOP AT LT_KKS IN TO LS_KKS.
MODIFY LT_KKS FROM LS_KKS.
CLEAR LS_KKS.
ENDLOOP.
endif.
ENDLOOP.
endif.
本人常年接收SAP运维和远程项目,ECC,S/4HANA,CRM,WDA.
远程人天可谈,终身售后,有活请联系V信:18925782767(问问题免费,欢迎交流!)
!!请关注本人技术分享公众号:SAP翔子(可扫头像二维码)
每天分享新知识,博客文章也会陆续整理并迁移至公众号,与您一起共同学习