Skip to Content
author's profile photo Former Member
Former Member

BAPI_ALM_ORDER_MAINTAIN for USER status change in IW32 transaction?

Hi Experts,

I have the status -->W_MA (Waiting material) for the order # 123. I want to change as ' W_LA (Waiting Labour)'. I tried the following code, it is not updated in the transaction.

lw_header-orderid = lv_aufnr.

lw_header-order_type = 'ZPM1'.

lw_header-planplant = 'INJA'.

APPEND lw_header to li_header.

CLEAR w_METHODS.

W_METHODS-REFNUMBER = 1.

w_METHODS-OBJECTTYPE = 'USERSTATUS'.

w_METHODS-METHOD = 'CHANGE'.

w_METHODS-OBJECTKEY = lv_aufnr.

APPEND w_METHODS to t_methods.

CLEAR w_USERSTATUS.

w_USERSTATUS-USER_ST_TEXT = 'W_LA'.

w_USERSTATUS-LANGU = SY-LANGU.

w_USERSTATUS-INACTIVE = ''. "Not set to X

w_USERSTATUS-CHANGE_EVENT = '01'.

APPEND w_userstatus to T_USERSTATUS.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

TABLES

IT_METHODS = T_METHODS

IT_HEADER = li_header

IT_USERSTATUS = T_USERSTATUS

RETURN = T_RETURN

ET_NUMBERS = T_NUMBERS

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

* IMPORTING

* RETURN =



Many thanks in Advance

.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2014 at 01:52 PM

    Thanks mate, I solved this issue.

    I have not maintained the reference number for the method. If there are 2 statuses ,we have to maintain as : REF NO 0 for SAVE, 1 and 2 for change.

    CLEAR w_METHODS.

    W_METHODS-REFNUMBER = 0.

    w_METHODS-OBJECTTYPE = 'USERSTATUS'.

    w_METHODS-METHOD = 'SAVE'.

    w_METHODS-OBJECTKEY = lv_aufnr.

    APPEND w_METHODS to t_methods.

    CLEAR w_METHODS.

    W_METHODS-REFNUMBER = 1.

    w_METHODS-OBJECTTYPE = 'USERSTATUS'.

    w_METHODS-METHOD = 'CHANGE'.

    w_METHODS-OBJECTKEY = lv_aufnr.

    APPEND w_METHODS to t_methods.


    CLEAR w_METHODS.

    W_METHODS-REFNUMBER = 2.

    w_METHODS-OBJECTTYPE = 'USERSTATUS'.

    w_METHODS-METHOD = 'CHANGE'.

    w_METHODS-OBJECTKEY = lv_aufnr.

    APPEND w_METHODS to t_methods.



    This is the root-cause of this problem. Hope it will help someone.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 04, 2014 at 07:26 PM

    Hi

    Please check what is the internal status value in TJ30/TJ30T for the same. You can either use the above mentioned or STATUS_CHANGE_EXTERN fm for the same.

    Nabheet

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.