cancel
Showing results for 
Search instead for 
Did you mean: 

Error on cancelling TECO on order

0 Kudos

Hi experts!

I have a process where a need to cancel the confirmation of an operation and also cancel the Technical completion of a PM order. Doing the process on IW45 and IW32 it works ok, but using the functions Im having some problems.

Im using the BAPI_ALM_CONF_CANCEL to cancel the confirmation and the IBAPI_ALM_ORDER_TECO_RESET to cancel TECO, both followed by commit, but after the execution, it seems that the Order is “stucked”.

For example, I can’t do the technical completation, although its allowed on the Business process:

Order doesn’t show the “Complete Technically” icon nor allow the Ctrl + f12 command:

Is it correct to use these BAPIs for this, or am I missing somenthing? Is there any other function that I can use for that?

Accepted Solutions (0)

Answers (3)

Answers (3)

raymond_giuseppi
Active Contributor

the IBAPI FM is not a true BAPI, did you try to use the actual BAPI BAPI_ALM_ORDER_MAINTAIN?

(Method CANCEL_TECHNICAL_COMPLETION on objectype HEADER)

0 Kudos

Hi Raymond!

I didnt try this BAPI. I don´t know how to fill the fields on it to cancel TECO and the confirmation.

Could You help on that?

raymond_giuseppi
Active Contributor
0 Kudos

Try a code such as

APPEND initial line  TO it_methods assigning <method>.
<method>-refnumber = 1.
<method>-objecttype = 'HEADER'.
<method>-method = 'CANCEL_TECHNICAL_COMPLETION'.
<method>-objectkey(12) = item_aufnr.
APPEND initial line  TO it_methods assigning <method>.
<method>-refnumber = 1.
<method>-objecttype = 'HEADER'.
<method>-method = 'SAVE'. " Not always required
<method>-objectkey(12) = item_aufnr.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
  TABLES
    it_methods = it_methods
    return     = return.
0 Kudos

Hi!

I try in a test sequence(SE37) with the commit, but it doesnt remove the TECO status:

Did I missed something?

raymond_giuseppi
Active Contributor
0 Kudos

The call of BAPI_TRANSACTION_COMMIT or a message in RETURN table?

(In test mode, you could also use method DIALOG and not SAVE)

peter_atkin
Active Contributor

Eduardo,

What is the AFIH-IPHAS value for this order?

PeteA

0 Kudos

Hi Peter!

The value is still 3 - Technically completed:

Maybe this is causing the problem in the order. Any ideas on how to solve?

peter_atkin
Active Contributor
0 Kudos

OK, so you have a status inconsistency caused by the FMs you are using.

There is a fix for this on OSS - the program name is something like ZIPHAS00

PeteA

peter_atkin
Active Contributor
0 Kudos

Also have a look at function module /ISDFPS/WO_SYSTAT_SET.

PeteA

BalaAP
Active Contributor
0 Kudos

Hi,

BAPI's are correct. But I am suspecting the sequence of calling these bapi's. There will be lot more difference between doing all these process manually by going through sap standard screen/menu and writing a abap code to perform yourself.

May be, I am guessing, you need some delay between above two bapi;s (even though you are committing). Because, in background some tables need to be synchronized. When you do without bapi, sap takes care of it.

What we used to do is, create some scenarios in a test system and do the process without bapi and check the system/user status and also compare with scenarios with using bapi to ensure that the database tables are correctly updated.

0 Kudos

Hi BALASUBRAMANIAN!

At first I try canceling the confirmation, then canceling TECO:

BAPI_ALM_CONF_CANCEL

BAPI_TRANSACTION_COMMIT

Then I cancel the confirmation:

IBAPI_ALM_ORDER_TECO_RESET

BAPI_ALM_ORDER_MAINTAIN à Method SAVE

BAPI_TRANSACTION_COMMIT

Executing these function, the status was like that:

Operation:

Order:

Executing the process by the transactions IW45 and IW32 I get the same status at the end, but the order is OK.

As Peter mentioned, the difference I noticed is that in the order I used the functions, the AFIH-IPHAS was 3 – Technically completed, and the order I changed with the transaction was 2 – Released.

Maybe that is the problem. Any ideas about that?