After creating PR in Operations and also in Non stock items of Component cost center have to change when save the order. I search it in forum and found only before creating PR. In user exit IWO10025 cost center add to PR after update the order again. The coding I add in the user exit is as below. I want to update cost center at the moment it save or update the auto generated PR in order IW31 or IW32
DATA : it_ebkn LIKE TABLE OF ebkn WITH HEADER LINE.
INTO TABLE it_ebkn
WHERE aufnr = caufvd_imp-aufnr.
LOOP AT it_ebkn WHERE kostl IS INITIAL.
SET kostl = caufvd_imp-kostv
WHERE banfn = it_ebkn-banfn AND
bnfpo = it_ebkn-bnfpo.
IF sy-subrc = 0.