cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with "BAPI_TRIP_CHANGE_STATUS" FM in Travel Mgmt - Reg

Former Member
0 Kudos

All,

I am working with ECC 6.0 with

SAP_BASIS 700 0012 SAPKB70012 SAP Basis Component

SAP_ABA 700 0012 SAPKA70012 Cross-Application Component

I am using the above FM in my custom workflow's custom background method. THis is used to set the Settlement status to OPEN.

Of late, in Production, i am seeing this issue of trip getting locked by WF-BATCH itself. Has anybody faced such issue ?

To let you know my analysis & Observation on the above FM,

this FM, for some reason, is locking both the PERNR and REINR (Trip #), even though i feel, it's NOT ALWAYS necessary. Initially, there were couple of instances during our development and testing phases, i noticed that when i used the same FM to set the Trip status to "APPROVED",the PERNR was locked and hence the trip status couldn't be set to APPROVED. THis happened (not all the times though) even when the PERNR user was editing some other trip, not the trip whose status is being set. But, the WF-BATCH was making 3 attempts(in a span of about 1 hr), to execute the same method and when both the PERNR & REINR are free, it was successfully executing the method, setting the Trip status.

But, with the method that i am having problem with, where i am trying to set the Settlment status to OPEN, with the same above std. FM, it's NOT making multiple attempts to re-execute the method. It simply is erroring out with the error

message "Key PERNR locked by WF-BATCH" error.

Anybody, if faced similar issue and fixed it, please let me know.

I found the OSS Note 980006, but that's relevant to Rel 600 and noother relevant ones.

I'd really appreciate immediate help on this issue. Please let me know if you need more details or not clear of the issue.

Thanks in advance.

venu

Edited by: Venugopal Jogi on Oct 20, 2008 12:02 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

We resolved the issue as mentioned in my latest reply and so closing the thread

surjith_kumar
Active Contributor
0 Kudos

Hi,

This will happen while the BAPI_TRIP_CHANGE_STATUS executing via workflow for changing the Trip status, at the same time Creator open that same Travel Request to change the Trip details. Then in the workflow log you will see the Message like this Pernr locked for that step.

In the Workflow Log it will show INPROCESS state right.

Once the User comes out of that Travel Request, after some time Status will be set automatically and proceed to next Step. You donu2019t need to change the workflow. Once this happen, take the screen shot of the workflow log, and check the same after 6 or 8 Hrs, it will proceeds to next step.

Regards,

Surjith

Former Member
0 Kudos

Hi,

Our set up here is like once the employee submits the trip, he is not allowed to change that particular trip unless either it's approved or rejected,which is when in the wflow we open up the trip again for Employee to edit and Resubmit. Also, as you suggested, if the Employee is locking it, we will be getting ( and got in a couple of cases also) the messsage "Key PERNR locked by User XXXX" like that.

So, employee locking the PERNR may not be the issue here.

And, Yes, there are multiple attempts made to run this FM and if it's successful, its good. But, i want to know the root cause than waiting for hrs to get it resolved on its own.

Thank you for your reply

venu

Former Member
0 Kudos

All,

I'm closing this thread as i think we solved the issue. As was pointing this locking by WF-BATCH itself was coming into picture only in case of multiple trips being processed (using the same BAPT_TRIP_CHANGE_STATUS Function module) at the same time, for a specific PERNR. After debugging, we found that the above FM locks the whole PERNR and so when the initial trip's status is being updated, the later trips, if try to lock the PERNR, this was throwing out the error.

Now, as per Tommy Bradham's suggestion, we are capturing these as Temporary error and re-process them once ever 15 min or so, which seems have resolved the issue.

So, am closing this thread. Thank you all for your valuable input.

venu

Edited by: Venugopal Jogi on Jun 8, 2009 4:15 PM

Former Member
0 Kudos

All,

I'm re-opening this message as this is becoming more prominent recently. This issue was happening very rarely in PRD (2-3 times in the last 6 months). But last couple of days, it has become frequent and so I would like to resolve this.

Anybody, faced similar issue ? or any idea why this is might be happening would be of great help.

Thanks in advance

venu

Former Member
0 Kudos

I got around a similar thing with the posting of FI documents. If I had a PO related invoice, the posting would sometimes error if say a user had the PO open at the time of posting. This would also happen sometimes with documents with earmarked funds.

The way I got around this was to create a z version of the post method in the BO and add a temporary exception for it. Then I trapped the blocking error code and raised the temporary exception. You can go into your task in the workflow builder and set execution repeat options for the task in the Misc tab for temporary errors. I just had it repeat every few minutes or so until the locking problem was gone and it posted fine.

Former Member
0 Kudos

Tommy,

Thank you for your valuable suggestion. I can always do that as mine is a custom method only where i am using this std. FM to set the TRIP status. But, i wanted to find out the reason behind this WF-BATCH itself locking the PERNR. I'll implement your solution if I cannot find out the root cause soon.

Thanks again.

Anybody,

any idea why this might be happening ?

Thanks

venu

former_member185167
Active Contributor
0 Kudos

Hello,

I'll ask the obvious question: is this PERNR being used in another workflow (incl sub-workflow)

at the same time?

regards

Rick Bakker

Hanabi Technology

Former Member
0 Kudos

Rick,

This PERNR has not been used by anyother (sub)workflow at the same time.

Thanks

venu