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

User Exit

Former Member
0 Likes
370

In VA01.i found the user exit but unable to write the code.

My requriment is sales employee can give the 1 to 10% discount and sales manager can give 11 to 20% discout and GM can give 21 to 30% discount.

Its very urgent requirement pls help me.

USEREXIT_SAVE_DOCUMENT_PREPARE.

tables: konv.

if sy-uname = 'ABAPDEV'.

if konv-kschl = 'K007'.

konv-KBETR < = 10 .

endif.

endif.

but it is not working. it is not going on if konv-kschl = 'K007' condition.

its checking only sy-uname and its coming out and please also check this konv table is correct or not.

Points will be awarded.

Regards

Maqsood

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
336

Hi,

Try following code.

If sy-uname = 'ABAPDEV'.

loop at xkomv into wa_komv where KSCHL = 'K007'.

write ur logic for discount....

modify xkomv from wa_komv transporting KBETR.

endloop.

endif.

Shilpa K

2 REPLIES 2
Read only

Former Member
0 Likes
336

Hi!

You might use a LOOP on the tables as well within this user exit.

Mostly the internal tables are beginning with an x.

LOOP AT xkonv.

  • your coding

ENDLOOP.

You migh check out table xkonp also.

Regards

Tamá

Read only

Former Member
0 Likes
337

Hi,

Try following code.

If sy-uname = 'ABAPDEV'.

loop at xkomv into wa_komv where KSCHL = 'K007'.

write ur logic for discount....

modify xkomv from wa_komv transporting KBETR.

endloop.

endif.

Shilpa K