查询MSEG表时,删除已被冲销的单据

REPORT ztest_xk10.

TABLES:mseg.

SELECT-OPTIONS:s_mblnr FOR mseg-mblnr,
               s_bwart FOR mseg-bwart.

START-OF-SELECTION.

  SELECT t1~mblnr,t1~mjahr,t1~zeile
    INTO TABLE @DATA(lt_mseg)
    FROM mseg AS t1
   WHERE t1~mblnr IN @s_mblnr
     AND t1~bwart IN @s_bwart
     AND NOT EXISTS ( SELECT * FROM mseg AS t2
                       WHERE t2~sjahr = t1~mjahr
                         AND t2~smbln = t1~mblnr
                         AND t2~smblp = t1~zeile ).

  cl_demo_output=>display( lt_mseg ).

你可能感兴趣的:(查询MSEG表时,删除已被冲销的单据)