Skip to Content
avatar image
Former Member

Interesting problem

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 26, 2009 at 12:18 PM

    Hi Hashir,

    Since you are aware of java and JCO , I can safely assume you have idea of threads and thread priorities . As you explicitly define threads in java . The server / CPU automatically determine the priority of things to be done. Moreover things on the ABAP stack take a little longer then on the java stack. This should not be a major issue as this is the way things are . As long as things work , all is well and fine.

    Regards

    joel.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi everyone!

      I've solved the problem by calling BAPI_TRANSACTION_COMMIT in ZBAPI just after BAPI_QUOTATION_CREATEFROMDATA call.

      Thanks for all those replied.

      Hashir Ahmed

  • avatar image
    Former Member
    Jun 26, 2009 at 12:23 PM

    Hi

    Also try to increase --> Maximum Connections

    rgds

    srini

    Add comment
    10|10000 characters needed characters exceeded