Skip to Content
0
Former Member
Jun 26, 2009 at 12:12 PM

Interesting problem

165 Views

Hi,

I'm facing a really weird problem i.e. I'm calling a ZBAPI in R/3 4.6C from XI through RFC adapter.

My ZBAPI is a wrapper of BAPI_QUOTATION_CREATEFROMDATA.

Deep down BAPI_QUOTATION_CREATEFROMDATA, it contains a call of function RV_SALES_DOCUMENT_ADD IN UPDATE TASK. Therefore, R/3 system inserts a record in table VBMOD so that this function can run in update task & when this function is completed the row from VBMOD is deleted.

All is fine until I call my ZBAPI repeatedly through XI after short intervals i.e. a few seconds. The first call to BAPI results in success but the subsequent call results in error DBIF_RTAB_KEY_ALREADY_EXISTS until I pause for a minute or more & then again first call is success & subsequent are failure.

I used ST05 to drill down into error & came to know that my second call to BAPI was executed when the first entry in VBMOD for function RV_SALES_DOCUMENT_ADD was still there & hence the second call attempted to create a similar record & resulted in duplicate primary key error.

Furthermore, the more I dig it the more I puzzled, because I created a custom Java program using JCO which called the same ZBAPI as XI but there was no error no matter how frequently I called ZBAPI?

In ST05 it is apparent that when XI calls this ZBAPI the system takes a lot more time to run RV_SALES_DOCUMENT_ADD in update task & when the same ZBAPI is called through custom JCO program it runs a lot faster & hence no error.

Any idea?

Hashir Ahmed