cancel
Showing results for 
Search instead for 
Did you mean: 

VA02-delay in DB update

Former Member
0 Kudos

Hi all,

We have developed a bespoke wherein the route entered in the sales order header overwrites all the routes in the sales order line items. The standard code has been repaired for this. The issue is, in one of our environments, when we change the header route via VA02, the item routes are getting updated but this operation takes 10-15 mins and all the while the sales order is locked. The besopke code gets executed and the screen comes back to initial VA02 screen, but the DB update takes time. I request your inputs in this regard. Thanks in advance.

Regards

Murthy

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Suryanarayan,

The piece of code which u have given is the one which u have added in the program?? Also I don't c any issue in the code, when u say it is causing delay in update, I don't c any update in the program. Can u also indicate how did u arrive at conculsion that the piece of code which u have show is causing the problem.

Former Member
0 Kudos

Hi,

The issue is this:

We have modified the standard screen of VA02 program wherein the route in the line items is over-written by route entered in the header. This is causing a problem in DB update, in one of our testing systems(when the Sales order has more than 4 line items only), wherein it takes around 15 mins to update the VBAK, VBAP (and other Sales Order related tables).

I was able to identify the code part that is causing the issue, but yet the reason why it is doing so is missing.

This is the code that is causing the problem.

LOOP AT xvbap WHERE updkz NE 'D'.

l_tabix = sy-tabix.

xvbap-route = vbak-zzroute.

IF sy-tcode = 'VA02'.

<<We will check if the line item exists in the DB, if yes then UPDKZ = U', else 'I'.>>

READ TABLE t_vbap_check WITH KEY vbeln = xvbap-vbeln

posnr = xvbap-posnr.

IF sy-subrc EQ 0.

v_updkz = 'U'.

ELSE.

v_updkz = 'I'.

ENDIF.

ENDIF.

MOVE v_updkz TO xvbap-updkz.

MODIFY xvbap INDEX l_tabix.

ENDLOOP.

It would be helpful if someone can share their views on this. Thanks in advance.

Former Member
0 Kudos

Hello,

Problem is Modify in Loop on same table , rebuilding the index.

Dont perform operation on XVBAP directly, create a Internal table with same structure of XVBAP say it_xvbap.

Copy the content.

it_vbap[] = xVBAP[].

Now instead of modify in loop, use Field symbols.

Loop at it_xvbap assigning <FS_XVBAP>

...................

............

..........

<FS_XVBAP>-updkz = v_updkz.

Endloop.

Rgds,

Mano Sri

Former Member
0 Kudos

Hi Mano,

This is worth a trying. Will do and let you know.

Once the loop..endloop on new internal table it_vbap ends, we again need to copy it back to XVBAP like

XVBAP[] = IT_VBAP[].

Anything you would offer to say at this point, please let me know.

Thanks.

Former Member
0 Kudos

Hello,

Yes, we need to put it back, take care to declare it_vbap

with exact structure of XVBAP , else you will have Short dumps in back ground .

Regds,

Mano Sri

Former Member
0 Kudos

Hi Mano,

I have tried using the solution you suggested, but it doesn't help. The sales order still takes 10 -15 mins to update the Db tables (VBAK, VBAP, etc..) and is locked all that while. Any other suggestions. Thanks in advance.

Former Member
0 Kudos

Hello,

One question you have to ask yourdelf, standard SAP VA01 transaction would nto take so much time for updation.

So there must be some user enhancement or routine that is playing the foul game.

Check all SD tables not jst vbak and vbap , check in vbep, Vbfa etc if any secondrady indexes are created , keep deleting if any exits and check.

Run St05 whiel saving va03 and see where it takes more time to update.

We can only help you wiht what you can check in general , but canot get in detail , sorry.

Wish you will be sucessful with your efforts.

Regds,

Mano Sri

Former Member
0 Kudos

Hi Murthy and Mano Sri,

I encountered your old posting for delays because of your code in VA01/VA02 transaction. The problem is that you are marking line in XVBAP for update that might not be updated by the user and is not in YVBAP table, so it takes long time to verify and compare values ... As soon as you are going to append record that you marked for Update into YVBAP table with values before change (YVBAP holds OLD values), the system will be sky rocking.

Paul.

former_member181966
Active Contributor
0 Kudos

1- Did you check OSS notes about VA02 performance? I can see around lot of notes .

2- What’re the tables which making it slow?

Thanks

Saquib

Message was edited by: Saquib Khan