商务合作:179001057@qq.com

根据proj-pspid 找物料

技术2022-05-11  0


某平台价值19860元的编程课程资料免费领取【点我领取】


根据proj-pspid 找物料

  data: begin of st,         matnr like mara-matnr,         end of st.

  data: it_matnr like standard table of st with header line.   data: rtn like ddshretval occurs 0 with header line.

  data: l_pspnr like proj-pspnr.

  ranges: l_matkl for t023t-matkl.   l_matkl-sign = 'I'.   l_matkl-option = 'BT'.   l_matkl-low = 'L0601'.   l_matkl-high = 'L0606'.   append l_matkl.

  select single pspnr     into l_pspnr     from proj    where proj~pspid = proj-pspid.

  select o~matnr     into corresponding fields of table it_matnr     from ebkn as n    inner join prps as r on n~ps_psp_pnr = r~pspnr    inner join eban as p on n~banfn = p~banfn    inner join ekpo as o on p~banfn = o~banfn                        and o~bnfpo = p~bnfpo    where r~psphi eq l_pspnr      and p~matkl in l_matkl.

  sort it_matnr.   delete adjacent duplicates from it_matnr comparing matnr.   delete it_matnr where matnr eq space.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'        exporting             retfield        = 'MATNR'             dynpprog        = sy-cprog             dynpnr          = sy-dynnr             dynprofield     = 'MATNR'             stepl           = sy-stepl             window_title    = '物料'             value_org       = 'S'        tables             value_tab       = it_matnr             return_tab      = rtn        exceptions             parameter_error = 1             no_values_found = 2             others          = 3.


最新回复(0)