cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a user status to an order

Former Member
0 Kudos

Hi Experts,

We have an production order in SAP-Plant maintenance.

The User statuses profile has already been defined in the SPRO/Config settings for thie order type of thisorder..

We need to add a user status(from the user status profile) by using any RFC OR BAPI.

we found one RFC 'I_CHANGE_STATUS' which is used for changing an user status of an order to another user status.

But we need exactly an RFC or BAPI(or logic) which could add only an user status to the order.

we need addition not a change!

Thanks,

Rohit

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

we found teh solution

peter_atkin
Active Contributor
0 Kudos

And what was the solution?

Former Member
0 Kudos

We used BAPI_ISUSMORDER_USERSTATUSSET which Sets or deletes a user status for service/maintenance orders.

In the structure STATUS, you can enter the status either in the unique internal format or in the language-dependent external format.

pseudo code could be as below

data: wa_userstatus LIKE LINE OF l_it_userstatus,

wa_userstatus-intern = 'UTS' (it could be any userstatus of an order(UTS is unable to start))

wa_userstatus-extern = 'UTS'. (it could be any userstatus of an order)

wa_userstatus-langu = sy-langu.

wa_userstatus-langu_iso = 'EN'.

CALL FUNCTION 'BAPI_ISUSMORDER_USERSTATUSSET'

EXPORTING

number = order_id ( your 12 characrter order id)

status = wa_userstatus

inactive = ' '

IMPORTING

return = it_return.

(Note: set inactive = 'X' if you want to make user status(say UTS) deleted from user status of the order)

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Former Member
0 Kudos

Depends on the status profile you have, but normally it's a mix of:

a) Numbered statuses (you must have an initial status defined and only one numbered status can be assigned at any one time) so you are always "changing" the status.

b) Un-numbered statuses where you can freely add or remove any combination of statuses.

I expect the RFC for change status cannot cope with un-numbered statuses, unless you are adding a status where none previously existed, that should be able to handle it as a change of status.

As Pete is asking, need more detail to know exactly what you are trying to achieve.

peter_atkin
Active Contributor
0 Kudos

We need to add a user status(from the user status profile) by using any RFC OR BAPI

Why must it be a RFC or BAPI?

What are you trying to do?

PeteA

amit_saxena7
Active Participant
0 Kudos

Hi,

Check this BADI:

IQS0_STATUS_MAINTAIN Control of Changeability of User Status

Thanks,

Amit.