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

Comparing Values entered in VA01

Former Member
0 Likes
691

Hi All,

I have a requirement like this. For example once the user enters Sold-To-Party in VA01 it is filling the INCO1 & INCO2 and other few values from the master. If the user change those values from master to some other value (say INCO1 from master is CIF and user changed it to FOB) then I have to block the sales order.

I am trying to achieve this in FM USER_EXIT_SAVE_PREPARE_DOCUMENT. I am able to get the changed value but not the default value from the master. In case of VA01 the XVBAP & YVBAP holds the same value. The filed which I want to compare will be maintained in Z table. So at the runtime I will come to know which field I should compare. All I want to know is how to get the values in VA01 which ws populated from master.

Regards,

Siva

Hi All,

I have a requirement like this. For example once the user enters Sold-To-Party in VA01 it is filling the INCO1 & INCO2 and other few values from the master. If the user change those values from master to some other value (say INCO1 from master is CIF and user changed it to FOB) then I have to block the sales order.

I am trying to achieve this in FM USER_EXIT_SAVE_PREPARE_DOCUMENT. I am able to get the changed value but not the default value from the master. In case of VA01 the XVBAP & YVBAP holds the same value. The filed which I want to compare will be maintained in Z table. So at the runtime I will come to know which field I should compare. All I want to know is how to get the values in VA01 which ws populated from master.

Regards,

Siva

2 REPLIES 2
Read only

eduardo_hinojosa
Active Contributor
0 Likes
558

Hi

See SAP Note 178328 - Problems due to incorrect user exits in SD, it explains how to work this userexit and the role of X tables and Y tables for this userexit.

I hope this helps you

Regards

Eduardo

Read only

Former Member
0 Likes
558

First of all, you would want to loop at XVBAP where UPDKZ eq 'U', to find the rows that had actually changed. Comparing that posnr to the row with the same posnr in YVBAP would show you what had actually changed in the fields of XVBAP.

However, if you're looking for the INCO data, you'd need to be looking at table VBKD and it's X and Y versions, wouldn't you? In this case, posnr = 0 would be header level business data, while NE 0 would be the individual items (posnr). I don't think this data is part of VBAP, but I don't utilize SD in my current assignment, so am not certain.

You can find the INCO data values for your business partner in view KNA1VV or in table KNVV. You would need to get your sold-to from VBPA by reading for the correct PARVW field value, but I don't recall whether there is an XVBPA and YVBPA or not.