This website is not affiliated with, sponsored by, or approved by SAP AG.
Logistics : PM and its sub-modules & SM
12 posts • Page 1 of 1
We maintain a status in both Notification and Order Status Profile to indicate equipment not being in service (IDLE).
When this IDLE status is set in Notification, we would need the same status IDLE (maintained in Order status Profile) to be
active in the work order after having been created. Trying to use EXIT_SAPLCOIH_009 by calling function module STATUS_CHANGE_EXTERN is not solving my problem because the work order has not yet been generated.
Any input is very much appreciated.
Can you post your IWO10009 (at save) code?
Please find below the coding below.
Appreciate if you could send me the right coding.
DATA v_qmobjnr LIKE qmel-objnr.
* IF NOT caufvd_imp-qmnum IS INITIAL.
* CONCATENATE 'QM' caufvd_imp-qmnum INTO v_qmobjnr.
* SELECT SINGLE stat FROM jest INTO v_stat
* WHERE objnr = v_qmobjnr
* AND stat = 'E0009'
* AND inact = ' '.
* CHECK sy-subrc = 0.
* SELECT SINGLE estat FROM tj30t INTO v_estat
* WHERE stsma = caufvd_imp-stats
* AND txt04 = 'PTAG'.
* CALL FUNCTION 'STATUS_CHANGE_EXTERN'
* client = sy-mandt
* objnr = caufvd_imp-objnr
* user_status = V_ESTAT
** set_chgkz = '1'
* object_not_found = 1
* status_inconsistent = 2
* status_not_allowed = 3
* OTHERS = 4.
* IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
Have you created and assigned a suitable user-status profile to your order? Because it looks like you are trying to use the user-status number from the notification, and then trying to assign it to an order. You need to use the user-status number (EXXXX) for the order.
I'm guessing that function module 'STATUS_CHANGE_EXTERN' is returning an exception????
We maintain different status profile for different order type and I got different status number for each one of them.
I guess we have to add another condition, for each order type and status profile to set each status number in the work order.
The function's not returning an exception..
Sorry about the comments, my colleque is working on the same exit, so I'm commenting it out. So the order has to be created from IW22?
Yes, you need to read the status data using the user-status profile assigned to your order:
Thanks for the advice. I forgot to mention that we're using user status without status number.
A little late perhaps but might benefit others who are doing searches on this FM.
Ive put this function into an enhancement point in transaction CO02 and during debug appears to work perfectly. Note that the status change occurs when the user selects 'release of production order'.
When closing CO02 it is important that 'save' is also selected or the update will not happen. I guess the 'commit' happens after 'save'.
Might save someone chasing their own tail.
Topic locked: hijacking an old post is against the forum rules
Please create a new post and refer to any useful info.
12 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests