on 02-22-2022 4:25 PM
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?
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Eduardo,
What is the AFIH-IPHAS value for this order?
PeteA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Also have a look at function module /ISDFPS/WO_SYSTAT_SET.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.