07-31-2008 1:06 PM
Hi
I ma trying to update the user status of an operation of an work order. Can somebody please tell me r function module to update the user status of operation in work order.
Thansk in Advance.
Regards,
Uday.
07-31-2008 6:06 PM
Have a look at these:
STATUS_CHANGE_EXTERN
I_CHANGE_STATUS
STATUS_READ_MULTI
PeteA
07-31-2008 11:31 PM
Hi,
Try the below code which updates user status of objects.
data: L_USER_STATUS TYPE JEST-STAT .
L_USER_STATUS = 'E0002'. "user status value
CALL FUNCTION 'STATUS_CHANGE_EXTERN'
EXPORTING
CLIENT = SY-MANDT
OBJNR = l_objnr "object number of work order operation
USER_STATUS = L_USER_STATUS
SET_CHGKZ = 'X'
EXCEPTIONS
OBJECT_NOT_FOUND = 1
STATUS_INCONSISTENT = 2
STATUS_NOT_ALLOWED = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
RAISE STATUS_NOT_CHANGED .
ENDIF.
"external commit is required.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN =
.
Hope this will help.
Regards
Sumit
08-01-2008 6:31 AM
Thanks for your reply.
Could you please tell from where I can get the object number of operation?
Regards,
Uday
08-01-2008 8:42 AM
Uday,
Are you trying to update the user-status within TCode IW32?
If so, how are you attempting to do this (i.e. what user-exit/BADI)
If not, then please explain how you are trying to do this
PeteA
08-01-2008 9:44 AM
Hi ,
Yes, in IW32 I am trying to use AT_SAVE method in BAdI WORKORDER_UPDATE.
Regards,
Uday.
08-01-2008 11:43 AM
Uday,
Try rhis in your BADI. If it doesn't work, then try it in user-exit IWO10009 (at save)
* get order statuses
call function 'STATUS_READ_MULTI'
exporting
all_in_buffer = 'X'
importing
status = lt_jest.
* get operation data from memory
call function 'CO_BP_AFVG_BT_FETCH'
tables
et_afvg_bt = lt_afvgb.
08-08-2008 11:50 AM
Thanks a lot all of you guys for timely help. Thank you ALL once again.