*判断内表是否为空
IF NOT ITAB_MATNR[] IS INITIAL.
*删除内表中的重复数据
DELETE ADJACENT DUPLICATES FROM ITAB_MATNR COMPARING MATNR.
*抽取数据
  SELECT P~MATNR  E~MENGE E~WEMNG
    INTO TABLE ITAB_PO
    FROM EKPO AS P INNER JOIN EKET AS E
      ON P~EBELN = E~EBELN
     AND P~EBELP = E~EBELP
     FOR ALL ENTRIES IN ITAB_MATNR
   WHERE MATNR = ITAB_MATNR-MATNR.
ENDIF.
posted on 2009-04-16 15:48  levin  阅读(561)  评论(0编辑  收藏  举报