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

Sample Code for user exit

Former Member
0 Likes
669

Dear all,

I am using a userexit to check the user name and accordingly allow or not the user to fill

VBAK-KVGR1

Now I want a further check. I want the system not to take into account the user (and therefore allow to fill or modify the VBAK-KVGR) if the total amount of the quotation or sales order is less that 1,000 Euros

Can you please help me in which user exit to use and a sample code.

I have tried it a lot but I think especially I have problem when trying to write in the code the amount (don't know how to form the abap statement)

3 REPLIES 3
Read only

Former Member
0 Likes
582

Hi Stilianos,

you should check if you can use OVA8 to set your check before proceed.

Use exit USEREXIT_SAVE_DOCUMENT_PREPARE(MV45AFZZ)

and check value XVBAK-NETWR.

regards,

edgar

Read only

0 Likes
582

Suggesting that the value is 1000euro how should I form the ABAP statement

IF XVBAK-KWERT > '1000'.

is this right because I am facing abap error when trying to interpret 1000 as a number.

Read only

0 Likes
582

Putting the 'number' between quotes, that would suggest a character. Just loose the quotes and it will be treated as a number.

BTW: Is the currency always euro? Otherwise, you will have to do the conversion from one currency to EURO as well.