Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

VBA with SAP BAPI call is so slow

Former Member
0 Kudos

Dear everyone

I've been try to use SAP BAPI (via remove function call) from my VBA (Excel).

ex) Logistics Execution --> Shipping --> Delivery Processing --> DeliveryGetlist

However when I load the BAPI with the following statement in Excel VBA, the performance becomes

so slow. (It takes about 30 seconds to even load BAPI before execution)

I'd like to attach the screenshot of my code snipets. Would you possibly tell me if there is any way to

improve the performance?

It becomes especially slow from the statement below in the screenshot.

Set l_objDel_Control = oBaPICtrl.DimAs(oDeliveryBapi, "DeliveryGetlist", "IsDlvDataControl")

I've been trying to find the answer for long time, so so any help would be highly appreciate it!

Kind regards,

Takashi

5 REPLIES 5

SimoneMilesi
Active Contributor
0 Kudos

Hi Takashi,

i do not remember VBA syntax, so i'll ask you a couple of questions before trying to give you any reasonable answer

I think you are using SAP connector, right? I used it for an ANSI C development but i do not found any performance issue (i call BAPI_MATERIAL_SAVEREPLICA).


What does the code you posted? Invoke the BAPI?

If so, 30 seconds can be a reasonable time, depending by the data volume and the SAP system performances.

If you are an ABAPer, open SM50 transaction and check what the system does when you invoke that statement.

If you are not, ask to an ABAPer to do the check with you


If you see no activity under SM50, it's something related your code/Excel and then you can investigate from there.

0 Kudos

Dear Simone

Thank you for your support!

I will certainly have a look at the result of SM50.

Sandra_Rossi
Active Contributor
0 Kudos

That's really Strange. 30 seconds is too long for a simple CreateObject (I presume). DimAs shouldn't be an issue too! Without code snippet, impossible to help further! Maybe reinstall your SAP GUI...

0 Kudos

Dear Sandra

Thank you for your advise on this.

The following is the code which take like 30 seconds to execute.

※I changed it to BAPI to Function module call.

set oRFcall = CreateObject("SAP.Functions")

※I connect to the SAP server.

Set RFDElList = oRFcall.Add ("BAPI_DELIVERY_GETLIST")   --> This takes like 30 seconds

Would you tell me how to speed up the execution of the statement above?

Kind regards,

Takashi

0 Kudos

Oh, so it's the call to the BAPI which is slow (i.e. the BAPI itself probably). Why mentioning VBA in the title? (VBA is only worth mentioning for the context)

What amount of data do you retrieve?

Anyway, it's about tuning the system. cf SM50, ABAP traces (ST05) and so on to analyze what's going on.

Moreover, to make sure it's only due to the BAPI itself, go to SE37, and call it with the same parameters as those you use with the VBA.