BAPI function caches data: In an InputScript I use the following BAPI call to read purchase orders (PO).

Call "BAPI_PO_GETDETAIL" ...

When I change the PO data in another session and read the PO again, I still obtain the old data. I have tried to clear the cache (ClearCallCache ) but this doesn't help. Could you please advise me.

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

ProcessingOption RfcDisconnect="On"
   Call "BAPI_PO_GETDETAIL" ...
ProcessingOption RfcDisconnect="Off"

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.