02-14-2006 9:59 AM
Hi All,
Just wondering if any of you have come across this before.
We have a bespoke program that runs in the background as a scheduled job and it reads data from a flat file on the network, it then proceeds to call the BAPI (BAPI_PLANNEDORDER_CHANGE) and directly after that I use BAPI_TRANSACTION_COMMIT (with no WAIT time) but the record is locked, we presume its because the current PO in the ITAB is the same as the previous row, but maybe it because of some other reason. Any suggestions??
Kind Regards.
02-14-2006 10:06 AM
Hi conor,
1. I don't know whether i understood ur question properly !
2. U are reading from flat file, into internal table.
3. Loop at itab.
Call BAPI_PLANNEDORDER_CHANGE
call BAPI_TRANSACTION_COMMIT
endloop.
4. Use the above logic,
(ie , with each loop pass, use commit)
regards,
amit m.
02-14-2006 10:06 AM
Hi conor,
1. I don't know whether i understood ur question properly !
2. U are reading from flat file, into internal table.
3. Loop at itab.
Call BAPI_PLANNEDORDER_CHANGE
call BAPI_TRANSACTION_COMMIT
endloop.
4. Use the above logic,
(ie , with each loop pass, use commit)
regards,
amit m.
02-14-2006 10:07 AM
Hi,
May be some one else is editing the order at the same time.
are you sure that same order is there is next record.
is it the same case with rest of the orders
i mean for the repeated orders.
regards
vijay
02-14-2006 10:26 AM
Hi There,
1. Vijay, Because of the time that this job runs (schedule time) there are no users on the system and it highly unlikly that another job is processing that PO. There are other occurances where the PO is repeated and thease rows process through fine.
2. Amit, this is what I am doing only I dont specify a COMMIT-WORK because the BAPI_TRANSACTION_COMMIT takes care of that.
It look like maybe the system was a bit to fast for my program, will have to get some more processing going on.
Thanks for you help, points on the way
02-14-2006 10:47 AM
hi ,
Before calling the BAPI just try to lock that purchase order using EKKOE lockobject if you can able to lock sucessfully then release the lock and call the bapi.
if you are unable to lock then keep it in loop till that po is unlocked and then call the bapi.
02-14-2006 12:05 PM
Hi Rajkumar,
This is very useful never thought of that I will investigate this further in the mean time how do you use the EKKOE lockobject ?
Best Regards
02-14-2006 12:25 PM
hi conor,
You can use EKKOE lock object by calling function module ENQUEUE_EKKOE. For this you pass the PO number which you want to lock. For releasing the lock same DEQUEUE_EKKOE function module.
02-14-2006 3:10 PM
Hi Rajkumar,
This really helpful thanks for this.
Best regards,
Conor.