Hi Experts,
I have the status -->W_MA (Waiting material) for the order # 123. I want to change as ' W_LA (Waiting Labour)'. I tried the following code, it is not updated in the transaction.
lw_header-orderid = lv_aufnr.
lw_header-order_type = 'ZPM1'.
lw_header-planplant = 'INJA'.
APPEND lw_header to li_header.
CLEAR w_METHODS.
W_METHODS-REFNUMBER = 1.
w_METHODS-OBJECTTYPE = 'USERSTATUS'.
w_METHODS-METHOD = 'CHANGE'.
w_METHODS-OBJECTKEY = lv_aufnr.
APPEND w_METHODS to t_methods.
CLEAR w_USERSTATUS.
w_USERSTATUS-USER_ST_TEXT = 'W_LA'.
w_USERSTATUS-LANGU = SY-LANGU.
w_USERSTATUS-INACTIVE = ''. "Not set to X
w_USERSTATUS-CHANGE_EVENT = '01'.
APPEND w_userstatus to T_USERSTATUS.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
IT_METHODS = T_METHODS
IT_HEADER = li_header
IT_USERSTATUS = T_USERSTATUS
RETURN = T_RETURN
ET_NUMBERS = T_NUMBERS
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
Many thanks in Advance
.