Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Operation user status of work order

Former Member
0 Kudos

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.

7 REPLIES 7

peter_atkin
Active Contributor
0 Kudos

Have a look at these:

STATUS_CHANGE_EXTERN

I_CHANGE_STATUS

STATUS_READ_MULTI

PeteA

Former Member
0 Kudos

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

0 Kudos

Thanks for your reply.

Could you please tell from where I can get the object number of operation?

Regards,

Uday

peter_atkin
Active Contributor
0 Kudos

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

0 Kudos

Hi ,

Yes, in IW32 I am trying to use AT_SAVE method in BAdI WORKORDER_UPDATE.

Regards,

Uday.

0 Kudos

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.

Former Member
0 Kudos

Thanks a lot all of you guys for timely help. Thank you ALL once again.