cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ALM_ORDER_MAINTAIN doesn't work in SAP Business Workflow

Former Member
0 Kudos

Hi all, I am using BAPI_ALM_ORDER_MAINTAIN within a workflow to release a PM order which is created by the workflow in a step before with ALM_ME_ORDER_CREATE, followed by ALM_ME_ORD_BAPI_ORDER_POST and BAPI_TRANSACTION_COMMIT. That works fine and the result is a PM order that is not yet released. After the BAPI_TRANSACTION_COMMIT I  have tried SET UPDATE TASK LOCAL, as well as WAIT UP TO 180 SECONDS. I also stopped the workflow to control whether all data is written to the database and I found all data of the PM order properly. BUT BAPI_ALM_ORDER_MAINTAIN always issued an error message saying that the data for the procedure (Vorgang) are not maintained for the PM order. If I run the BAPI_ALM_ORDER_MAINTAIN alone it works, same with the function I created as well as the method of the business object as well as the task for the workflow. As soon as the workflow runs it - error message, no release. Even if you release the PM order manually with IW32 the PM order is fine and released. No error message at all. My conclusion is that WF_BATCH cannot run the BAPI caused by lag of user rights also it has SAP_ALL. This makes no sence but might be the solution of the problem. Does anybody have an idea what's wrong?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all,

Meanwhile we have changed the customizing of the PM order. It is going to be released automatically when it is created, so the first status is RELEASED.

All OSS notes refered to various problems but not to that a WF_BATCH user with SAP_ALL and SAP_NEW does not excecute a BAPI which runs by a dialog user with not half of the user rights WF_BATCH has.

Anyway, we found a workaround, thanks for the support.

SandySingh
Active Contributor
0 Kudos

Hello

I dont think this issue has to do something with user authorisation. It might be due to LUW and tRFC You are using commit work in the same and then release of order in same  background method. Refer to link below. Try to create a separate background step to release the Order and check results

Regards

Sandy

Former Member
0 Kudos

Hello Sandy,

Thanks a lot for this advice, this seems to be the right way!

Regards,

Holger

Answers (3)

Answers (3)

meenakshi_raina
Employee
Employee
0 Kudos

Hi Holger,

I am facing a similar issue. I have to release the order from IW33 after all the approvals from workflow are completed.

The order will be created from IW31. after which the workflow will be triggered. there are few levels of approvals involved in this workflow. at the last level of approval, the order should be released. I doubt if the BAPI_ALM_ORDER_MAINTAIN can be used in my case ? I have to just change the user status to release (20).

Can you please suggest ?

Thanks

Meenakshi

Former Member
0 Kudos

Hi Meenakshi, I made the experience that you have to run the program AS BACKGROUND TASK in the ABAP code. Than the tasks which is performing the ABAP program should run delayed and it works. But I had it in some cases that it didn't work. Please try, the delayed run should be at least a Chance. Regards, Holger

SandySingh
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Sandy,

I don't have an OSS user. Could you forward the message as an attachement to your Response?

SandySingh
Active Contributor
0 Kudos

Hello

Refer to SAP note description below

Symptom

You use the BAPI BAPI_ALM_ORDER_MAINTAIN.

The BAPI supports new methods of changing the status of a PM order.

With SAP Note 1991913, the following methods were already implemented. SAP Note 1991913 is a prerequisite for this SAP Note.

  • Set the status "Do Not Execute Order"
  • Set the status "Lock"
  • Reset the status "Lock"
  • Reset the status "Technically complete"
  • Set the status "Complete (business)"
  • Reset the status "Complete (business)"
  • Set the deletion flag
  • Reset the deletion flag

With this SAP Note, you can select additional methods.

  • Set the status "Do Not Execute Order" and complete notifications
  • Set the status "Do Not Execute Order" and remove assigned notifications from the order
  • Set the status "Technical Completion" and complete notifications
  • Reset the status "Technical Completion" and process assigned notifications again
  • Set the status "Complete (business)" and complete notifications
  • Set the deletion indicator for assigned notifications as well
  • Reset the deletion indicator and process assigned notifications again

Other Terms

BAPI_ALM_ORDER_MAINTAIN, status, deletion indicator, deletion flag, reset deletion indicator, reset deletion flag, closed, completed, do not execute, enterprise asset management, EAM, enterprise asset management simplicity, EAMS, BAPI, notifications, with notifications

Solution

Implement this SAP Note in your system.

Run the report NOTE_2032068 in transaction SE38 with F8. The report automatically generates the relevant BAPI documentation.

Header Data

Released On25.02.2015 05:50:55
Release StatusReleased for Customer
ComponentPM-WOC-MO Maintenance Orders
PriorityCorrection with low priority
CategoryProgram error

Validity

Software Component

From Rel.

To Rel.

And Subsequent

EA-APPL

606

606

616

616

617

617

Correction Instructions

Correction Instructions

Software Component

Valid from

Valid to

Number

EA-APPL

606

617

1807899

EA-APPL

606

606

1808515

EA-APPL

606

606

1808644

EA-APPL

616

617

1808816

EA-APPL

616

617

1808992

EA-APPL

616

617

1809031

Support Packages & Patches

Support Packages

Software Component

Release

Support Package

EA-APPL

606

SAPK-60614INEAAPPL

606

SAPK-60615INEAAPPL

616

SAPK-61609INEAAPPL

617

SAPK-61707INEAAPPL

Causes - Side Effects

Notes / Patches corrected with this note

Note Reason

From Version

To Version

Note Solution

Version

Support Package

The table does not contain any entries

The following SAP Notes correct this Note / Patch

Note Reason

From Version

To Version

Note Solution

Version

Support Package

2032068

0

0

2122867

1

Regards

Sandy

former_member185167
Active Contributor
0 Kudos

Does WF-BATCH have SAP_NEW too? It should.

Former Member
0 Kudos

Hello Rick,

Thanks for the hint, SAP_NEW is maintained. But thanks for your support.