‎2009 Jun 04 11:28 AM
Hi everyone.
I have a little problem with BAPI_PO_CREATE FM. Purchase order was generated and there is a new number of that order.
After that I have BAPI_TRANSACTION_COMMIT function.
The problem is when I want to select some data from EKKO/EKPO tables after order was created.
There is no PO in that tables. When I wrote :
WAIT UP TO 5 SECONDSeverything is fine...
Regards.
‎2009 Jun 04 11:31 AM
So what i a problem. some time it takes few mil seconds to save the data at database level.
Atul
‎2009 Jun 04 11:36 AM
All right, but after BAPI_TRANSACTION_COMMIT (even with " wait = 'X' ") all data should be saved ...
When You will generate a great many orders, time which is need to save all data will be longer ...
‎2009 Jun 04 11:36 AM
All right, but after BAPI_TRANSACTION_COMMIT (even with " wait = 'X' ") all data should be saved ...
When You will generate a great many orders, time which is need to save all data will be longer ...
‎2009 Jun 04 1:34 PM
Hi
You're right,
but u need to decide what it's better for you:
You must accept a compromise beetween performance and the needs of your program.
Max
‎2009 Jun 04 1:40 PM
So if I will have some DB update and after this I have COMMIT WORK AND WAIT command I need to wait some time to saving data ?
‎2009 Jun 04 1:52 PM
Hi
No! Because you're program'll wait for the end of saving data
Max
‎2009 Jun 04 2:23 PM
To max.
Exactly, same situation should be with BAPI_TRANSACTION_COMMIT with wait option... (I suppose).
I see, that all proposals are simply of WAIT TO .. SECONDS modyfications, but I dont want that method.
‎2009 Jun 04 2:41 PM
I am not too sure about the WAIT option after the Commit. Just not sure if that solves the problem.
The reason why is that in the documentation for the BAPI there is no reference at all to the requirement of the COMMIT WORK statement... Usually it is.
Edit: Okay, checked and the COMMIT is necessary.
We still chose to use the WAIT UP TO <n> SECONDS (after a read on the Database) to make absolutely sure that the PO is created.
First do a COMMIT WORK AND WAIT, then read the Database, if the PO does not exist, then WAIT UP TO n SECONDS and repeat x times.
It is not a nice solution, but it is safe.
Edited by: Edwin Vleeshouwers on Jun 4, 2009 3:48 PM
‎2009 Jun 04 11:33 AM
Hi
When u call the BAPI for the COMMIT u should check the parameter for WAIT
Max
‎2009 Jun 04 11:33 AM
Hi Daniel,
I think After immediately creating PO you try to Retrieve From Table It need Some Seconds To select after Commit So if you Want to retrieve immediately after creating you have to give wait Statement.
‎2009 Jun 04 11:35 AM
Hello,
i understand from your query that the PO number is getting generated but not storing in table.
i to faced the alike issue ,
i used statement
*
wait up to 2 seconds.
commit work. " use bapi commit work.
*
thanks "& regards,
kat k.
‎2009 Jun 04 1:12 PM
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = BAPIRETURN.
‎2009 Jun 04 1:28 PM
Hi,
Try using,
BAPI_TRANSACTION_COMMIT
There will be one parameter, wait
In that you can give the duration like
5 secs or so before commiting the
transaction.
Hope it helps
Regards
Mansi
‎2009 Jun 04 2:07 PM
Also the other BAPI_PO_CREATE1 can have this issue...
It can be 'solved' like this:
* Wait until it is REALLY created and available... For some reason,
* the purchase order that has been created is not yet available...
* In case of really bad system performance this can be an issue!
* For the upgrade, I increase the number of retries and the wait
* time.
do 12 times.
select single ebeln from ekpo into exppurchaseorder
where ebeln = exppurchaseorder.
if sy-subrc = 0.
exit.
else.
commit work and wait. " <-- just to make sure...
perform wait_sec.
endif.
enddo.Silly, but it works.