Application Development and Automation 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: 
Read only

BAPI over BDC performence perspective?

former_member202077
Participant
0 Likes
683

Hello

I am trying to do performence tuning a RFC function module, thisRFC is creating sales orders from contracts by using BDC for VA01, well.

If the sales order is created in this BDC, in next step, we are changing the ship-to address by using VA02 BDC.

Obviously we have n number of custom code in SAPMV45A user-exits, but, i guess, these user-exits will be triggered based on scenarion (like maintaining flags, validations), pls. let me know

1) In performence perspective, do i need to change this BDC into BAPI (i knew BAPI is always recommendable, but, this RFC is widely used in many case, so, ppl scare to change the code code)? if it results very very good performce, then its worth, other wise, if its a little betterment, i guess, its not worthy bcz its widely used

2) There is check on VBAK after VA01 BDC that, whetehr the sales order is created in the system, for that we are using WAIT UPTO 5 SECONDS, but, am thnking to use the below code,

DO 1000 TIMES

SLEECT SINGLE auart

  INTO lv_auart

  FROM vbak

  WHERE vbeln = lv_VA01_BDC_created_new_order

So, in performce perspective, which is best, either WAIT UP TO or DO LOOP?

Thank you

Moderator message: please do not cross-post the same question in multiple spaces.

Message was edited by: Thomas Zloch

Hello

I am trying to do performence tuning a RFC function module, thisRFC is creating sales orders from contracts by using BDC for VA01, well.

If the sales order is created in this BDC, in next step, we are changing the ship-to address by using VA02 BDC.

Obviously we have n number of custom code in SAPMV45A user-exits, but, i guess, these user-exits will be triggered based on scenarion (like maintaining flags, validations), pls. let me know

1) In performence perspective, do i need to change this BDC into BAPI (i knew BAPI is always recommendable, but, this RFC is widely used in many case, so, ppl scare to change the code code)? if it results very very good performce, then its worth, other wise, if its a little betterment, i guess, its not worthy bcz its widely used

2) There is check on VBAK after VA01 BDC that, whetehr the sales order is created in the system, for that we are using WAIT UPTO 5 SECONDS, but, am thnking to use the below code,

DO 1000 TIMES

SLEECT SINGLE auart

  INTO lv_auart

  FROM vbak

  WHERE vbeln = lv_VA01_BDC_created_new_order

So, in performce perspective, which is best, either WAIT UP TO or DO LOOP?

Thank you

Moderator message: please do not cross-post the same question in multiple spaces.

Message was edited by: Thomas Zloch

4 REPLIES 4
Read only

Former Member
0 Likes
629

Calling WAIT is not necessary.Do it in a Loop

Read only

Former Member
0 Likes
629

Hi MSR,

Instead of doing WAIT upto 5 secs why dont you do a Commit work and wait after VA01.

Thanks,
Shambu

Read only

former_member209920
Active Participant
0 Likes
629

Hi

BAPI is always recommended over BDC for better performance and reliability. But The decision of change is entirely dependent on the effort involved, willingness to change and current performance (which I guess is not great that's why you are tuning it.)

Regarding the WAIT, it is again on developer's choice and conscious, but using WAIT is not recommended when you have large amount of data for processing multiple times.

Regards,

ManuB

Read only

Kartik2
Contributor
0 Likes
629

Hi,

Very interesting thread. Here are my suggestions ;

1. If you can find a suitable BAPI to achieve the same functionality that is being done in your BDC then it is always advisable to use a BAPI, because in the forth coming relases of SAP the screens which are used in your recording may change and in that case, definitely you need to do a rework on your program. And also bapi comes with a return parameter, where if there is no error entry that means that you can do a commit and your sales order will be created.

2. In your second query, you are hitting the data base 1000 times which is a very bad way of programming. Please avoid it, here your requirement is to find out weather your sales order is created succesfully or not. So for that if you use a bapi and monitor for type 'E' messages in the return parameter, and if you find none then it means that the sales order is created.

On the other hand if you want to stick to the existing BDC, then also you can monitor the BDC message table and look for messages of type 'E'. If you find any that means that the sales order is not created and if you find none then it means that the sales order is succesfully created.

Hope it helps you. Thank you.

Regards,
kartik