Application Development and Automation 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: 
Read only

Function module for changing Work order user status in IW32

Former Member
0 Likes
3,976

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
Read only

Former Member
0 Likes
2,169

Hi,

Check the Function module :

BAPI_ALM_ORDER_MAINTAIN

Thanks & Regards,

Navneeth K.

Read only

0 Likes
2,169

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

Read only

0 Likes
2,169

Yuo have to update fields in the table parameter:

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

Read only

0 Likes
2,169

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

Read only

0 Likes
2,169

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'.

Read only

0 Likes
2,169

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

Also

try to replace

fi_userstatus-inactive = ' '.

with

clear fi_userstatus-inactive.

Read only

0 Likes
2,169

"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.

Read only

0 Likes
2,169

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

Read only

Former Member
0 Likes
2,169

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

Read only

Former Member
0 Likes
2,169

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.

Read only

0 Likes
2,169

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

Read only

0 Likes
2,169

Solved by my own.

Thanks all.

Read only

0 Likes
2,169

Hi Jahnavee,

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

Thanks