09-16-2010 11:20 AM
Hi,
i want to change the cost center while creating purchase order, me21n,me51n,migo etc and
when tried to change the kostl field of the table im_t_ebkn in include:ZXM02U12
i get the error :The field "IM_T_EBKN" cannot be changed. .
And here is my code:
Data: mat1 type marc-matnr,
prctr type marc-prctr,
eban like LINE OF im_t_eban,
ebkn like LINE OF im_t_ebkn.
loop at im_t_eban INTO eban.
mat1 = eban-matnr.
SHIFT mat1 LEFT DELETING LEADING '0'.
if ( mat1(1) eq '6' or mat1(1) eq '7' ).
data:i2(2),s2(2),i3(3),s3(3).
SELECT SINGLE prctr from marc into (prctr) WHERE
matnr eq eban-matnr and werks eq eban-werks.
i2 = prctr(2).
s2 = prctr+2(2).
i3 = prctr+4(3).
s3 = prctr+7(3).
if i2 = 'TY'.i2 = '00'.endif.
CONCATENATE '3033' i2 '0' s3 INTO ebkn-kostl.
MODIFY im_t_ebkn FROM ebkn.
endif.
ENDLOOP.
Why i can not change the im_t_ebkn table or how can i do that?
Also i need the same thing while creating the sales order and i get the same error in sales order too, there i can not change the it_xlips in badi.
How can i change this record?
Thanks.
09-16-2010 11:29 AM
Hi,
The include is called in the 'EXIT_SAPLMEREQ_010'. IM_T_EBKN is an importing parameter. So, the error. Look for other exits where you can change.
Sujay
09-16-2010 12:01 PM
For PR PO you may have to use different user exits.
try below enhancements
PO - MM06E004
PR - MEREQ001
09-16-2010 1:18 PM
Thanks all,
this is where i already coded and get the error.
could you write me an exit about sales order to change kostl?