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

logic needed

Former Member
0 Likes
478

i had a ztable and in that zqty(quantity field) is there. it is updated

when we save the sales order.it is written in the exit and through

xvbap structure we are updating the table.

one issue came for us when we are changing the qty in va02.

suppose the ztable has been populated with qty say 30 by 3 sales orders.

now i am chnaging one sales order and making the quantity 3 instead of 12(which is updated in

the ztable has 12) now according to my present logic it becomes 50+3=53.

but actually it should become 41 ( because 50-12=38 and for that

38 we are adding 3qty ie changed qty through va02.).

so how to track the old value of the sales order which is

going to be changed.

so please tell me how to write the logic for updating the ztable with

correct qty.

thanks for all the replies.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
453

Hi!

In the MV45AFZZ user-exit program, you have the following useful tables (before save):

XVBAK - new header

YVBAK - old header

XVBAP - new items

YVABP - old items

XVBEP - new items scheduling

YVBEP - old items scheduling

In the XV* table, there's an UPDKZ field, which can have the following states

- I - inserted line

- U - updated line (in this case, YV* table contains the old values)

- D - deleted line

Regards

Tamá

3 REPLIES 3
Read only

Former Member
0 Likes
454

Hi!

In the MV45AFZZ user-exit program, you have the following useful tables (before save):

XVBAK - new header

YVBAK - old header

XVBAP - new items

YVABP - old items

XVBEP - new items scheduling

YVBEP - old items scheduling

In the XV* table, there's an UPDKZ field, which can have the following states

- I - inserted line

- U - updated line (in this case, YV* table contains the old values)

- D - deleted line

Regards

Tamá

Read only

0 Likes
453

Thank you so much for your timely help.

Read only

valter_oliveira
Active Contributor
0 Likes
453

Hello.

In first place you have to differenciate between inserts and updates of quantities in VA02. You can do that like this.


CASE xvbap-updkz.
  WHEN 'I'. "insertion of line -> your previous logic
  WHEN 'U'. "update -> your new case.
  WHEN 'D'. "deletion ->another case you should consider.
  WHEN OTHERS.
ENDCASE.

Now, case updkz EQ 'U' or 'D' you have to check which was the old quantity. For that check structure YVBAP.

Regards.

Valter Oliveira.