‎2008 Jul 03 12:37 PM
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.
‎2008 Jul 03 12:46 PM
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á
‎2008 Jul 03 12:46 PM
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á
‎2008 Jul 03 12:53 PM
‎2008 Jul 03 12:54 PM
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.