Page 1 of 1

BAPI for changing Work order user status in IW32

PostPosted: Mon May 12, 2014 6:14 am
by JTrivedi
Hello Experts,

I am getting Same Problem in updating status via BAPI, BAPI_ALM_ORDER_MAINTAIN. Its not giving any error but even not update status.
I know i can use this for changing the user status also but not sure how to carry out things.

I used this code.
Code: Select all
fi_methods-method = 'SAVE'.
APPEND fi_methods.


fi_methods-refnumber = 1.
fi_methods-objecttype = 'USERSTATUS'.
fi_methods-method = 'CHANGE'.
fi_methods-objectkey = '002000002453'.
APPEND fi_methods.


fi_userstatus-user_st_text = 'COMM'.
fi_userstatus-user_langu   = 'EN'.
fi_userstatus-change_event = ' 01 '.
APPEND fi_userstatus.



CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
  TABLES
    it_methods    = fi_methods
    it_userstatus = fi_userstatus
    return        = fi_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Above code I am using and there the message comes like
T ID NUM MESSAGE

S IW 080 Order saved with number 2000002453
S IWO_BAPI2 110 BAPI control was ended


can any on know what is wrong in this? please help if having knowledge.

Thank You,
Jahnavee Trivedi

Re: BAPI for changing Work order user status in IW32

PostPosted: Mon May 12, 2014 4:24 pm
by Grogan
Try appending the SAVE method after the userstatus / change method.

Also try setting refnumber and objectkey in the save method record (just based on a bit of old code we have lying around).

Re: BAPI for changing Work order user status in IW32

PostPosted: Tue May 13, 2014 2:34 am
by knowledgeWorx
Just out of interest - why are you using the BAPI instead of STATUS_CHANGE_EXTERN from function group BSVA? I think that one gives you better control.