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: 

Function module for changing Work order user status in IW32

Former Member
0 Kudos

Hi,

I want to change the work order user status in IW32 using ABAP.

Is there any function module to do so or any other way? I have tried using BDC but this does not work.

Please suggest.

Regards,

Naba

Edited by: n. saha on Nov 5, 2008 6:46 AM

13 REPLIES 13

Former Member
0 Kudos

Hi,

Check the Function module :

BAPI_ALM_ORDER_MAINTAIN

Thanks & Regards,

Navneeth K.

0 Kudos

Navneeth,

i have used this BAPI for TECO using method TECHNICALCOMPLETE. I know i can use this for changing the user status also but not sure how to carry out things.

i think i have to use:

REFNUMBER = 1.

OBJECTTYPE = USERSTATUS.

METHOD = Change.

OBJECTKEY = order number.

but how to pass the user status which i want to set?

Regards,

Naba

0 Kudos

Yuo have to update fields in the table parameter:

IT_USERSTATUS . Mention the status text and the status (inactive field).

0 Kudos

i have tried doing this but unfortunately it is not working. i think i am doing something wrong .

can you help?

Edited by: n. saha on Nov 5, 2008 7:37 AM

0 Kudos

I have used this:


DATA:fi_methods LIKE bapi_alm_order_method OCCURS 0 WITH HEADER LINE.
DATA:fi_header LIKE bapi_alm_order_headers_i OCCURS 0 WITH HEADER LINE.
DATA:fi_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA:fi_userstatus LIKE bapi_alm_order_usrstat OCCURS 0 WITH HEADER
LINE.

fi_methods-method = 'SAVE'.
APPEND fi_methods.

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

fi_userstatus-user_st_text = 'ZVIP'.
fi_userstatus-inactive = ' '.
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'
  EXPORTING
    wait = 'X'.

0 Kudos

Check the value of "fi_methods-objectkey " is it correct.

Also

try to replace

fi_userstatus-inactive = ' '.

with

clear fi_userstatus-inactive.

0 Kudos

"fi_methods-objectkey " is correct. i have used the same objectkey for TECO and it worked.

also tried : clear fi_userstatus-inactive but doesnot work either.

0 Kudos

Ok i will try to check it in my system and will get back to you.

Former Member
0 Kudos

[http://www.sapfans.com/forums/viewtopic.php?f=13&t=182938]

Former Member
0 Kudos

Naba,

you should fill out P_IT_USERSTATUS-LANGU. I've done the following, with Standard BAPI, and it worked out.

Regards,

Evandro Neves

BP PLM Consultant.

0 Kudos

I am getting Same Problem.

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

0 Kudos

Solved by my own.

Thanks all.

0 Kudos

Hi Jahnavee,

Could you please explain how did you solved that issue, I am also facing same problem.

Thanks