cancel
Showing results for 
Search instead for 
Did you mean: 

Interface to Revoke TECO

Former Member
0 Kudos


Hi PM Experts,

What is BAPI/interface to 'Revoke' TECO of plant maintenace Order?  We need to  'Undo TECO'  based on user status of Order  done during the day as batch Job

Thank you much in advance for help

Regards,

Jatin

Accepted Solutions (1)

Accepted Solutions (1)

peter_atkin
Active Contributor

Jatin:

Just done the same thin recently:


*&---------------------------------------------------------------------*
*& RESET TECO->REL Status on PM Order
*&---------------------------------------------------------------------*
report  zpja0005.

tables: viaufks.
data gt_messages type bal_t_msg.
data gt_return   type table of bapiret2.
data gt_methods  type table of bapi_alm_order_method with header line.

parameter: p_aufnr like aufk-aufnr obligatory.

* Get order data
clear viaufks.
select single * from viaufks where aufnr = p_aufnr
                                and autyp = 30   " PM/CS order
                                and iphas = 3.   " TECO

* Ensure a PM/CS order, and that it is TECO
if sy-subrc = 0.

* Reset TECO status back to REL
   call function 'IBAPI_ALM_ORDER_TECO_RESET'
     exporting
       iv_orderid  = p_aufnr
     tables
       et_messages = gt_messages
       return      = gt_return.

* Save order
   clear   gt_methods.
   refresh gt_methods.
   gt_methods-method = 'SAVE'.
   append gt_methods.

   call function 'BAPI_ALM_ORDER_MAINTAIN'
     tables
       it_methods = gt_methods.

* Commit to database
   call function 'BAPI_TRANSACTION_COMMIT'.

else.
   message s186(iw) with p_aufnr.
endif.

Former Member
0 Kudos

Thank you Peter... Great help.

Best Regards,

Jatin

Answers (1)

Answers (1)

rakesh_mane
Active Contributor
0 Kudos

Hello

Please check the BAPI

BAPI_ALM_ORDER_MAINTAIN

BR

Rakesh

peter_atkin
Active Contributor
0 Kudos

Rakesh

As far as I am aware, you cannot reset TECO back to REL using BAPI_ALM_ORDER_MAINTAIN unless you enhance it.


If you know different then can you please explain how?


PeteA

rakesh_mane
Active Contributor
0 Kudos

Hello

Pete,

You are correct.We cannot reset TECO back to REL using BAPI_ALM_ORDER_MAINTAIN .

But Jatin Can use this BAPI and write code for status change for status Table and develop the Z-BAPI.

Br

Rakesh