Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3208

Trying to update the OPERATION user status using BAPI_ALM_ORDER_MAINTAIN

$
0
0

I am trying to update the user status of an OPERATION using BAPI_ALM_ORDER_MAINTAIN. The BAPI is returning a success message but it is not changing the user status of the operation on the order. Here is the code:


* Build the order header table
APPEND INITIAL LINE TO lt_header ASSIGNING FIELD-SYMBOL(<ord_header>) .
<ord_header>-orderid = me->_order_number . "12 digit zero filled valid order number


* Build the operation table
APPEND INITIAL LINE TO lt_operations ASSIGNING FIELD-SYMBOL(<operation>) .
<operation>-activity = '0010' .
APPEND INITIAL LINE TO lt_operations_up ASSIGNING FIELD-SYMBOL(<op_up>) .
<op_up>-activity = abap_true .


* Build the method table
APPEND INITIAL LINE TO lt_methods ASSIGNING <ord_method> .
<ord_method>-refnumber  = '000001' .
<ord_method>-objecttype = 'OPERATION' .
  <ord_method>-method     = 'CHANGE' .
CONCATENATE me->_order_number
  me->_task_update_request-task-number
  <ops>-sub_activity
  INTO <ord_method>-objectkey .
APPEND INITIAL LINE TO lt_methods ASSIGNING <ord_method> .
<ord_method>-refnumber  = '000000' .
  <ord_method>-method     = 'SAVE' .


* Update the status value
APPEND INITIAL LINE TO lt_ustatus ASSIGNING FIELD-SYMBOL(<ustatus>) .
<ustatus>-user_st_text = 'PEND' .


CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
  it_methods    = lt_methods
  it_header     = lt_header
it_userstatus = lt_ustatus
it_operation  = lt_operations
  return        = lt_return .


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.


Please ensure you read the question correctly. I have been searching for hours on SCN and to be honest I lost count of the response to this same question which give wrong answers. Links to unresolved questions are rife, answers to change the user status on the ORDER instead of the OPERATION are rife, answers to use ALM_ME_ORDER_CHANGE which can't change status at OPERATION level are rife and answers with random code that doesn't solve the problem are rife. So please, just read the question carefully before answering.


Thanks.


Regards, Martin.


Viewing all articles
Browse latest Browse all 3208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>