|
|
This website is not affiliated with, sponsored by, or approved by SAP AG.
Logistics : PM and its sub-modules & SM
Moderators: thx4allthefish, Snowy, PJA
by dolok » Wed Mar 25, 2009 5:49 pm
PM Gurus, 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.
thanks, armand
-
dolok
-
- Posts: 16
- Joined: Thu Oct 23, 2008 1:06 pm
by didier » Wed Mar 25, 2009 10:27 pm
hello Armand,
should work : I did something similar a couple of years ago. But have a look if you use the correct OBJNR.
Didier
-
didier
-
- Posts: 2393
- Joined: Thu Apr 29, 2004 3:33 pm
by PJA » Thu Mar 26, 2009 2:34 am
armand,
Can you post your IWO10009 (at save) code?
PeteA
-
PJA
-
- Posts: 10877
- Joined: Sun Jul 20, 2003 3:11 pm
- Location: Deepest darkest Aberdeenshire
-
by dolok » Thu Mar 26, 2009 11:50 am
PJA, Please find below the coding below.
Didier, Appreciate if you could send me the right coding.
thanks, armand
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' * EXPORTING * client = sy-mandt * objnr = caufvd_imp-objnr * user_status = V_ESTAT ** set_chgkz = '1' * EXCEPTIONS * 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. * ENDIF. * ENDIF.
-
dolok
-
- Posts: 16
- Joined: Thu Oct 23, 2008 1:06 pm
by PJA » Thu Mar 26, 2009 12:04 pm
armand,
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????
PeteA
-
PJA
-
- Posts: 10877
- Joined: Sun Jul 20, 2003 3:11 pm
- Location: Deepest darkest Aberdeenshire
-
by didier » Thu Mar 26, 2009 12:09 pm
and I hope your code was not in 'comments' .....
by the way; will not work when you create a notification and a work order in the same session....
Didier
-
didier
-
- Posts: 2393
- Joined: Thu Apr 29, 2004 3:33 pm
by dolok » Thu Mar 26, 2009 12:28 pm
Pete, 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..
Didier, 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?
regards, armand
-
dolok
-
- Posts: 16
- Joined: Thu Oct 23, 2008 1:06 pm
by didier » Thu Mar 26, 2009 3:36 pm
not necessary, you can read memory using fieldsymbols.
Didier
-
didier
-
- Posts: 2393
- Joined: Thu Apr 29, 2004 3:33 pm
by PJA » Fri Mar 27, 2009 2:26 am
Yes, you need to read the status data using the user-status profile assigned to your order: - Code: Select all
SELECT SINGLE estat INTO lv_estat FROM tj30t WHERE stsma EQ lv_stsma AND txt04 EQ 'PTAG'.
IF sy-subrc EQ 0.
CALL FUNCTION 'STATUS_CHANGE_EXTERN' EXPORTING objnr = caufvd_imp-objnr user_status = lv_estat IMPORTING stonr = lv_stonr EXCEPTIONS object_not_found = 1 status_inconsistent = 2 status_not_allowed = 3 OTHERS = 4.
ENDIF.
PeteA
-
PJA
-
- Posts: 10877
- Joined: Sun Jul 20, 2003 3:11 pm
- Location: Deepest darkest Aberdeenshire
-
by dolok » Mon Mar 30, 2009 10:06 am
Dear Pete, Thanks for the advice. I forgot to mention that we're using user status without status number.
cheers, armand
-
dolok
-
- Posts: 16
- Joined: Thu Oct 23, 2008 1:06 pm
by WelshPhil » Fri Oct 07, 2011 3:35 am
Hello,
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.
-
WelshPhil
-
- Posts: 9
- Joined: Thu Oct 06, 2011 12:54 am
- Location: England but wants to get back home to Geneva
-
by PJA » Sat Oct 08, 2011 12:51 am
Topic locked: hijacking an old post is against the forum rules
Please create a new post and refer to any useful info.
-
PJA
-
- Posts: 10877
- Joined: Sun Jul 20, 2003 3:11 pm
- Location: Deepest darkest Aberdeenshire
-
Return to Logistics PM
Who is online
Users browsing this forum: No registered users and 4 guests
|
|