红方框里那一步之行很慢,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.