The BAPI function
probably reads the PO from an internal cache instead of from the database when
you call it the second time.
For some BAPI
functions this can be controlled via a special input parameter, but for this
BAPI I haven't found a cache control parameter. In other cases there is a
special BAPI that can be called to set the cache behaviour, but I didn't find
such a call for this case.
Here is a
workaround: Disconnect the RFC connection with
Call "BAPI_PO_GETDETAIL" ...
so that you work in
a new RFC environment. The performance is slightly slower with this setting
since a new RFC logon is necessary, but it will solve the BAPI cache problem.