FORM buchen.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form BUCHEN, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZCHANGE_MM03_PLND_DELY. "active version
*Request NO DEVK905184
*Add by Jimmy 03/11/2013 auto update plan delivery time in material master
read table xord index 1.
if sy-subrc eq 0.
data: t_head like bapimathead,
t_plantdata like bapi_marc,
t_plantdatax like bapi_marcx,
t_return like bapiret2..
data:lv_plifz like marc-plifz,
wa_plifz like marc-plifz .
loop at xord .
if xord-febel = 'X' or xord-flifn = 'X' or xord-autet <> ' '.
select single b~aplfz into wa_plifz "a~MATNR b~WERKS a~LIFNR b~
from eina as a
inner join eine as b on a~infnr = b~infnr
where a~matnr = xord-matnr
and a~lifnr = xord-lifnr
and b~ekorg = '8000'
and b~werks = xord-werks.
check sy-subrc eq 0.
select single plifz into lv_plifz
from marc
where matnr = xord-matnr
and werks = xord-werks.
check sy-subrc eq 0.
check lv_plifz ne wa_plifz.
t_head-material = xord-matnr.
t_head-mrp_view = 'X'.
t_plantdata-plant = xord-werks.
t_plantdata-plnd_delry = wa_plifz.
t_plantdatax-plant = xord-werks.
t_plantdatax-plnd_delry = 'X'.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = t_head
plantdata = t_plantdata
plantdatax = t_plantdatax
importing
return = t_return.
endif.
endloop.
endif.
*end
ENDENHANCEMENT.
*$*$-End: (1)---------------------------------------------------------------------------------$*$*
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form BUCHEN, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZCHANGE_MM03_PLND_DELY. "active version
*Request NO DEVK905184
*Add by Jimmy 03/11/2013 auto update plan delivery time in material master
read table xord index 1.
if sy-subrc eq 0.
data: t_head like bapimathead,
t_plantdata like bapi_marc,
t_plantdatax like bapi_marcx,
t_return like bapiret2..
data:lv_plifz like marc-plifz,
wa_plifz like marc-plifz .
loop at xord .
if xord-febel = 'X' or xord-flifn = 'X' or xord-autet <> ' '.
select single b~aplfz into wa_plifz "a~MATNR b~WERKS a~LIFNR b~
from eina as a
inner join eine as b on a~infnr = b~infnr
where a~matnr = xord-matnr
and a~lifnr = xord-lifnr
and b~ekorg = '8000'
and b~werks = xord-werks.
check sy-subrc eq 0.
select single plifz into lv_plifz
from marc
where matnr = xord-matnr
and werks = xord-werks.
check sy-subrc eq 0.
check lv_plifz ne wa_plifz.
t_head-material = xord-matnr.
t_head-mrp_view = 'X'.
t_plantdata-plant = xord-werks.
t_plantdata-plnd_delry = wa_plifz.
t_plantdatax-plant = xord-werks.
t_plantdatax-plnd_delry = 'X'.
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
headdata = t_head
plantdata = t_plantdata
plantdatax = t_plantdatax
importing
return = t_return.
endif.
endloop.
endif.
*end
ENDENHANCEMENT.
*$*$-End: (1)---------------------------------------------------------------------------------$*$*