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: 

fm change status

former_member691402
Participant
0 Kudos

fm to change the status of the production order operations (tcode co02)

5 REPLIES 5

vinita_kasliwal
Active Contributor

HI Nick

Please refer below

BAPI_PRODORD_SETUSERSTATUS

BAPI_BUS2054_SET_STATUS

Another one: BAPI_PRODORD_CHANGE

STATUS_CHANGE_INTERN

Some code snippet as below

CALL FUNCTION 'BAPI_PRODORD_CHANGE'  EXPORTING  NUMBER =
OBJECT-KEY-NUMBER  ORDERDATA =
ORDERDATA  ORDERDATAX =
ORDERDATAX  IMPORTING  RETURN = RETURN  ORDER_TYPE =
ORDERTYPE  ORDER_STATUS =
ORDERSTATUS  MASTER_DATA_READ
= MASTERDATAREAD  EXCEPTIONS  OTHERS = 01.

Another one:

CALL FUNCTION
'STATUS_CHANGE_INTERN'  EXPORTING  objnr  = lv_objnr  TABLES  status  = lt_status  EXCEPTIONS 
object_not_found  = 1 
status_inconsistent = 2 
status_not_allowed  = 3  OTHERS  = 4.

refer this one which has the screenshot in the answer as well

https://answers.sap.com/questions/10611723/updating-production-order-and-operation-user-statu.html

Let me know if that helped

Regards

Vinita

0 Kudos

I tried this fm I_CHANGE_STATUS but it only changes the status of the header and not that of the operations why?

can you give me a practical example of how I have to pass the values to go from released to open also of the other fm?

raymond_giuseppi
Active Contributor

Some allowed BAPI are

  • BAPI_PRODORD_CHANGE BAPI: Change Production Order
  • BAPI_PRODORD_CLOSE BAPI: Close Production Orders
  • BAPI_PRODORD_COMPLETE_TECH BAPI: Technically Complete Production Orders
  • BAPI_PRODORD_RELEASE BAPI: Release Production Orders
  • BAPI_PRODORD_RELEASE_OPERATION BAPI: Release Production Order Operations
  • BAPI_PRODORD_REVOKEUSERSTATUS BAPI: Reset User Status for Production Orders at Header Level
  • BAPI_PRODORD_SETUSERSTATUS BAPI: Set User Status for Production Orders at Header Level
  • BAPI_PRODORD_SET_DELETION_FLAG BAPI: Set Deletion Flag for Production Orders
  • BAPI_PRODORD_SET_DEL_INDICATOR BAPI: Set Deletion Indicator for Production Orders

FMs such as STATUS_CHANGE_INTERN should generally not be used as they do not fully process the transaction, they are called internally by SAP with other FMs that perform the functional checks and apply any dependencies.

0 Kudos

Thanks for the answer, among all these, however, I do not see fm that can change the status from released to open, is it possible to do it?

0 Kudos

SAP didn't provide BAPI for every status change, so consider other tools from a small easy BDC 🙂 to tracing standard behavior to clone it 😞