cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI for PO's status change (TECO -> undo TECO)

Former Member
0 Kudos

Hi, ALL.

I'm looking for a BAPI which a Production Order's status chenge From TECO to undo TECO.

(revoke technical complete)

I can use "BAPI_PRODORD_COMPLETE_TECH".

It will change a status to ONLY TECO.

Do you know a BAPI for revoke technical complete?

Let me know please.

Regards

Rie

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

dear

in T CODE CO02 you can undo teco.

Former Member
0 Kudos

Hello, Were you able to find a solution to this issue? I'm in the same situation I want to revoke technical complete after using the BAPI_PRODORD_COMPLETE_TECH.

Regards.

former_member214131
Active Contributor
0 Kudos

Hi,

Have you checked the FM: STATUS_CHANGE_INTERN

Hope this helps.

Best Regards, Murugesh

Former Member
0 Kudos

Hi Murgesh,

Have you used this FM before ?

I just tried the FM, but it does lead to inconsistencies. The FM only removes the TECO status, but when you open the order, the system still thinks the order is in TECO.

Regards,

Vivek

former_member214131
Active Contributor
0 Kudos

Hi,

I have successfully reset the system status on a quality notification in QM module. I understand that the Status logic/Statergy used / implemented by SAP across modules works on the same principle.

You need to use this FM properly ( Records from JEST ) to enable/disable the statuses.

Perhaps you can check the FM documentation. Also other related FMs in FuGr: BSVA

Hope this helps.

Best Regards, Murugesh

Former Member
0 Kudos

Hi Murgesh,

Thanks for the info at the outset.

Wish to update you, that the FM - STATUS_CHANGE_INTERN cannot be used for Production Orders, did one more round of testing, but same results. I am able to reset TECO status no doubt, but it leads to inconsistency when i open the order in co02.

If you can do a test at your end & are able to open the production order in co02 without any issues, let me know.

Regards,

Vivek

former_member214131
Active Contributor
0 Kudos

Hi Vivek,

I checked now on system and was successful.

As said earlier, the SAP standard STATUS statergy works with same logic/principle across modules.

You can check the following:

Scenario Tested: Order 1532784 with REL status is converted to TECO by mistake and had to be reverted.

Table: TJ02T status descriptions in EN viz., TECO, REL.....

Table: JEST Statuses of the orders viz., I0045, I0002....

Table: AUFK Order header with object number Field: OBJNR viz.,: OR000001532784 for Order 1532784

My order has the previous status as REL ( I0002 )

to reset the status from TECO to REL, we need to put the status I0045(TECO), Field JEST-INACT to 'X' from space and reset the I0002 (REL), Field JEST-INACT to space from 'X'.

CALL FUNCTION 'STATUS_CHANGE_INTERN'
  EXPORTING
*    check_only                = p_test
    client                    = sy-mandt
    objnr                     = 'OR000001532784'
*   ZEILE                     = ' '
*   SET_CHGKZ                 =
* IMPORTING
*   ERROR_OCCURRED            =
*   OBJECT_NOT_FOUND          =
*   STATUS_INCONSISTENT       =
*   STATUS_NOT_ALLOWED        =
  TABLES
    status                    = gt_jstat
  EXCEPTIONS
    object_not_found          = 1
    status_inconsistent       = 2
    status_not_allowed        = 3
    OTHERS                    = 4

InternalTable:gt_JSTAT contents:

Data: gt_JSTAT type JSTAT occurs 0 with header line.
gt_JSTAT-stat = 'I0002'.
gt_JSTAT-inact = ' '.
append gt_JSTAT.
gt_JSTAT-stat = 'I0045'.
gt_JSTAT-inact = 'X'.
append gt_JSTAT.

Make sure that you

COMMIT WORK.

after the FM call.

Hope this helps.

Best Regards, Murugesh

Former Member
0 Kudos

Hi Murgesh,

Thank you very much for your feedback.

I had missed setting the REL status back at my end & so was hitting the error.

Anyways i was able to manage this with another FM in BSVA Fn grp.

Keep the good work going...!!!

Regards,

Vivek

former_member214131
Active Contributor
0 Kudos

Hi Vivek,

Can you tell me which other FM from FuGr BSVA you used to accomplish this task?

Perhaps your solution could help Rie Nagakura san in easier way....

Best Regards, Murugesh

Edited by: Murugesh Arcot on Jul 21, 2009 5:23 PM

Former Member
0 Kudos

Hi, Vivek & Murugesh.

Thank you very very much for your many comments.

Vivek,

I tried a FM 'IBAPI_ALM_ORDER_TECO_RESET'.

TECO changed to a invalid status, but AUFK-IDAT2(value) wasn't cleared.

I think it's inconsistencies...

Murugesh,

I tried a FM 'STATUS_CHANGE_INTERN'.

This is the same.

TECO changed to a invalid status, but AUFK-IDAT2(value) wasn't cleared.

I think it's inconsistencies, too...

How about you?

Would you check AUFK-IDAT2 after you use this FM?

And, I'd like to know Vivek's solution.

Vivek,

Which FM in BSVA Function Group you use?

Regards,

Rie

former_member214131
Active Contributor
0 Kudos

Hi Rie Nagakura san,

Yes you are right. The value in the field as mentioned by you AUFK-IDAT2 logs the previous change with respect to the status TECO. However, if you use 'STATUS_CHANGE_INTERN' and revert back the status from TECO, and set the status to TECO again on another day, it logs the latest date. By this, I understand that this field not so significant.

Also it is good for us to understand that SAP logs the Status TECO on this field AUFK-IDAT2.

Our aim is to reset the status back from TECO so that the order could be used further in production scenario and not to bring the table level log data also in original form. Also you could find the detailed change documents in CO02, Status Detail screen ( with the push of 'i' button next to status in the order header display ) and choose menu option Extras -> Change Documents -> All; you would find the series of statuses & if you doubleclick TECO it gives the exact date,time & user who has set the status. According to me this log is very much essential.

I am toally convinced with the working of the FM 'STATUS_CHANGE_INTERN' with the log.

Hope this helps.

Best Regards, Murugesh

Former Member
0 Kudos

Hi,

Apologies for the delay in replying.

I used - STATUS_CHANGE_FOR_ACTIVITY. But as you pointed out the AUFK table is not updated with these FM's. Need to further investigate if there is another FM which needs to be used in sequence with these FM's to update AUFK table.

If i manage to find one, will update here.

Regards,

Vivek

Former Member
0 Kudos

Hi,

To my knowledge there is no standard BAPI / FM which can help you for this. You might consider creating your own Z function module for this or do a recording using co02 & incorporate the same into your BDC program.

I haven't used this, but check if -> IBAPI_ALM_ORDER_TECO_RESET can be used followed by BAPI_TRANSACTION_COMMIT to do the reset. If you succeed in this, please do let me know.

Regards,

Vivek

Former Member
0 Kudos

Hi!,

Though One BAPI is available to revoke the user status but no standard BAPI available to revoke the system status.

I think you can try some work around solution by using user status profile and BAPI available for prod ord change.

Regards,

Uday

Ritz
Active Contributor
0 Kudos

Hi Rie,

BAPI_PRODORD_REVOKEUSERSTATUS

Use this one to revoke the status

You use this method to revoke the user status of the profile of an order at header level.

Transfer the data in the following parameters:

u2022 ORDERS: Orders

u2022 STATUS: User status

u2022 STATUS_PROFILE: Profile

Check this it may help you.

regards

Ritesh