CDS根据条件获得物料号
2018-12-07 本文已影响0人
阿努比斯1117
@AbapCatalog.sqlViewName: 'ZV_FI034_MATNR'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'FICO034:根据条件获取物料号'
define view ZDDL_FI034_GET_MATNR
with parameters
p_mjahr :mjahr,
p_budat_b :budat,
p_budat_e :budat
as select from mseg as m1
inner join mkpf as m2 on m1.mblnr = m2.mblnr
and m1.mjahr = m2.mjahr
{
key m1.matnr
}
where
m2.vgart = 'WS'
and(
m1.bwart = '131'
or m1.bwart = '132'
)
and m2.mjahr = :p_mjahr
and m2.budat between :p_budat_b and :p_budat_e
"获取物料
SELECT *
FROM zv_fi034_matnr( p_mjahr = @s_gjahr-low,
p_budat_b = @lv_date_b,
p_budat_e = @lv_date_e )
INTO TABLE @DATA(lt_matnr).
"填充物料
s_matnr[] = VALUE #( FOR wa_matnr IN lt_matnr ( sign = 'I' option = 'EQ' low = wa_matnr-matnr ) ).